Rozchód Wewnętrzny
|
Numer:
|
' . $focus->document_no . '
|
|
|
Data wystawienia:
|
' . $focus->register_date . '
|
|
|
Wystawił:
|
' . $user->full_name . '
|
|
|
Z magazynu:
|
' . $focus->stock_name . '
|
';
if ($focus->name && $focus->name != '') {
$content .= '
';
}
$content .= '
';
// 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
Indeks',
'align' => 'left'
);
$columns ['qty'] = array (
'field' => array (
'quantity',
'unit_name'
),
'label' => 'Ilość
J.m.',
'align' => 'right'
);
$columns ['price'] = array (
'field' => array (
'price'
),
'label' => 'Cena',
'align' => 'right'
);
$columns ['total'] = array (
'field' => array (
'total'
),
'label' => 'Wartość',
'align' => 'right'
);
// 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 .= '
';
foreach ( $columns as $col ) {
$content .= '
| ' . $col ['label'] . ' |
';
}
$content .= '
';
$counter=1;
foreach ( $positions as $pos ) {
$content .= '';
foreach ( $columns as $col ) {
if($pos['ecmproductcategory_id']=='d7f876b0-1a3d-43a1-7c9b-511ba40df3d1')continue;
$content .= '';
foreach ( $col ['field'] as $f ) {
var_dump($col ['field']);
if($f=='position'){
echo $pos [$f]=$counter;
$counter++;
}
if (! $pos [$f] || $pos [$f] == '')
$pos [$f] = '-';
$content .= $pos [$f] . ' ';
}
$content .= ' | ';
}
$content .= '
';
}
$content .= '
';
// summary table
// get currency symbol
$c = new Currency ();
$c->retrieve ( $focus->currency_id );
$symbol = $c->symbol;
unset ( $c );
$content .= '
';
$content .= '
|
Suma
|
' . format_number ( $focus->total) . ' ' . $symbol . '
|
';
$content .= '
' . $focus->pdf_text . '
';
//echo $content; die();