type == 'normal') $text = 'Faktura nr'; if ($focus->type == 'correct') $text = 'FAKTURA KOREKTA nr'; $w = "35"; // first column width $w3 = "35"; $w2 = "25"; // second column width $content = '
' . $text . ' ' . $focus->document_no . '
| ' . $labels['LBL_PDF_CONTENT_INVOICE_FOR'] . ' | '; if ($focus->parent_shipping_address_name != '') { $content .= 'DOSTAWA'; } $content .= ' | '; if ($focus->parent_payer_address_name != '') { $content .= 'PŁATNIK'; } $content .= ' | |
| ' . $focus->parent_name . ' | ' . $focus->parent_shipping_address_name . ' | ' . $focus->parent_payer_address_name . ' | |
| ' . $focus->parent_address_street . ' | ' . $focus->parent_shipping_address_street . ' | ' . $focus->parent_payer_address_street . ' | |
| ' . $focus->parent_address_postalcode . ' ' . $focus->parent_address_city; if (!is_null($focus->parent_address_country) & $focus->parent_address_country != '') $content .= ', ' . $focus->parent_address_country; $content .= ' | ' . $focus->parent_shipping_address_postalcode . ' ' . $focus->parent_shipping_address_city; if (!is_null($focus->parent_shipping_address_country) & $focus->parent_shipping_address_country != '') $content .= ', ' . $focus->parent_shipping_address_country; $content .= ' | ' . $focus->parent_payer_address_postalcode . ' ' . $focus->parent_payer_address_city; if (!is_null($focus->parent_payer_address_country) & $focus->parent_payer_address_country != '') $content .= ', ' . $focus->parent_payer_address_country; $content .= ' | |
| ';
if (!is_null($focus->parent_nip) && $focus->parent_nip) {
$content .= $labels['LBL_PDF_CONTENT_NIP'] . ' ' . $focus->parent_nip;
$nip = true;
}
if (!is_null($focus->parent_iln) && $focus->parent_iln) {
if ($nip) $content . ' '; $nip = false; $content .= ' ILN: ' . $focus->parent_iln; } $content .= ' | ';
$content .= '
';
if (!is_null($focus->parent_shipping_nip) && $focus->parent_shipping_nip) {
$content .= $labels['LBL_PDF_CONTENT_NIP'] . ' ' . $focus->parent_shipping_nip;
$nip = true;
}
if (!is_null($focus->parent_shipping_iln) && $focus->parent_shipping_iln) {
if ($nip) $content . ' '; $nip = false; $content .= ' ILN: ' . $focus->parent_shipping_iln; } $content .= ' | ';
$content .= '
';
if (!is_null($focus->parent_payer_nip) && $focus->parent_payer_nip) {
$content .= $labels['LBL_PDF_CONTENT_NIP'] . ' ' . $focus->parent_payer_nip;
$nip = true;
}
if (!is_null($focus->parent_payer_iln) && $focus->parent_payer_iln) {
if ($nip) $content . ' '; $nip = false; $content .= ' ILN: ' . $focus->parent_payer_iln; } $content .= ' |
|
| ' . $focus->name . ' |
| ' . $labels['LBL_PDF_CONTENT_REGISTER_DATE'] . ' | ' . $focus->register_date . ' | Miejsce wystawienia: | Obrowo |
| Data sprzedaży: | ' . $focus->sell_date . ' | Termin płatności: | ' . $focus->payment_date . ' |
| ' . ($focus->order_no != '' ? 'Numer zamówienia klienta:' : '') . ' | ' . ($focus->order_no != '' ? $focus->order_no : '') . ' | Metoda płatności: | ' . $GLOBALS['app_list_strings']['payment_method_dom'][$focus->payment_method] . ' |
| ' . ($focus->supplier_code != '' ? 'Kod dostawcy:' : '') . ' | ' . ($focus->supplier_code != '' ? $focus->supplier_code : '') . ' | ' . ($focus->wz_name != '' || true ? 'Nr dokumentu WZ:' : '') . ' | ' . ($focus->wz_name != '' ? $focus->wz_name : '') . ' |
| Korekta do Faktury nr: | ' . $a . ' |
| Nazwa | |
| Indeks | EAN |
| ' . $col['label'] . ' | '; } $content .= '||||
|---|---|---|---|---|
';
foreach ($col['field'] as $f) {
if ($pk_avaiable && $f == 'product_code') {
continue;
}
if ($f == 'name' && $pk_avaiable) {
$pr = new EcmProduct();
$pr->retrieve($pos['ecmproduct_id']);
//$pos[$f] = $pr->pkwiu;
$content .= '
' . $pr->pkwiu . ' '; } else { $content .= $pos[$f] . ' '; } /* if ($f == 'pkwiu'){ } else if (! $pos [$f] || $pos [$f] == '') $pos [$f] = '-'; */ } $content .= ' | ';
}
$content .= '||||
';
foreach ($col['field'] as $f) {
if ($pk_avaiable && $f == 'product_code') {
continue;
}
if ($f == 'name' && $pk_avaiable) {
$pr = new EcmProduct();
$pr->retrieve($pos['ecmproduct_id']);
//$pos[$f] = $pr->pkwiu;
$content .= '
' . $pr->pkwiu . ' '; } else { $content .= $pos[$f] . ' '; } } $content .= ' | ';
}
$content .= '||||
| ';
foreach ($col['field'] as $f) {
if (!$pos[$f] || $pos[$f] == '')
$pos[$f] = '-';
$content .= $pos[$f] . ' '; } $content .= ' | ';
}
$content .= '||||
| VAT (%) | Wartość netto | Wartość VAT | Wartość brutto | '; $content .= '
| ' . $v2[0] . ' | ' . format_number($v2[1]) . ' | ' . format_number($v2[2]) . ' | ' . format_number($v2[3]) . ' |
| 23% | -' . format_number($paid_netto) . ' | -' . format_number($paid_vat) . ' | -' . format_number($focus->prepaid) . ' |
| ' . $v2[0] . ' | -' . format_number($v2[1]) . ' | -' . format_number($v2[2]) . ' | -' . format_number($v2[3]) . ' |
| Razem | ' . format_number($focus->id == 'c2d7473a-c0b8-6718-0947-54993423de20' ? 0 : $focus->total_netto - $total_paid_netto) . ' | ' . format_number($focus->id == 'c2d7473a-c0b8-6718-0947-54993423de20' ? 0 : $focus->total_vat - $total_paid_vat) . ' | ' . format_number($focus->id == 'c2d7473a-c0b8-6718-0947-54993423de20' ? 0 : $focus->total_brutto - $focus->prepaid) . ' |
| FV Przedpłatowa | ' . $focus->prepaid_nr . ' | |
| ' . $labels['LBL_PDF_TO_PAY'] . ' | ' . format_number($focus->total_brutto) . ' ' . $symbol . ' | |
| ' . $labels['LBL_PDF_PAID_RETURN'] . ' | ' . format_number(abs($focus->total_brutto)) . ' ' . $symbol . ' | |
| Przedpłata | 8.610,00 ' . $symbol . ' | Nr FK 001/14 |
| Przedpłata | ' . format_number($focus->prepaid) . ' ' . $symbol . ' | |
| ' . $labels['LBL_PDF_PAID'] . ' | ' . format_number(abs($focus->paid_val)) . ' ' . $symbol . ' | ' . $pay_text . ' |
| Zwrócono: | ' . format_number(abs($focus->paid_val)) . ' ' . $symbol . ' | ' . $pay_text . ' |
| ' . $labels['LBL_PDF_LEFT_TO_PAID'] . ' | ' . format_number(abs($left_to_paid)) . ' ' . $symbol . ' | ' . (round(abs($left_to_paid)) == 0 ? "" : $paid_text) . ' |
| Kurs: | ' . $focus->currency_value_nbp . ' z dnia ' . date("d.m.Y", strtotime($dddd['date'])) . ' wg tabeli kursu NBP ' . $focus->currency_table . ' | |
| Konto bankowe nr: | ING Bank Śląski S.A. PL49 1050 1025 1000 0090 3129 6339 | |
| Konto bankowe nr: | ' . ($dan2['value2'] != "" ? $dan2['value2'] . " " : "") . $focus->bankaccount . ' | |
| ' . $labels['LBL_PDF_CONTENT_ISSUED_BY'] . ' | ' . $u->first_name . ' ' . $u->last_name . ' | |
| Tytułem: | " . $focus->pdf_text . " |
| " . $focus->pdf_text . " |
| ' . $focus->assigned_user_name . ' | ||||
| Podpis osoby uprawnionej do wystawienia faktury | Data odbioru | Podpis osoby uprawnionej do obioru faktury |
| ' . $focus->assigned_user_name . ' | ||||
| Podpis osoby uprawnionej do wystawienia faktury | Data odbioru | Podpis osoby uprawnionej do obioru faktury |