init
This commit is contained in:
263
modules/EcmPurchaseOrders/PDFTemplate/content.php
Normal file
263
modules/EcmPurchaseOrders/PDFTemplate/content.php
Normal file
@@ -0,0 +1,263 @@
|
||||
<?php
|
||||
$w = "30"; // first column width
|
||||
$w2 = "30"; // second column width
|
||||
|
||||
if($focus->parent_shipping_id!=''){
|
||||
$delivery='<b>DOSTAWA DO</b>';
|
||||
$d_name=$focus->parent_shipping_name;
|
||||
$d_street=$focus->parent_shipping_address_street;
|
||||
$d_rest=$focus->parent_shipping_address_postalcode.' '.$focus->parent_shipping_address_city.', '.$focus->parent_shipping_address_country;
|
||||
$d_nip='NIP: '.$focus->parent_shipping_address_nip;
|
||||
}
|
||||
|
||||
$content = '<p style="text-align: center;font-size: 12pt;"><b>'.$labels['LBL_PDF_CONTENT_NAME'].' '.$focus->document_no.'</b></center>
|
||||
<table style="width: 100%; font-size: 8pt;">
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
<b>SPRZEDAWCA</b>
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
'.$delivery.'
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_name . '
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
'.$d_name.'
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_address_street . '
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
'.$d_street.'
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
'. $focus->parent_address_postalcode . ' ' . $focus->parent_address_city;
|
||||
|
||||
$content.='
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
'.$d_rest.'
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
';
|
||||
if (!is_null($focus->parent_nip) && $focus->parent_nip) {
|
||||
$content.=$labels['LBL_PARENT_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>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
'.$d_nip.'
|
||||
</td>
|
||||
<td style="text-align: right">
|
||||
|
||||
</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 .= '<table width="100%" style="font-size: 7pt;text-align:left;vertical-align:top;">
|
||||
<tr><td width="20%" >'.$labels['LBL_PDF_CONTENT_REGISTER_DATE'].':<br>'.$labels['LBL_PDF_CONTENT_DELIVERY_DATE'].':</td>
|
||||
<td style="text-align: left;" width="20%"><b>' . $focus->register_date . '</b><br><b>' . $focus->delivery_date . '</b></td>
|
||||
<td rowspan="2" style="text-align: left;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.='</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.='</td></tr></table><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_start'] = array (
|
||||
'field' => array (
|
||||
'price_start'
|
||||
),
|
||||
'label' => 'Cena netto',
|
||||
'align' => 'right'
|
||||
);
|
||||
|
||||
$columns ['total_netto'] = array (
|
||||
'field' => array (
|
||||
'total_netto'
|
||||
),
|
||||
'label' => 'Wartość netto',
|
||||
'align' => 'right'
|
||||
);
|
||||
|
||||
// set widths
|
||||
$totals = array ();
|
||||
|
||||
$columns ['position'] ['width'] = '5';
|
||||
$columns ['name'] ['width'] = '45';
|
||||
$columns ['qty'] ['width'] = '10';
|
||||
$columns ['price_start'] ['width'] = '20';
|
||||
$columns ['total_netto'] ['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; 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 (! $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="background: rgb(233,233,233); border: 0.5 solid black; width: 50%;">
|
||||
Suma netto
|
||||
</td>
|
||||
<td style="border: 0.5 solid black; text-align: right;">
|
||||
'.format_number($focus->total_netto).' '.$symbol.'
|
||||
</td>
|
||||
</tr>
|
||||
';
|
||||
|
||||
if ($focus->to_is_vat_free=='0') {
|
||||
$vats = explode(",", $focus->vats_summary);
|
||||
foreach ($vats as $v) {
|
||||
$vats2 = explode(":", $v);
|
||||
if ($vats2[0]=='') continue;
|
||||
$content.='
|
||||
<tr>
|
||||
<td style="background: rgb(233,233,233); border: 0.5 solid black; width: 50%;">
|
||||
'.$vats2[0].'
|
||||
</td>
|
||||
<td style="border: 0.5 solid black; text-align: right;">
|
||||
'.format_number($vats2[1]).' '.$symbol.'
|
||||
</td>
|
||||
</tr>
|
||||
';
|
||||
}
|
||||
$content.='
|
||||
<tr>
|
||||
<td style="background: rgb(233,233,233); border: 0.5 solid black; width: 50%;">
|
||||
Suma brutto
|
||||
</td>
|
||||
<td style="border: 0.5 solid black; text-align: right;">
|
||||
'.format_number($focus->total_brutto).' '.$symbol.'
|
||||
</td>
|
||||
</tr>
|
||||
';
|
||||
}
|
||||
$content .= '
|
||||
</table><br><p style="font-size: 7pt;">'.$labels['LBL_PDF_CONTENT_ISSUED_BY'].' <b>'.$user->full_name.'</b></p>
|
||||
<br><br>
|
||||
' . $focus->pdf_text . '
|
||||
';
|
||||
|
||||
|
||||
//echo $content; die();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
95
modules/EcmPurchaseOrders/PDFTemplate/footer-pl_pl.php
Normal file
95
modules/EcmPurchaseOrders/PDFTemplate/footer-pl_pl.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
$w = "62"; //first column width
|
||||
$w2 = "12"; //second column width
|
||||
$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">
|
||||
';
|
||||
if ($bank=='milenium')
|
||||
$footer.='BANK MILLENIUM';
|
||||
if ($bank=='mbank')
|
||||
$footer.='MBANK';
|
||||
$footer.='
|
||||
</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">
|
||||
';
|
||||
if ($bank=='milenium')
|
||||
$footer.='35 1160 2202 0000 0000 6408 0411';
|
||||
if ($bank=='mbank')
|
||||
$footer.='26 1140 1010 0000 5482 1200 1001';
|
||||
$footer.='
|
||||
</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>
|
||||
';
|
||||
95
modules/EcmPurchaseOrders/PDFTemplate/footer.php
Normal file
95
modules/EcmPurchaseOrders/PDFTemplate/footer.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
$w = "62"; //first column width
|
||||
$w2 = "12"; //second column width
|
||||
$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">
|
||||
';
|
||||
if ($bank=='milenium')
|
||||
$footer.='BANK MILLENIUM';
|
||||
if ($bank=='mbank')
|
||||
$footer.='MBANK';
|
||||
$footer.='
|
||||
</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">
|
||||
';
|
||||
if ($bank=='milenium')
|
||||
$footer.='35 1160 2202 0000 0000 6408 0411';
|
||||
if ($bank=='mbank')
|
||||
$footer.='26 1140 1010 0000 5482 1200 1001';
|
||||
$footer.='
|
||||
</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>
|
||||
';
|
||||
18
modules/EcmPurchaseOrders/PDFTemplate/header.php
Normal file
18
modules/EcmPurchaseOrders/PDFTemplate/header.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
$header = '
|
||||
<table style="font-size: 8pt; width: 100%"><tr>
|
||||
<td width="15%">
|
||||
<img style="width: 70px;" src="modules/EcmDocumentTemplates/files/13899e0f-321c-229a-aa3e-48be4a1532c1.png"/>
|
||||
</td>
|
||||
<td width="45%" style="text-align: left; vertical-align: top;">
|
||||
<b>NABYWCA</b><br />
|
||||
e5 Polska Sp. z o. o.<br />
|
||||
ul. Wąwozowa 11<br />
|
||||
02-796 Warszawa<br />
|
||||
NIP: 5252173990
|
||||
</td>
|
||||
<td style="text-align: left; vertical-align: top;">
|
||||
</td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
';
|
||||
28
modules/EcmPurchaseOrders/PDFTemplate/helper.php
Normal file
28
modules/EcmPurchaseOrders/PDFTemplate/helper.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
function formatPDFPositions($positions, $focus) {
|
||||
$result = array();
|
||||
foreach ($positions as $pos) {
|
||||
|
||||
$pos['position'] = intval($pos['position'])+1;
|
||||
|
||||
$pos['quantity'] = $pos['quantity'];
|
||||
$pos['price_start']=format_number($pos['price_start']);
|
||||
$pos['total_netto']=format_number($pos['total_netto']);
|
||||
|
||||
$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