init
This commit is contained in:
368
modules/EcmStockDocOuts/PDFTemplate/content.php
Normal file
368
modules/EcmStockDocOuts/PDFTemplate/content.php
Normal file
@@ -0,0 +1,368 @@
|
||||
<?php
|
||||
$w = "30"; // first column width
|
||||
$w3 = "30";
|
||||
|
||||
$w2 = "20"; // second column width
|
||||
$content = '
|
||||
<table style="width: 100%; font-size: 8pt;">
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
<b>'.$labels['LBL_PDF_CONTENT_SALE_FOR'].'</b>
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
<b>'.$labels['LBL_PDF_CONTENT_DELIVERY'].'</b>
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
'.$labels['LBL_PDF_CONTENT_NUMBER'].'
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
<b>' . $focus->document_no . '</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_name . '
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
'.$focus->shipping_address_name.'
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
'.$labels['LBL_PDF_CONTENT_REGISTER_DATE'].'
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
<b>' . $focus->register_date . '</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_address_street . '
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
' . $focus->shipping_address_street . '
|
||||
</td>
|
||||
<td valign="top" style="width: ' . $w2 . '%">
|
||||
'.$labels['LBL_PDF_CONTENT_PARENT_DOCUMENT_NO'].'
|
||||
</td>
|
||||
<td colspan="0" valign="top" style="text-align: right">
|
||||
<b>' . $focus->parent_order_no . '</b>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
'. $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.='
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
'. $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.='
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
'.$labels['LBL_PDF_CONTENT_ISSUED_BY'].'
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
<b>' . $user->full_name . '</b>
|
||||
</td>
|
||||
</tr>';
|
||||
$content.='
|
||||
<tr>
|
||||
<td valign="top" style="width: ' . $w . '%">';
|
||||
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.='<br>'; $nip = false;
|
||||
$content.=$labels['LBL_PDF_CONTENT_ILN'].' '.$focus->parent_iln;
|
||||
}
|
||||
$content.='
|
||||
</td>';
|
||||
$content.='
|
||||
<td valign="top" style="width: ' . $w3 . '%">';
|
||||
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.'<br>'; $nip = false;
|
||||
$content.=$labels['LBL_PDF_CONTENT_ILN'].' '.$focus->shipping_iln;
|
||||
}
|
||||
$content.='
|
||||
</td>
|
||||
<td valign="top" style="width: ' . $w2 . '%">
|
||||
'.$labels['LBL_PDF_ZS_NAME'].'
|
||||
</td>
|
||||
<td colspan="0" valign="top" style="text-align: right">
|
||||
<b>' . $focus->ecmsale_document_no. '</b>
|
||||
</td>
|
||||
</tr>';
|
||||
$content.='
|
||||
<tr>
|
||||
<td valign="top" style="width: ' . $w . '%"></td>
|
||||
<td valign="top" style="width: ' . $w3 . '%"></td>
|
||||
<td valign="top" style="width: ' . $w2 . '%">
|
||||
'.$labels['LBL_PDF_DELIVERY_DATE'].'
|
||||
</td>
|
||||
<td colspan="0" valign="top" style="text-align: right">
|
||||
<b>' . $focus->delivery_date. '</b>
|
||||
</td>
|
||||
</tr>';
|
||||
$content.='
|
||||
<tr>
|
||||
<td valign="top" style="width: ' . $w . '%"></td>
|
||||
<td valign="top" style="width: ' . $w3 . '%"></td>
|
||||
<td valign="top" style="width: ' . $w2 . '%">
|
||||
'.$labels['LBL_PDF_ORDER_QTY'].'
|
||||
</td>
|
||||
<td colspan="0" valign="top" style="text-align: right">
|
||||
<b>' . $focus->order_qty. '</b>
|
||||
</td>
|
||||
</tr>';
|
||||
$content.='
|
||||
</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' => $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'].'<br>';
|
||||
$columns ['codes'] ['field'] [] = 'ean';
|
||||
}
|
||||
if ($_REQUEST ['show_ean2']) {
|
||||
$columns ['codes'] ['label'] .= $labels['LBL_PDF_CONTENT_LIST_EAN2'].'<br>';
|
||||
$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'].'<br>'.$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<br>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 .= '
|
||||
<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; background: rgb(233,233,233); 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 ($f == 'image') {
|
||||
$content.='<img width="40px" src="modules/EcmProducts/upload/images/'.$pos['image'].'"/>';
|
||||
} else {
|
||||
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.='
|
||||
</table>
|
||||
<br><br>
|
||||
'.$focus->pdf_text.'
|
||||
';
|
||||
|
||||
//echo $content; die();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
324
modules/EcmStockDocOuts/PDFTemplate/content2.php
Normal file
324
modules/EcmStockDocOuts/PDFTemplate/content2.php
Normal file
@@ -0,0 +1,324 @@
|
||||
<?php
|
||||
$w = "30"; // first column width
|
||||
$w3 = "30";
|
||||
$w2 = "20"; // second column width
|
||||
$content = '<p style="text-align: center;"><b>WZ nr '.$focus->document_no.'</b></p>
|
||||
<table style="width: 100%; font-size: 8pt;">
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
<b>'.$labels['LBL_PDF_CONTENT_INVOICE_FOR'].'</b>
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">';
|
||||
if($focus->shipping_address_name!=''){
|
||||
$content.= '<b>'.$labels['LBL_PDF_CONTENT_DELIVERY'].'</b>';
|
||||
}
|
||||
$content.= '</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_name . '
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
'.$focus->shipping_address_name.'
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_address_street . '
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
' . $focus->shipping_address_street . '
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%"></td>
|
||||
<td style="text-align: right">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
'. $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.='
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
'. $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.='
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
|
||||
</td>
|
||||
</tr>';
|
||||
$content.='
|
||||
<tr>
|
||||
<td valign="top" style="width: ' . $w . '%">';
|
||||
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.'<br>'; $nip = false;
|
||||
$content.=$labels['LBL_PDF_CONTENT_ILN'].' '.$focus->parent_iln;
|
||||
}
|
||||
$content.='
|
||||
</td>';
|
||||
$content.='
|
||||
<td valign="top" style="width: ' . $w3 . '%">';
|
||||
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.'<br>'; $nip = false;
|
||||
$content.=$labels['LBL_PDF_CONTENT_ILN'].' '.$focus->shipping_iln;
|
||||
}
|
||||
$content.='
|
||||
</td>
|
||||
<td valign="top" style="width: ' . $w2 . '%"></td>
|
||||
<td colspan="0" valign="top" style="text-align: right">
|
||||
</td>
|
||||
</tr>';
|
||||
$content.='
|
||||
</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><table width="100%" style="font-size: 7pt;text-align:right;vertical-align:top;">
|
||||
<tr><td width="44%" style="text-align: left">'.$labels['LBL_PDF_CONTENT_REGISTER_DATE'].' <b>' . $focus->register_date . '</b></td>
|
||||
<td style="text-align: left;" width="20%"><br><b>' . $focus->sell_date . '</b></td>
|
||||
<td rowspan="2" style="text-align: right;vertical-align:top;">';
|
||||
if($focus->wz_name!=''){
|
||||
$content.=$labels['LBL_PDF_CONTENT_PARENT_DOCUMENT_WZ'].':<br>';
|
||||
}
|
||||
if($focus->order_no!=''){
|
||||
$content.=$labels['LBL_PDF_CONTENT_PARENT_DOCUMENT_NO'].'<br>';
|
||||
}
|
||||
$content.=$labels['LBL_STOCK_NAME'].':<br>';
|
||||
$content.='</td>
|
||||
<td rowspan="2" style="vertical-align:top;">';
|
||||
if($focus->wz_name!=''){
|
||||
$content.='<b>' . $focus->wz_name.'</b><br>';
|
||||
}
|
||||
if($focus->order_no!=''){
|
||||
$content.='<b>' . $focus->order_no.'</b><br>';
|
||||
}
|
||||
$content.='<b>' . $focus->stock_name.'</b><br>';
|
||||
$content.='</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_netto'] = array (
|
||||
'field' => array (
|
||||
'price_netto'
|
||||
),
|
||||
'label' => 'Cena netto',
|
||||
'align' => 'right'
|
||||
);
|
||||
|
||||
$columns ['total_netto'] = array (
|
||||
'field' => array (
|
||||
'total_netto'
|
||||
),
|
||||
'label' => 'Wartość<br>netto',
|
||||
'align' => 'right'
|
||||
);
|
||||
$columns ['ecmvat_name'] = array (
|
||||
'field' => array (
|
||||
'ecmvat_name'
|
||||
),
|
||||
'label' => 'VAT<br>(%)',
|
||||
'align' => 'center'
|
||||
);
|
||||
$columns ['total_vat'] = array (
|
||||
'field' => array (
|
||||
'total_vat'
|
||||
),
|
||||
'label' => 'Wartość<br>VAT',
|
||||
'align' => 'right'
|
||||
);
|
||||
$columns ['total_brutto'] = array (
|
||||
'field' => array (
|
||||
'total_brutto'
|
||||
),
|
||||
'label' => 'Wartość<br>brutto',
|
||||
'align' => 'right'
|
||||
);
|
||||
// set widths
|
||||
$totals = array ();
|
||||
|
||||
$columns ['position'] ['width'] = '5';
|
||||
$columns ['name'] ['width'] = '41';
|
||||
$columns ['qty'] ['width'] = '10';
|
||||
$columns ['price_netto'] ['width'] = '10';
|
||||
$columns ['total_netto'] ['width'] = '10';
|
||||
$columns ['ecmvat_name'] ['width'] = '4';
|
||||
$columns ['total_vat'] ['width'] = '10';
|
||||
$columns ['total_brutto'] ['width'] = '10';
|
||||
|
||||
// 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'] . '%;background-color: #E9E9E9;">' . $col ['label'] . '</th>
|
||||
';
|
||||
}
|
||||
$content .= '
|
||||
</tr></thead><tbody>
|
||||
';
|
||||
$counter=1;
|
||||
|
||||
|
||||
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: 300px; margin-left: 60%">
|
||||
';
|
||||
|
||||
$content .= '
|
||||
<tr>
|
||||
<td style="font-size: 7pt; border: 0.5 solid black; width: 23%;text-align: center;">
|
||||
<b>VAT (%)</b>
|
||||
</td>
|
||||
<td style="font-size: 7pt; border: 0.5 solid black; width: 25%;text-align: center;">
|
||||
<b>Wartość netto</b>
|
||||
</td>
|
||||
<td style="font-size: 7pt; border: 0.5 solid black; width: 25%;text-align: center;">
|
||||
<b>Wartość VAT</b>
|
||||
</td>
|
||||
<td style="font-size: 7pt; border: 0.5 solid black; width: 27%;text-align: center;">
|
||||
<b>Wartość brutto</b>
|
||||
</td>';
|
||||
|
||||
$content.='</tr>
|
||||
';
|
||||
$vats = explode(",", $focus->vats_summary);
|
||||
foreach ($vats as $v){
|
||||
if($v=='')continue;
|
||||
$v2 = explode(":", $v);
|
||||
$content .= '
|
||||
<tr>
|
||||
<td style="font-size: 7pt; border: 0.5 solid black; width: 23%;text-align: center;">
|
||||
'.$v2[0].'
|
||||
</td>
|
||||
<td style="font-size: 7pt; border: 0.5 solid black; width: 25%;text-align: right;">
|
||||
'.format_number($v2[1]).'
|
||||
</td>
|
||||
<td style="font-size: 7pt; border: 0.5 solid black; width: 25%;text-align: right;">
|
||||
'.format_number($v2[2]).'
|
||||
</td>
|
||||
<td style="font-size: 7pt; border: 0.5 solid black; width: 27%;text-align: right;">
|
||||
'.format_number($v2[3]).'
|
||||
</td></tr>';
|
||||
}
|
||||
// totals
|
||||
$content .= '
|
||||
<tr>
|
||||
<td style="font-size: 7pt; border: 0.5 solid black; width: 23%;text-align: center;background-color: #E9E9E9;">
|
||||
<b>Razem</b>
|
||||
</td>
|
||||
<td style="font-size: 7pt; border: 0.5 solid black; width: 25%;text-align: right;background-color: #E9E9E9;">
|
||||
<b>'.format_number($focus->total_netto).'</b>
|
||||
</td>
|
||||
<td style="font-size: 7pt; border: 0.5 solid black; width: 25%;text-align: right;background-color: #E9E9E9;">
|
||||
<b>'.format_number($focus->total_vat).'</b>
|
||||
</td>
|
||||
<td style="font-size: 7pt; border: 0.5 solid black; width: 27%;text-align: right;background-color: #E9E9E9;">
|
||||
<b>'.format_number($focus->total_brutto).'</b>
|
||||
</td></tr>';
|
||||
|
||||
$content .= '
|
||||
</table>
|
||||
<br><p style="font-size: 7pt;">'.$labels['LBL_PDF_CONTENT_ISSUED_BY'].' <b>'.$user->full_name.'</b></p>
|
||||
' . $focus->pdf_text . '
|
||||
';
|
||||
|
||||
//echo $content; die();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
98
modules/EcmStockDocOuts/PDFTemplate/footer-en_us.php
Normal file
98
modules/EcmStockDocOuts/PDFTemplate/footer-en_us.php
Normal file
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
$w = "62"; //first column width
|
||||
$w2 = "12"; //second column width
|
||||
//get bank information
|
||||
$a = new Account();
|
||||
$a->retrieve($focus->parent_id);
|
||||
if ($a->document_bank_account == 'mbank') {
|
||||
$ba_number = 'PL96114010100000548212001002';
|
||||
$ba_name = 'MBANK';
|
||||
$ba_swift = 'BREXPLPW';
|
||||
} else {
|
||||
$ba_number = 'PL36116022020000000064080587';
|
||||
$ba_name = 'BANK MILLENIUM';
|
||||
$ba_swift = 'BIGBPLPW';
|
||||
}
|
||||
unset($a);
|
||||
$footer = '
|
||||
<hr>
|
||||
<table style="width: 100%; font-size: 7pt;">
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
e5 Polska Sp. z o.o
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_KRS'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
28207
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
ul. Wąwozowa 11
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_NIP'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
PL 525-21-73-990
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
02-796 Warszawa
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_REGON'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
016280234
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
Tel: +48 (22) 228 20 90
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_BANK'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
'.$ba_name.'
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
Fax: +48 (56) 674 60 47
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_BANK_ACCOUNT'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
'.$ba_number.'
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
'.$user->email1.'
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_SWIFT'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
'.$ba_swift.'
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table style="width: 100%; font-size: 7pt;">
|
||||
<tr>
|
||||
<td style="width: 50%;">
|
||||
{PAGENO}/{nb}
|
||||
</td>
|
||||
<td style="width: 50%; text-align: right">
|
||||
<b>'.$focus->document_no.'</b>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
';
|
||||
96
modules/EcmStockDocOuts/PDFTemplate/footer-pl_pl.php
Normal file
96
modules/EcmStockDocOuts/PDFTemplate/footer-pl_pl.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
$w = "62"; //first column width
|
||||
$w2 = "12"; //second column width
|
||||
//get bank information
|
||||
$a = new Account();
|
||||
$a->retrieve($focus->parent_id);
|
||||
if ($a->document_bank_account == 'mbank') {
|
||||
$ba_number = '26 1140 1010 0000 5482 1200 1001';
|
||||
$ba_name = 'MBANK';
|
||||
} else {
|
||||
$ba_number = '35 1160 2202 0000 0000 6408 0411';
|
||||
$ba_name = 'BANK MILLENIUM';
|
||||
}
|
||||
unset($a);
|
||||
$footer = '
|
||||
<hr>
|
||||
<table style="width: 100%; font-size: 7pt;">
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
e5 Polska Sp. z o.o
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_KRS'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
28207
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
ul. Wąwozowa 11
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_NIP'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
PL 525-21-73-990
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
02-796 Warszawa
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_REGON'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
016280234
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
Tel: +48 (22) 228 20 90
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_BANK'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
'.$ba_name.'
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
Fax: +48 (56) 674 60 47
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_BANK_ACCOUNT'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
'.$ba_number.'
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: '.$w.'%">
|
||||
'.$user->email1.'
|
||||
</td>
|
||||
<td style="width: '.$w2.'%">
|
||||
<b>'.$labels['LBL_PDF_FOOTER_GIOS'].'</b>
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
E0006254W
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table style="width: 100%; font-size: 7pt;">
|
||||
<tr>
|
||||
<td style="width: 50%;">
|
||||
{PAGENO}/{nb}
|
||||
</td>
|
||||
<td style="width: 50%; text-align: right">
|
||||
<b>'.$focus->document_no.'</b>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
';
|
||||
12
modules/EcmStockDocOuts/PDFTemplate/header.php
Normal file
12
modules/EcmStockDocOuts/PDFTemplate/header.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
$header = '
|
||||
<table style="font-size: 7pt; width: 100%"><tr>
|
||||
<td>
|
||||
<img style="width: 150px;" src="modules/EcmSales/PDFTemplate/logo.png"/>
|
||||
</td>
|
||||
<td style="text-align: right; vertical-align: bottom;">
|
||||
www.e5.pl
|
||||
</td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
';
|
||||
23
modules/EcmStockDocOuts/PDFTemplate/helper.php
Normal file
23
modules/EcmStockDocOuts/PDFTemplate/helper.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
function formatPDFPositions($positions, $focus) {
|
||||
$result = array();
|
||||
foreach ($positions as $pos) {
|
||||
$pos['position'] = intval($pos['position'])+1;
|
||||
$pos['quantity'] = number_format($pos['quantity'],0);
|
||||
$result[] = $pos;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function mysql_escape_gpc($dirty)
|
||||
{
|
||||
if (ini_get('magic_quotes_gpc'))
|
||||
{
|
||||
return $dirty;
|
||||
}
|
||||
else
|
||||
{
|
||||
return mysql_real_escape_string($dirty);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user