This commit is contained in:
2024-04-27 09:23:34 +02:00
commit 11e713ca6f
11884 changed files with 3263371 additions and 0 deletions

View File

@@ -0,0 +1,207 @@
<?php
$w = "70"; // first column width
$w2 = "15"; // second column width
$content = '
<table style="width: 100%; font-size: 8pt;">
<tr>
<td style="width: ' . $w . '%">
<b><h1>Przesuniecie magazynowe</h1></b>
</td>
<td style="width: ' . $w2 . '%">
Numer:
</td>
<td style="text-align: right">
<b>' . $focus->document_no . '</b>
</td>
</tr>
<tr>
<td style="width: ' . $w . '%">
&nbsp;
</td>
<td style="width: ' . $w2 . '%">
</b>Data wystawienia:</b>
</td>
<td style="text-align: right">
<b>' . $focus->register_date . '</b>
</td>
</tr>
<tr>
<td style="width: ' . $w . '%">
&nbsp;
</td>
<td style="width: ' . $w2 . '%">
Wystawił:
</td>
<td style="text-align: right">
<b>' . $user->full_name . '</b>
</td>
</tr>
<tr>
<td style="width: ' . $w . '%">
&nbsp;
</td>
<td style="width: ' . $w2 . '%">
Z magazynu:
</td>
<td style="text-align: right">
<b>' . $focus->stock_out_name . '</b>
</td>
</tr>
<tr>
<td style="width: ' . $w . '%">
&nbsp;
</td>
<td style="width: ' . $w2 . '%">
Na magazyn:
</td>
<td style="text-align: right">
<b>' . $focus->stock_in_name . '</b>
</td>
</tr>
</table><br>
';
if ($focus->name && $focus->name != '') {
$content .= '
<table style="width: 100%; text-align: center">
<tr><td>
<b>' . $focus->name . '</b>
</td></tr>
</table>
';
}
$content .= '<br>';
// start items table
$columns = array ();
$columns ['position'] = array (
'field' => array (
'position'
),
'label' => 'Lp.',
'align' => 'center'
);
$columns ['name'] = array (
'field' => array (
'name',
'product_code'
),
'label' => 'Nazwa<br>Indeks',
'align' => 'left'
);
$columns ['qty'] = array (
'field' => array (
'quantity',
'unit_name'
),
'label' => 'Ilość<br>J.m.',
'align' => 'right'
);
$columns ['price'] = array (
'field' => array (
'price'
),
'label' => 'Cena',
'align' => 'right'
);
$columns ['total'] = array (
'field' => array (
'total'
),
'label' => 'Wartość',
'align' => 'right'
);
if ($_REQUEST ['show_logistic_info']) {
$columns['logistic_info'] = array (
'field' => array(
'product_pieces_per_carton',
'product_cartons'
),
'label' => 'Ilość sztuk w kartonie<br>Ilość kartonów',
'align' => 'right',
'width' => '15'
);
}
// set widths
$totals = array ();
$columns ['position'] ['width'] = '5';
$columns ['name'] ['width'] = '45';
$columns ['qty'] ['width'] = '10';
$columns ['price'] ['width'] = '20';
$columns ['total'] ['width'] = '20';
// rysujemy :)
$content .= '
<table style="width: 100%; font-size: 7pt; border: 0.5 solid black; border-collapse: collapse"><thead>
<tr>
';
foreach ( $columns as $col ) {
$content .= '
<th style="border: 0.5 solid black; width: ' . $col ['width'] . '%;">' . $col ['label'] . '</th>
';
}
$content .= '
</tr></thead><tbody>
';
foreach ( $positions as $pos ) {
$content .= '<tr>';
foreach ( $columns as $col ) {
$content .= '<td style="border: 0.5 solid black; text-align: ' . $col ['align'] . ';">';
foreach ( $col ['field'] as $f ) {
if (! $pos [$f] || $pos [$f] == '')
$pos [$f] = '-';
$content .= $pos [$f] . '<br>';
}
$content .= '</td>';
}
$content .= '</tr>';
}
$content .= '
</tbody></table>
';
// summary table
// get currency symbol
$c = new Currency ();
$c->retrieve ( $focus->currency_id );
$symbol = $c->symbol;
unset ( $c );
$content .= '
<br><br>
<table style="font-size: 9pt; border: 0.5 solid black; border-collapse: collapse; width: 215px; margin-left: 70%">
';
$content .= '
<tr>
<td style="border: 0.5 solid black; width: 50%;">
Suma
</td>
<td style="border: 0.5 solid black; text-align: right;">
' . format_number ( $focus->total) . ' ' . $symbol . '
</td>
</tr>
';
$content .= '
</table>
<br><br>
' . $focus->pdf_text . '
';
//echo $content; die();

View File

@@ -0,0 +1,12 @@
<?php
$header = '
<table style="font-size: 7pt; width: 100%"><tr>
<td style="width: 80%">
&nbsp;
</td>
<td style="text-align: right; vertical-align: bottom;">
www.e5.pl
</td>
</tr></table>
<hr>
';

View File

@@ -0,0 +1,28 @@
<?php
function formatPDFPositions($positions, $focus) {
$result = array();
foreach ($positions as $pos) {
$pos['position'] = intval($pos['position'])+1;
$pos['quantity'] = format_number($pos['quantity'],4,2);
$pos['price']=format_number($pos['price']);
$pos['total']=format_number($pos['total']);
$result[] = $pos;
}
return $result;
}
function mysql_escape_gpc($dirty)
{
if (ini_get('magic_quotes_gpc'))
{
return $dirty;
}
else
{
return mysql_real_escape_string($dirty);
}
}