'.$labels['LBL_PDF_CONTENT_SALE_FOR'].' '.$labels['LBL_PDF_CONTENT_DELIVERY'].' '.$labels['LBL_PDF_CONTENT_NUMBER'].' ' . $focus->document_no . ' ' . $focus->parent_name . ' '.$focus->shipping_address_name.' '.$labels['LBL_PDF_CONTENT_REGISTER_DATE'].' ' . $focus->register_date . ' ' . $focus->parent_address_street . ' ' . $focus->shipping_address_street . ' '.$labels['LBL_PDF_CONTENT_PARENT_DOCUMENT_NO'].' ' . $focus->parent_order_no . ' '. $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->shipping_address_postalcode . ' ' . $focus->shipping_address_city; if (!is_null($focus->shipping_address_country) & $focus->shipping_address_country!='') $content.=', '.$focus->shipping_address_country; $content.=' '.$labels['LBL_PDF_CONTENT_ISSUED_BY'].' ' . $user->full_name . ' '; $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.=$labels['LBL_PDF_CONTENT_ILN'].' '.$focus->parent_iln; } $content.=' '; $content.=' '; if (!is_null($focus->shipping_nip) && $focus->shipping_nip) { $content.=$labels['LBL_PDF_CONTENT_NIP'].' '.$focus->shipping_nip; $nip = true; } if (!is_null($focus->shipping_iln) && $focus->shipping_iln) { if ($nip) $content.'
'; $nip = false; $content.=$labels['LBL_PDF_CONTENT_ILN'].' '.$focus->shipping_iln; } $content.=' '.$labels['LBL_PDF_ZS_NAME'].' ' . $focus->ecmsale_document_no. ' '; $content.=' '.$labels['LBL_PDF_DELIVERY_DATE'].' ' . $focus->delivery_date. ' '; $content.=' '.$labels['LBL_PDF_ORDER_QTY'].' ' . $focus->order_qty. ' '; $content.='
'; if ($focus->name && $focus->name != '') { $content .= '
' . $focus->name . '
'; } $content .= '
'; // start items table $columns = array (); $columns ['position'] = array ( 'field' => array ( 'position' ), 'label' => $labels['LBL_PDF_CONTENT_LIST_POSITION'], 'align' => 'center' ); if ($_REQUEST['show_img']=='1') { $columns ['image'] = array ( 'field' => array ( 'image' ), 'label' => $labels['LBL_PDF_CONTENT_LIST_IMAGE'], 'align' => 'center' ); } $columns ['product_code'] = array ( 'field' => array ( 'product_code', ), 'label' => $labels['LBL_PDF_CONTENT_LIST_CODE'], 'align' => 'center' ); $columns ['name'] = array ( 'field' => array ( 'name', ), 'label' => $labels['LBL_PDF_CONTENT_LIST_NAME'], 'align' => 'left' ); if ($_REQUEST ['show_ean'] == '1' || $_REQUEST ['show_ean2'] == '1' || $_REQUEST ['show_recipient_code'] == '1') { $columns ['codes'] = array ( 'align' => 'center' ); $columns ['codes'] ['label'] = ''; if ($_REQUEST ['show_ean']) { $columns ['codes'] ['label'] .= $labels['LBL_PDF_CONTENT_LIST_EAN'].'
'; $columns ['codes'] ['field'] [] = 'ean'; } if ($_REQUEST ['show_ean2']) { $columns ['codes'] ['label'] .= $labels['LBL_PDF_CONTENT_LIST_EAN2'].'
'; $columns ['codes'] ['field'] [] = 'ean2'; } if ($_REQUEST ['show_recipient_code']) { $columns ['codes'] ['label'] .= $labels['LBL_PDF_CONTENT_LIST_RECIPIENT_CODE']; $columns ['codes'] ['field'] [] = 'supplier_code'; } $codes = true; } $columns ['qty'] = array ( 'field' => array ( 'quantity', 'unit_name' ), 'label' => $labels['LBL_PDF_CONTENT_LIST_QTY'].'
'.$labels['LBL_PDF_CONTENT_LIST_UNIT'], 'align' => 'right' ); if ($_REQUEST ['show_logistic_info']) { $columns['logistic_info'] = array ( 'field' => array( 'product_pieces_per_carton', 'product_cartons' ), 'label' => 'Ilość sztuk w kartonie
Ilość kartonów', 'align' => 'right', 'width' => '15' ); } if ($_REQUEST ['show_part_no']) { $columns['part_no'] = array ( 'field' => array( 'part_no', ), 'label' => 'Numer partii', 'align' => 'right', 'width' => '10' ); } $columns['product_code']['width'] = '8'; $columns['name']['width'] = '40'; $columns['qty']['width'] = '10'; if($codes==true){ $columns['codes']['width'] = '12'; } //set widths $totals = array(); //1: no picture, no codes, no discounts if ($_REQUEST['show_img']=='0' && $codes==false && $discounts==false) { $columns['position']['width'] = '5'; $columns['name']['width'] = '45'; $columns['qty']['width'] = '10'; $columns['price_netto']['width'] = '20'; $columns['total_netto']['width'] = '20'; echo "jestem tu 1"; } //2: no picture, codes, no discounts else if ($_REQUEST['show_img']=='0' && $codes==true && $discounts==false) { $columns['position']['width'] = '5'; $columns['name']['width'] = '20'; $columns['codes']['width'] = '30'; $columns['qty']['width'] = '10'; $columns['price_netto']['width'] = '15'; $columns['total_netto']['width'] = '15'; echo "jestem tu 2"; } //3: no picture, no codes, discounts else if ($_REQUEST['show_img']=='0' && $codes==false && $discounts==true) { $columns['position']['width'] = '5'; $columns['name']['width'] = '40'; $columns['qty']['width'] = '10'; $columns['price_netto']['width'] = '12.5'; $columns['price_start']['width'] = '12.5'; $columns['discount']['width'] = '12.5'; $columns['total_netto']['width'] = '12.5'; echo "jestem tu 3"; } //4: no picture, codes, discounts else if ($_REQUEST['show_img']=='0' && $codes==true && $discounts==true) { $columns['position']['width'] = '5'; $columns['name']['width'] = '30'; $columns['codes']['width'] = '15'; $columns['qty']['width'] = '7'; $columns['price_netto']['width'] = '8'; $columns['price_start']['width'] = '10'; $columns['discount']['width'] = '10'; $columns['total_netto']['width'] = '10'; echo "jestem tu 4"; } //5: picture, no codes, no discounts else if ($_REQUEST['show_img']=='1' && $codes==false && $discounts==false) { $columns['position']['width'] = '5'; $columns['name']['width'] = '45'; $columns['image']['width'] = '20'; $columns['qty']['width'] = '10'; $columns['price_netto']['width'] = '10'; $columns['total_netto']['width'] = '10'; echo "jestem tu 5"; } //6: picture, codes, no discounts else if ($_REQUEST['show_img']=='1' && $codes==true && $discounts==false) { $columns['position']['width'] = '5'; $columns['name']['width'] = '35'; $columns['codes']['width'] = '15'; $columns['image']['width'] = '15'; $columns['qty']['width'] = '10'; $columns['price_netto']['width'] = '10'; $columns['total_netto']['width'] = '10'; echo "jestem tu 6"; } //7: pictures, codes, discounts else if ($_REQUEST['show_img']=='1' && $codes==true && $discounts==true) { $columns['position']['width'] = '5'; $columns['name']['width'] = '35'; $columns['codes']['width'] = '15'; $columns['image']['width'] = '15'; $columns['qty']['width'] = '10'; $columns['price_start']['width'] = '10'; $columns['discount']['width'] = '10'; $columns['price_netto']['width'] = '10'; $columns['total_netto']['width'] = '10'; echo "jestem tu 7"; } // rysujemy :) $content .= ' '; foreach ( $columns as $col ) { $content .= ' '; } $content .= ' '; foreach ( $positions as $pos ) { $content .= ''; foreach ( $columns as $col ) { $content .= ''; } $content .= ''; } $content .= '
' . $col ['label'] . '
'; foreach ( $col ['field'] as $f ) { if ($f == 'image') { $content.=''; } else { if (!$pos[$f] || $pos[$f]=='') $pos[$f]='-'; $content .= $pos [$f] . '
'; } } $content .= '
'; //summary table //get currency symbol $c = new Currency(); $c->retrieve($focus->currency_id); $symbol = $c->symbol; unset($c); $content.='

'.$focus->pdf_text.' '; //echo $content; die();