init
This commit is contained in:
447
modules/EcmInvoiceOuts/PDFTemplate/content.php
Normal file
447
modules/EcmInvoiceOuts/PDFTemplate/content.php
Normal file
@@ -0,0 +1,447 @@
|
||||
<?php
|
||||
$w = "35"; // first column width
|
||||
$w3 = "35";
|
||||
$w2 = "25"; // second column width
|
||||
|
||||
|
||||
$content = '
|
||||
<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->parent_shipping_address_name!=''){
|
||||
$content.= '<b>'.$labels['LBL_PDF_CONTENT_DELIVERY'].'</b>';
|
||||
}
|
||||
|
||||
$content.= '</td>
|
||||
<td style="width: ' . $w2 . '%">';
|
||||
if($focus->parent_payer_address_name!=''){
|
||||
$content.= '<b>'.$labels['LBL_PDF_CONTENT_PAYER'].'</b>';
|
||||
}$content.= '</td>
|
||||
<td style="text-align: right"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_name . '
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
'.$focus->parent_shipping_address_name.'
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">'.$focus->parent_payer_address_name.'</td>
|
||||
<td style="text-align: right"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_address_street . '
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
' . $focus->parent_shipping_address_street . '
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
' . $focus->parent_payer_address_street . '
|
||||
</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->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.='
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
'. $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.='
|
||||
</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->parent_shipping_address_nip) && $focus->parent_shipping_address_nip) {
|
||||
$content.=$labels['LBL_PDF_CONTENT_NIP'].' '.$focus->parent_shipping_address_nip;
|
||||
$nip = true;
|
||||
}
|
||||
if (!is_null($focus->parent_shipping_iln) && $focus->parent_shipping_iln) {
|
||||
if ($nip) $content.'<br>'; $nip = false;
|
||||
$content.=$labels['LBL_PDF_CONTENT_ILN'].' '.$focus->parent_shipping_iln;
|
||||
}
|
||||
$content.='
|
||||
</td>';
|
||||
$content.='
|
||||
<td valign="top" style="width: ' . $w3 . '%">';
|
||||
if (!is_null($focus->parent_payer_address_nip) && $focus->parent_payer_address_nip) {
|
||||
$content.=$labels['LBL_PDF_CONTENT_NIP'].' '.$focus->parent_payer_address_nip;
|
||||
$nip = true;
|
||||
}
|
||||
if (!is_null($focus->parent_payer_iln) && $focus->parent_payer_iln) {
|
||||
if ($nip) $content.'<br>'; $nip = false;
|
||||
$content.=$labels['LBL_PDF_CONTENT_ILN'].' '.$focus->parent_payer_iln;
|
||||
}
|
||||
$content.='</td>
|
||||
<td colspan="0" valign="top" style="text-align: right">
|
||||
|
||||
</td>
|
||||
</tr>';
|
||||
$content.='
|
||||
</table>
|
||||
';
|
||||
if ($focus->name && $focus->name != '') {
|
||||
$content .= '
|
||||
<table style="width: 100%; text-align: center">
|
||||
<tr><td>
|
||||
<b>' . $focus->name . '</b>
|
||||
</td></tr>
|
||||
</table>
|
||||
';
|
||||
}
|
||||
|
||||
|
||||
if ($focus->type == 'correct')
|
||||
$labels['LBL_PDF_CONTENT_PARENT_DOCUMENT_NO'] = 'Numer zwrotu:';
|
||||
|
||||
|
||||
if($focus->ecminvoiceout_name!=''){
|
||||
$corl=$labels['LBL_PDF_CORRECT_TO'];
|
||||
$focus2=new EcmInvoiceOut();
|
||||
$focus2->retrieve($focus->ecminvoiceout_id);
|
||||
$data=$focus2->register_date;
|
||||
$data= date('d.m.Y',strtotime($data));
|
||||
$korekta='<br><b>' . $focus->ecminvoiceout_name . '</b>, z dnia ' . $data;
|
||||
}
|
||||
$content .= '<br><table width="100%" style="font-size: 7pt;text-align:left;vertical-align:top;">
|
||||
<tr><td width="18%" >'.$labels['LBL_PDF_CONTENT_REGISTER_DATE'].'<br>'.$labels['LBL_PLACE_PDF'].'<br>'.$labels['LBL_PDF_CONTENT_SELL_DATE'].'<br>'.$corl.'</td>
|
||||
<td style="text-align: left;" width="35%"><b>' . $focus->register_date . '</b><br><b>Warszawa</b><br><b>' . $focus->sell_date . '</b>'.$korekta.'</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>';
|
||||
}
|
||||
if($focus->supplier_code!=''){
|
||||
$content.=$labels['LBL_SUPPLIER_CODE'].':<br>';
|
||||
}
|
||||
if($focus->payment_date!=''){
|
||||
$content.=$labels['LBL_PAYMENT_DATE_PDF'].':<br>';
|
||||
}
|
||||
if($focus->ecmpaymentcondition_id!=''){
|
||||
$content.=$labels['LBL_PAYMENT_METHOD_PDF'].':<br>';
|
||||
}
|
||||
|
||||
$pay=new EcmPaymentCondition();
|
||||
|
||||
$pay->retrieve($focus->ecmpaymentcondition_id);
|
||||
|
||||
$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>';
|
||||
}
|
||||
if($focus->supplier_code!=''){
|
||||
$content.='<b>' . $focus->supplier_code.'</b><br>';
|
||||
}
|
||||
if($focus->payment_date!=''){
|
||||
$content.='<b>' . date('d.m.Y',strtotime($focus->payment_date)).'</b><br>';
|
||||
}
|
||||
if($focus->ecmpaymentcondition_id!=''){
|
||||
$content.='<b>' . $GLOBALS['app_list_strings']['payment_method_dom'][$focus->payment_method].'</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'
|
||||
);
|
||||
if($recipient_code==1){
|
||||
$columns ['recipient_code'] = array (
|
||||
'field' => array (
|
||||
'recipient_code'
|
||||
),
|
||||
'label' => 'Kod Tow.',
|
||||
'align' => 'center'
|
||||
);
|
||||
}
|
||||
$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';
|
||||
if($recipient_code==1){
|
||||
$columns ['recipient_code'] ['width'] = '10';
|
||||
}
|
||||
$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;
|
||||
if($focus->type=='normal'){
|
||||
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>';
|
||||
}
|
||||
} else {
|
||||
foreach ( $positions as $pos ) {
|
||||
$content .= '<tr>';
|
||||
$pos2= formatPDFPositionsCorrect ($focus->getCorrectedPosition($pos['old_ecminvoiceoutitem_id']), $focus );
|
||||
$pos2['name']='było';
|
||||
$pos2['position']='';
|
||||
$pos2['product_code']=' ';
|
||||
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><tr>';
|
||||
// old correct item
|
||||
foreach ( $columns as $col ) {
|
||||
|
||||
$content .= '<td style="border: 0.5 solid black; text-align: ' . $col ['align'] . ';">';
|
||||
foreach ( $col ['field'] as $f ) {
|
||||
|
||||
if (! $pos2 [$f] || $pos2 [$f] == '')
|
||||
$pos2 [$f] = '-';
|
||||
$content .= $pos2 [$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>
|
||||
<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: 6.5pt; border: 0.5 solid black; width: 23%;text-align: center;background-color: #E9E9E9;">
|
||||
<b>Razem</b>
|
||||
</td>
|
||||
<td style="font-size: 6.5pt; 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: 6.5pt; 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: 6.5pt; border: 0.5 solid black; width: 27%;text-align: right;background-color: #E9E9E9;">
|
||||
<b>'.format_number($focus->total_brutto).'</b>
|
||||
</td></tr>';
|
||||
$left_to_paid=$focus->total_brutto-$focus->paid_val;
|
||||
$content .= '
|
||||
</table>
|
||||
<table style="font-size: 7pt;">
|
||||
<tr><td>'.$labels['LBL_PDF_TO_PAY'].'</td><td style="text-align: right;"><b>'.format_number($focus->total_brutto).' '.$symbol.'</b></td><td></td></tr>';
|
||||
if($focus->paid_val!=''){
|
||||
if($focus->paid_val!=0)$pay_text=$GLOBALS['app_list_strings']['ecmpaymentconditions_payment_method_dom'][$focus->payment_method_paid];
|
||||
$content .= '<tr><td>'.$labels['LBL_PDF_PAID'].'</td><td style="text-align: right;"><b>'.format_number($focus->paid_val).' '.$symbol.'</b></td><td style="text-align:left;">'.$pay_text.'</td></tr>';
|
||||
}
|
||||
|
||||
if($focus->ecmpaymentcondition_id!=''){
|
||||
|
||||
$q= $db->query ( "select name from ecmpaymentconditions where id='$focus->ecmpaymentcondition_id'" );
|
||||
$r=$db->fetchByAssoc($q);
|
||||
//$paid_text='w Terminie <b>'.$r['name'].'</b> do <b>'.date('d.m.Y',strtotime($focus->payment_date)).'</b> '.$GLOBALS['app_list_strings']['payment_method_dom'][$focus->payment_method];
|
||||
} else {
|
||||
if($focus->payment_date!=''){
|
||||
|
||||
$dni=(strtotime($focus->payment_date)-strtotime($focus->sell_date))/(3600*24);
|
||||
//$paid_text='w Terminie <b>'.$dni.' dni</b> do <b>'.date('d.m.Y',strtotime($focus->payment_date)).'</b> '.$GLOBALS['app_list_strings']['payment_method_dom'][$focus->payment_method];
|
||||
}
|
||||
}
|
||||
|
||||
$content .= '<tr><td>'.$labels['LBL_PDF_LEFT_TO_PAID'].'</td><td style="text-align: right;"><b>'.format_number($left_to_paid).' '.$symbol.'</b></td><td style="text-align:left;">'.$paid_text.'</td></tr>
|
||||
</table><br><br>';
|
||||
|
||||
die($focus->currency_id);
|
||||
if ($focus->currency_id!='PLN') {
|
||||
//get currency date
|
||||
$dd = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT date FROM currency_nbp_archive WHERE currency_id='".$focus->currency_id."' AND nbp_table_name='".$focus->currency_table."' "));
|
||||
$content.="Wartość VAT w zł: ".($focus->total_vat*$focus->currency_nbp_value)." przeliczowo wg. kursu NBP (".$focus->currency_table.", ".number_format($focus->currency_value,2).") z dnia ".$dd['date'];
|
||||
}
|
||||
$content.='<br><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();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
38
modules/EcmInvoiceOuts/PDFTemplate/helper.php
Normal file
38
modules/EcmInvoiceOuts/PDFTemplate/helper.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
function formatPDFPositions($positions, $focus) {
|
||||
$result = array();
|
||||
|
||||
|
||||
foreach ($positions as $pos) {
|
||||
|
||||
$pos['quantity'] = intval($pos['quantity']);
|
||||
$pos['old_quantity'] = intval($pos['old_quantity']);
|
||||
|
||||
$pos['position'] = intval($pos['position'])+1;
|
||||
$pos['price_netto']=format_number($pos['price_netto']);
|
||||
$pos['total_vat']=format_number($pos['total_vat']);
|
||||
$pos['ecmvat_value']=format_number($pos['ecmvat_value']);
|
||||
$pos['total_brutto']=format_number($pos['total_brutto']);
|
||||
$pos['total_netto']=format_number($pos['total_netto']);
|
||||
$pos['old_total_netto']=format_number($pos['old_total_netto']);
|
||||
$pos['old_total_brutto']=format_number($pos['old_total_brutto']);
|
||||
$pos['old_total_vat']=format_number($pos['old_total_vat']);
|
||||
$pos['old_price_netto']=format_number($pos['old_price_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);
|
||||
}
|
||||
}
|
||||
381
modules/EcmInvoiceOuts/PDFTemplate/tpl/content_en.php
Normal file
381
modules/EcmInvoiceOuts/PDFTemplate/tpl/content_en.php
Normal file
@@ -0,0 +1,381 @@
|
||||
<?php
|
||||
$w = "35"; // first column width
|
||||
$w3 = "35";
|
||||
$w2 = "25"; // second column width
|
||||
|
||||
$content = '
|
||||
<table style="width: 100%; font-size: 8pt;">
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
<b>NABYWCA / BUYER</b>
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">';
|
||||
if($focus->parent_shipping_address_name!=''){
|
||||
$content.= '<b>DOSTAWA / DELIVERY</b>';
|
||||
}
|
||||
|
||||
$content.= '</td>
|
||||
<td style="width: ' . $w2 . '%">';
|
||||
if($focus->parent_payer_address_name!=''){
|
||||
$content.= '<b>PŁATNIK / PAYER</b>';
|
||||
}$content.= '</td>
|
||||
<td style="text-align: right"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_name . '
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
'.$focus->parent_shipping_address_name.'
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">'.$focus->parent_payer_address_name.'</td>
|
||||
<td style="text-align: right"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_address_street . '
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
' . $focus->parent_shipping_address_street . '
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
' . $focus->parent_payer_address_street . '
|
||||
</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->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.='
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
'. $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.='
|
||||
</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.='NIP/Vat ID: '.$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->parent_shipping_address_nip) && $focus->parent_shipping_address_nip) {
|
||||
$content.='NIP/Vat ID: '.$focus->parent_shipping_address_nip;
|
||||
$nip = true;
|
||||
}
|
||||
if (!is_null($focus->parent_shipping_iln) && $focus->parent_shipping_iln) {
|
||||
if ($nip) $content.'<br>'; $nip = false;
|
||||
$content.=$labels['LBL_PDF_CONTENT_ILN'].' '.$focus->parent_shipping_iln;
|
||||
}
|
||||
$content.='
|
||||
</td>';
|
||||
$content.='
|
||||
<td valign="top" style="width: ' . $w3 . '%">';
|
||||
if (!is_null($focus->parent_payer_address_nip) && $focus->parent_payer_address_nip) {
|
||||
$content.='NIP/Vat ID: '.$focus->parent_shipping_address_nip;
|
||||
$nip = true;
|
||||
}
|
||||
if (!is_null($focus->parent_shipping_iln) && $focus->parent_shipping_iln) {
|
||||
if ($nip) $content.'<br>'; $nip = false;
|
||||
$content.=$labels['LBL_PDF_CONTENT_ILN'].' '.$focus->parent_shipping_iln;
|
||||
}
|
||||
$content.='</td>
|
||||
<td colspan="0" valign="top" style="text-align: right">
|
||||
|
||||
</td>
|
||||
</tr>';
|
||||
$content.='
|
||||
</table>
|
||||
';
|
||||
if ($focus->name && $focus->name != '') {
|
||||
$content .= '
|
||||
<table style="width: 100%; text-align: center">
|
||||
<tr><td>
|
||||
<b>' . $focus->name . '</b>
|
||||
</td></tr>
|
||||
</table>
|
||||
';
|
||||
}
|
||||
if($focus->ecminvoiceout_name!=''){
|
||||
$corl='Korekta do / Correct to:<br>';
|
||||
}
|
||||
$content .= '<br><table width="100%" style="font-size: 7pt;text-align:right;vertical-align:top;">
|
||||
<tr><td width="25%" style="text-align: left;">Data wystawienia / '.$labels['LBL_PDF_CONTENT_REGISTER_DATE'].'<br>Miejsce wystawienia / Place of register:<br>Data sprzedaży / Selling date:<br>'.$corl.'</td>
|
||||
<td style="text-align: left;" width="40%"><b>' . $focus->register_date . '</b><br><b>Warszawa</b><br><b>' . $focus->sell_date . '</b><br><b>' . $focus->ecminvoiceout_name . '</b></td>
|
||||
<td rowspan="2" style="text-align: left;vertical-align:top;">';
|
||||
if($focus->wz_name!=''){
|
||||
$content.='Dokument WZ / WZ Document:<br>';
|
||||
}
|
||||
if($focus->order_no!=''){
|
||||
$content.='Nr zamówienia / Order No:<br>';
|
||||
}
|
||||
if($focus->supplier_code!=''){
|
||||
$content.='Kod dostawcy / Supplier code:<br>';
|
||||
}
|
||||
if($focus->payment_date!=''){
|
||||
$content.='Termin płatności / Payment date:<br>';
|
||||
}
|
||||
if($focus->ecmpaymentcondition_id!=''){
|
||||
$content.='Metoda płatności / Payment method:<br>';
|
||||
}
|
||||
$pay=new EcmPaymentCondition();
|
||||
|
||||
$pay->retrieve($focus->ecmpaymentcondition_id);
|
||||
$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>';
|
||||
}
|
||||
if($focus->supplier_code!=''){
|
||||
$content.='<b>' . $focus->supplier_code.'</b><br>';
|
||||
}
|
||||
if($focus->payment_date!=''){
|
||||
$content.='<b>' . date('d.m.Y',strtotime($focus->payment_date)).'</b><br>';
|
||||
}
|
||||
if($focus->ecmpaymentcondition_id!=''){
|
||||
$content.='<b>' . $GLOBALS['app_list_strings']['ecmpaymentconditions_payment_method_dom'][$pay->payment_method].'</b><br>';
|
||||
}
|
||||
$content.='</td></tr></table><br>';
|
||||
// start items table
|
||||
$columns = array ();
|
||||
|
||||
$columns ['position'] = array (
|
||||
'field' => array (
|
||||
'position'
|
||||
),
|
||||
'label' => 'Lp. / Pos.',
|
||||
'align' => 'center'
|
||||
);
|
||||
|
||||
$columns ['name'] = array (
|
||||
'field' => array (
|
||||
'name',
|
||||
'product_code'
|
||||
),
|
||||
'label' => 'Nazwa / Name<br>Indeks / Index ',
|
||||
'align' => 'left'
|
||||
);
|
||||
if($recipient_code==1){
|
||||
$columns ['recipient_code'] = array (
|
||||
'field' => array (
|
||||
'recipient_code'
|
||||
),
|
||||
'label' => 'Kod Tow. / Recipient Code',
|
||||
'align' => 'center'
|
||||
);
|
||||
}
|
||||
$columns ['qty'] = array (
|
||||
'field' => array (
|
||||
'quantity',
|
||||
'unit_name'
|
||||
),
|
||||
'label' => 'Ilość / Qantity<br>J.m. / Unit',
|
||||
'align' => 'right'
|
||||
);
|
||||
|
||||
$columns ['price_netto'] = array (
|
||||
'field' => array (
|
||||
'price_netto'
|
||||
),
|
||||
'label' => 'Cena / Price',
|
||||
'align' => 'right'
|
||||
);
|
||||
$columns ['total_brutto'] = array (
|
||||
'field' => array (
|
||||
'total_brutto'
|
||||
),
|
||||
'label' => 'Wartość / Value',
|
||||
'align' => 'right'
|
||||
);
|
||||
// set widths
|
||||
$totals = array ();
|
||||
if($recipient_code==1){
|
||||
$columns ['position'] ['width'] = '5';
|
||||
$columns ['name'] ['width'] = '41';
|
||||
$columns ['recipient_code'] ['width'] = '12';
|
||||
$columns ['qty'] ['width'] = '12';
|
||||
$columns ['price_netto'] ['width'] = '12';
|
||||
$columns ['total_brutto'] ['width'] = '12';
|
||||
} else {
|
||||
$columns ['position'] ['width'] = '5';
|
||||
$columns ['name'] ['width'] = '51';
|
||||
$columns ['qty'] ['width'] = '14';
|
||||
$columns ['price_netto'] ['width'] = '14';
|
||||
$columns ['total_brutto'] ['width'] = '14';
|
||||
}
|
||||
// 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;
|
||||
if($focus->type=='normal'){
|
||||
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>';
|
||||
}
|
||||
} else {
|
||||
foreach ( $positions as $pos ) {
|
||||
$content .= '<tr>';
|
||||
$pos2= formatPDFPositionsCorrect ($focus->getCorrectedPosition($pos['ecminvoiceoutitem_id']), $focus );
|
||||
$pos2['name']='było / was';
|
||||
$pos2['position']='';
|
||||
$pos2['product_code']=' ';
|
||||
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><tr>';
|
||||
// old correct item
|
||||
foreach ( $columns as $col ) {
|
||||
|
||||
$content .= '<td style="border: 0.5 solid black; text-align: ' . $col ['align'] . ';">';
|
||||
foreach ( $col ['field'] as $f ) {
|
||||
|
||||
if (! $pos2 [$f] || $pos2 [$f] == '')
|
||||
$pos2 [$f] = '-';
|
||||
$content .= $pos2 [$f] . '<br>';
|
||||
|
||||
}
|
||||
$content .= '</td>';
|
||||
}
|
||||
$content .= '</tr>';
|
||||
}
|
||||
}
|
||||
$content .= '
|
||||
</tbody></table>
|
||||
';
|
||||
// summary table
|
||||
// get currency symbol
|
||||
$c = new Currency ();
|
||||
$c->retrieve ( $focus->currency_id );
|
||||
$symbol = $c->name;
|
||||
unset ( $c );
|
||||
$content .= '
|
||||
<br>
|
||||
<table style="font-size: 9pt; border: 0.5 solid black; border-collapse: collapse; width: 300px; margin-left: 60%">
|
||||
';
|
||||
|
||||
$content.='</tr>
|
||||
';
|
||||
|
||||
// totals
|
||||
$content .= '
|
||||
<tr>
|
||||
<td style="font-size: 6.5pt; border: 0.5 solid black; width: 23%;text-align: center;background-color: #E9E9E9;">
|
||||
<b>Razem / Total</b>
|
||||
</td>
|
||||
|
||||
<td style="font-size: 6.5pt; border: 0.5 solid black; width: 27%;text-align: right;background-color: #E9E9E9;">
|
||||
<b>'.format_number($focus->total_brutto).' '.$symbol.'</b>
|
||||
</td></tr></table>';
|
||||
$left_to_paid=$focus->total_brutto-$focus->paid_val;
|
||||
if($focus->type=='correct'){
|
||||
$content .= '<table style="font-size: 7pt;"><tr><td >Do zwrotu / To paid back:</td><td style="text-align: right;">
|
||||
<b>'.format_number($left_to_paid).' '.$symbol.'</b></td><td style="text-align:left;">'.$paid_text.'</td></tr></table>';
|
||||
} else {
|
||||
$content .= '
|
||||
|
||||
<table style="font-size: 7pt;">
|
||||
<tr><td>Do zapłaty / To pay:</td><td style="text-align: right;"><b>'.format_number($focus->total_brutto).' '.$symbol.'</b></td><td></td></tr>';
|
||||
if($focus->paid_val!=''){
|
||||
if($focus->paid_val!=0)$pay_text=$GLOBALS['app_list_strings']['ecmpaymentconditions_payment_method_dom'][$focus->payment_method_paid];
|
||||
$content .= '<tr><td>Zapłacono / Paid:</td><td style="text-align: right;"><b>'.format_number($focus->paid_val).' '.$symbol.'</b></td><td style="text-align:left;">'.$pay_text.'</td></tr>';
|
||||
}
|
||||
|
||||
if($focus->ecmpaymentcondition_id!=''){
|
||||
|
||||
$q= $db->query ( "select name from ecmpaymentconditions where id='$focus->ecmpaymentcondition_id'" );
|
||||
$r=$db->fetchByAssoc($q);
|
||||
//$paid_text='w Terminie <b>'.$r['name'].'</b> do <b>'.date('d.m.Y',strtotime($focus->payment_date)).'</b> '.$GLOBALS['app_list_strings']['payment_method_dom'][$focus->payment_method];
|
||||
} else {
|
||||
if($focus->payment_date!=''){
|
||||
|
||||
$dni=(strtotime($focus->payment_date)-strtotime($focus->sell_date))/(3600*24);
|
||||
//$paid_text='w Terminie <b>'.$dni.' dni</b> do <b>'.date('d.m.Y',strtotime($focus->payment_date)).'</b> '.$GLOBALS['app_list_strings']['payment_method_dom'][$focus->payment_method];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$content .= '<tr><td>Pozostało do zapłaty / Left to paid:</td><td style="text-align: right;"><b>'.format_number($left_to_paid).' '.$symbol.'</b></td><td style="text-align:left;">'.$paid_text.'</td></tr>
|
||||
</table>';}
|
||||
|
||||
$default= "Dla wszystkich pozycji faktury zastosowano stawkę VAT 0%
|
||||
<br>VAT is 0% for all invoice items
|
||||
<br>(Zgodnie z art. 41 ust. 3 ustawy o podatku VAT)";
|
||||
|
||||
|
||||
if($focus->pdf_export!=""){
|
||||
$focus->pdf_export =str_replace("\r\n","<br>",$focus->pdf_export);
|
||||
} else {
|
||||
$focus->pdf_export = $default;
|
||||
}
|
||||
$content .= '<br><br><br><br>'.$focus->pdf_export.'<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();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
407
modules/EcmInvoiceOuts/PDFTemplate/tpl/content_en_correct.php
Normal file
407
modules/EcmInvoiceOuts/PDFTemplate/tpl/content_en_correct.php
Normal file
@@ -0,0 +1,407 @@
|
||||
<?php
|
||||
$w = "35"; // first column width
|
||||
$w3 = "35";
|
||||
$w2 = "25"; // second column width
|
||||
|
||||
|
||||
$db = $GLOBALS['db'];
|
||||
$ret = $db->query("
|
||||
SELECT distinct o.ecminvoiceout_id
|
||||
FROM
|
||||
ecminvoiceoutitems as ii
|
||||
INNER JOIN ecminvoiceouts as i
|
||||
ON ii.ecminvoiceout_id = i.id
|
||||
INNER JOIN ecminvoiceoutitems AS o
|
||||
ON o.id = ii.ecminvoiceoutitem_id
|
||||
WHERE
|
||||
ii.ecminvoiceout_id = '$focus->id'");
|
||||
|
||||
|
||||
if ($ret->num_rows > 1) $multi_correct = true;
|
||||
|
||||
|
||||
|
||||
$content = '
|
||||
<table style="width: 100%; font-size: 8pt;">
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
<b>NABYWCA / BUYER</b>
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">';
|
||||
if($focus->parent_shipping_address_name!=''){
|
||||
$content.= '<b>DOSTAWA / DELIVERY</b>';
|
||||
}
|
||||
|
||||
$content.= '</td>
|
||||
<td style="width: ' . $w2 . '%">';
|
||||
if($focus->parent_payer_address_name!=''){
|
||||
$content.= '<b>PŁATNIK / PAYER</b>';
|
||||
}$content.= '</td>
|
||||
<td style="text-align: right"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_name . '
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
'.$focus->parent_shipping_address_name.'
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">'.$focus->parent_payer_address_name.'</td>
|
||||
<td style="text-align: right"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_address_street . '
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
' . $focus->parent_shipping_address_street . '
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
' . $focus->parent_payer_address_street . '
|
||||
</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->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.='
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
'. $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.='
|
||||
</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.='NIP/Vat ID: '.$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->parent_shipping_address_nip) && $focus->parent_shipping_address_nip) {
|
||||
$content.='NIP/Vat ID: '.$focus->parent_shipping_address_nip;
|
||||
$nip = true;
|
||||
}
|
||||
if (!is_null($focus->parent_shipping_iln) && $focus->parent_shipping_iln) {
|
||||
if ($nip) $content.'<br>'; $nip = false;
|
||||
$content.=$labels['LBL_PDF_CONTENT_ILN'].' '.$focus->parent_shipping_iln;
|
||||
}
|
||||
$content.='
|
||||
</td>';
|
||||
$content.='
|
||||
<td valign="top" style="width: ' . $w3 . '%">';
|
||||
if (!is_null($focus->parent_payer_address_nip) && $focus->parent_payer_address_nip) {
|
||||
$content.='NIP/Vat ID: '.$focus->parent_payer_address_nip;
|
||||
$nip = true;
|
||||
}
|
||||
if (!is_null($focus->parent_payer_iln) && $focus->parent_payer_iln) {
|
||||
if ($nip) $content.'<br>'; $nip = false;
|
||||
$content.=$labels['LBL_PDF_CONTENT_ILN'].' '.$focus->parent_payer_iln;
|
||||
}
|
||||
$content.='</td>
|
||||
<td colspan="0" valign="top" style="text-align: right">
|
||||
|
||||
</td>
|
||||
</tr>';
|
||||
$content.='
|
||||
</table>
|
||||
';
|
||||
if ($focus->name && $focus->name != '') {
|
||||
$content .= '
|
||||
<table style="width: 100%; text-align: center">
|
||||
<tr><td>
|
||||
<b>' . $focus->name . '</b>
|
||||
</td></tr>
|
||||
</table>
|
||||
';
|
||||
}
|
||||
if($focus->type=='correct'){
|
||||
$corl='Korekta do / Correct to:';
|
||||
$labels['LBL_PDF_CONTENT_PARENT_DOCUMENT_NO'] = "Numer zwrotu / Return number";
|
||||
}
|
||||
|
||||
$labels['LBL_PLACE_PDF'] = 'Miejsce wystawienia / Place of register:';
|
||||
$labels['LBL_PDF_CONTENT_SELL_DATE'] = 'Data sprzedaży / Sell date:';
|
||||
if (!$multi_correct) {
|
||||
$inv = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT register_date FROM ecminvoiceouts WHERE id='".$focus->ecminvoiceout_id."'"));
|
||||
$content .= '<br><table width="100%" style="font-size: 7pt;text-align:left;vertical-align:top;">
|
||||
<tr><td width="25%" >Data wystawienia / Register date<br>'.$labels['LBL_PLACE_PDF'].'<br>'.$labels['LBL_PDF_CONTENT_SELL_DATE'].'<br>'.$corl.'</td>
|
||||
<td style="text-align: left;" width="40%"><b>' . $focus->register_date . '</b><br><b>Warszawa</b><br><b>' . $focus->sell_date . '</b><br><b>' . $focus->ecminvoiceout_name . '</b>, '.$inv['register_date'].'</td>
|
||||
<td rowspan="2" style="text-align: left;vertical-align:top; width: 25%;">';
|
||||
} else {
|
||||
$content .= '<br><table width="100%" style="font-size: 7pt;text-align:left;vertical-align:top;">
|
||||
<tr><td width="25%" >'.$labels['LBL_PDF_CONTENT_REGISTER_DATE'].'<br>'.$labels['LBL_PLACE_PDF'].'<br>'.$labels['LBL_PDF_CONTENT_SELL_DATE'].'<br></td>
|
||||
<td style="text-align: left;" width="50%"><b>' . $focus->register_date . '</b><br><b>Warszawa</b><br><b>' . $focus->sell_date . '</b><br><b></b></td>
|
||||
<td rowspan="2" style="text-align: left;vertical-align:top; width: 25%">';
|
||||
}
|
||||
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>';
|
||||
}
|
||||
if($focus->supplier_code!=''){
|
||||
$content.=$labels['LBL_SUPPLIER_CODE'].':<br>';
|
||||
}
|
||||
if($focus->payment_date!=''){
|
||||
$content.='Data płatności / Payment date:<br>';
|
||||
}
|
||||
if($focus->ecmpaymentcondition_id!=''){
|
||||
$content.='Metoda płatności / Payment method:<br>';
|
||||
}
|
||||
|
||||
$pay=new EcmPaymentCondition();
|
||||
|
||||
$pay->retrieve($focus->ecmpaymentcondition_id);
|
||||
|
||||
$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>';
|
||||
}
|
||||
if($focus->supplier_code!=''){
|
||||
$content.='<b>' . $focus->supplier_code.'</b><br>';
|
||||
}
|
||||
if($focus->payment_date!=''){
|
||||
$content.='<b>' . date('d.m.Y',strtotime($focus->payment_date)).'</b><br>';
|
||||
}
|
||||
if($focus->ecmpaymentcondition_id!=''){
|
||||
$content.='<b>' . $GLOBALS['app_list_strings']['ecmpaymentconditions_payment_method_dom'][$pay->payment_method].'</b><br>';
|
||||
}
|
||||
$content.='</td></tr></table><br>';
|
||||
// start items table
|
||||
$columns = array ();
|
||||
|
||||
$columns ['position'] = array (
|
||||
'field' => array (
|
||||
'position'
|
||||
),
|
||||
'label' => 'Lp. / Pos.',
|
||||
'align' => 'center'
|
||||
);
|
||||
|
||||
$columns ['name'] = array (
|
||||
'field' => array (
|
||||
'name',
|
||||
'product_code'
|
||||
),
|
||||
'label' => 'Nazwa / Name<br>Indeks / Index ',
|
||||
'align' => 'left'
|
||||
);
|
||||
if($recipient_code==1){
|
||||
$columns ['recipient_code'] = array (
|
||||
'field' => array (
|
||||
'recipient_code'
|
||||
),
|
||||
'label' => 'Kod Tow. / Recipient Code',
|
||||
'align' => 'center'
|
||||
);
|
||||
}
|
||||
$columns ['qty'] = array (
|
||||
'field' => array (
|
||||
'quantity',
|
||||
'unit_name'
|
||||
),
|
||||
'label' => 'Ilość / Qantity<br>J.m. / Unit',
|
||||
'align' => 'right'
|
||||
);
|
||||
|
||||
$columns ['price_netto'] = array (
|
||||
'field' => array (
|
||||
'price_netto'
|
||||
),
|
||||
'label' => 'Cena /Price',
|
||||
'align' => 'right'
|
||||
);
|
||||
|
||||
$columns ['total_brutto'] = array (
|
||||
'field' => array (
|
||||
'total_brutto'
|
||||
),
|
||||
'label' => 'Wartość / Value',
|
||||
'align' => 'right'
|
||||
);
|
||||
// set widths
|
||||
// set widths
|
||||
$totals = array ();
|
||||
if($recipient_code==1){
|
||||
$columns ['position'] ['width'] = '5';
|
||||
$columns ['name'] ['width'] = '41';
|
||||
$columns ['recipient_code'] ['width'] = '12';
|
||||
$columns ['qty'] ['width'] = '12';
|
||||
$columns ['price_netto'] ['width'] = '12';
|
||||
$columns ['total_brutto'] ['width'] = '12';
|
||||
} else {
|
||||
$columns ['position'] ['width'] = '5';
|
||||
$columns ['name'] ['width'] = '51';
|
||||
$columns ['qty'] ['width'] = '14';
|
||||
$columns ['price_netto'] ['width'] = '14';
|
||||
$columns ['total_brutto'] ['width'] = '14';
|
||||
}
|
||||
|
||||
// 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] == '') && $f!='quantity')
|
||||
$pos [$f] = '-';
|
||||
$content .= $pos [$f] . '<br>';
|
||||
|
||||
}
|
||||
$content .= '</td>';
|
||||
}
|
||||
$content .= '</tr><tr>';
|
||||
// old correct item
|
||||
$pos['name'] = 'było';
|
||||
if ($multi_correct) {
|
||||
// get invoice
|
||||
$c = $db->fetchByAssoc ( $db->query ( "
|
||||
SELECT i.document_no, i.order_no, register_date FROM ecminvoiceouts AS i
|
||||
INNER JOIN ecminvoiceoutitems as ii
|
||||
ON i.id=ii.ecminvoiceout_id
|
||||
WHERE ii.id = '" . $pos ['ecminvoiceoutitem_id'] . "'
|
||||
" ) );
|
||||
if ($c['order_no'] && $c['order_no']!='')
|
||||
$pos['name'] .= '<br>' . $corl . ' ' . $c ['document_no'] .' - '.$c['register_date'].'<br>' .
|
||||
$mod_strings ['LBL_PDF_ORDER_NO'].' '.$c['order_no'];
|
||||
else
|
||||
$pos['name'] .= '<br>' . $corl .' '.$c ['document_no'] .' - '.$c['register_date'];
|
||||
unset ( $c );
|
||||
}
|
||||
$pos['total_netto'] = $pos['old_total_netto'];
|
||||
$pos['total_brutto'] = $pos['old_total_brutto'];
|
||||
$pos['total_vat'] = $pos['old_total_vat'];
|
||||
$pos['price_netto'] = $pos['old_price_netto'];
|
||||
$pos['quantity'] = $pos['old_quantity'];
|
||||
$pos['position']='';
|
||||
$pos['product_code']=' ';
|
||||
|
||||
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->iso4217;
|
||||
unset ( $c );
|
||||
$content .= '
|
||||
<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: 25%;text-align: center;">
|
||||
<b>Wartość / Value</b>
|
||||
</td>
|
||||
<td style="font-size: 6.5pt; border: 0.5 solid black; width: 27%;text-align: right;background-color: #E9E9E9;">
|
||||
<b>'.format_number($focus->total_brutto).'</b>
|
||||
</td>
|
||||
';
|
||||
|
||||
$content.='</tr>
|
||||
';
|
||||
|
||||
|
||||
$left_to_paid=$focus->total_brutto-$focus->paid_val;
|
||||
|
||||
if ($focus->total_brutto > 0)
|
||||
$labels['LBL_PDF_TO_PAY'] = 'Do zapłaty / To paid: ';
|
||||
else
|
||||
$labels['LBL_PDF_TO_PAY'] = 'Do zwrotu / To paid back: ';
|
||||
|
||||
$total_brutto = abs($focus->total_brutto);
|
||||
$content .= '
|
||||
</table>
|
||||
<table style="font-size: 7pt;">
|
||||
<tr><td>'.$labels['LBL_PDF_TO_PAY'].'</td><td style="text-align: right;"><b>'.format_number($total_brutto).' '.$symbol.'</b></td><td></td></tr>';
|
||||
|
||||
|
||||
if($focus->ecmpaymentcondition_id!=''){
|
||||
|
||||
$q= $db->query ( "select name from ecmpaymentconditions where id='$focus->ecmpaymentcondition_id'" );
|
||||
$r=$db->fetchByAssoc($q);
|
||||
//$paid_text='w Terminie <b>'.$r['name'].'</b> do <b>'.date('d.m.Y',strtotime($focus->payment_date)).'</b> '.$GLOBALS['app_list_strings']['payment_method_dom'][$focus->payment_method];
|
||||
} else {
|
||||
if($focus->payment_date!=''){
|
||||
|
||||
$dni=(strtotime($focus->payment_date)-strtotime($focus->sell_date))/(3600*24);
|
||||
//$paid_text='w Terminie <b>'.$dni.' dni</b> do <b>'.date('d.m.Y',strtotime($focus->payment_date)).'</b> '.$GLOBALS['app_list_strings']['payment_method_dom'][$focus->payment_method];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$focus->pdf_text || $focus->pdf_text=="")
|
||||
$focus->pdf_text = "Przyczyna korekty: Zwrot towaru.<br>Correct reason: Products return.";
|
||||
|
||||
$content .= '
|
||||
</table><br><p style="font-size: 7pt;">Wystawił / Issued by <b>'.$user->full_name.'</b></p>
|
||||
<br><br>
|
||||
' . $focus->pdf_text . '
|
||||
';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
419
modules/EcmInvoiceOuts/PDFTemplate/tpl/content_k.php
Normal file
419
modules/EcmInvoiceOuts/PDFTemplate/tpl/content_k.php
Normal file
@@ -0,0 +1,419 @@
|
||||
<?php
|
||||
$w = "35"; // first column width
|
||||
$w3 = "35";
|
||||
$w2 = "25"; // second column width
|
||||
|
||||
|
||||
$content = '
|
||||
<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->parent_shipping_address_name != '') {
|
||||
$content .= '<b>' . $labels['LBL_PDF_CONTENT_DELIVERY'] . '</b>';
|
||||
}
|
||||
|
||||
$content .= '</td>
|
||||
<td style="width: ' . $w2 . '%">';
|
||||
if ($focus->parent_payer_address_name != '') {
|
||||
$content .= '<b>' . $labels['LBL_PDF_CONTENT_PAYER'] . '</b>';
|
||||
}
|
||||
$content .= '</td>
|
||||
<td style="text-align: right"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_name . '
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
' . $focus->parent_shipping_address_name . '
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">' . $focus->parent_payer_address_name . '</td>
|
||||
<td style="text-align: right"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_address_street . '
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
' . $focus->parent_shipping_address_street . '
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
' . $focus->parent_payer_address_street . '
|
||||
</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->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 .= '
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
' . $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 .= '
|
||||
</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 .= 'ILN: ' . $focus->parent_iln;
|
||||
}
|
||||
$content .= '
|
||||
</td>';
|
||||
$content .= '
|
||||
<td valign="top" style="width: ' . $w3 . '%">';
|
||||
if (!is_null($focus->parent_shipping_address_nip) && $focus->parent_shipping_address_nip) {
|
||||
$content .= $labels['LBL_PDF_CONTENT_NIP'] . ' ' . $focus->parent_shipping_address_nip;
|
||||
$nip = true;
|
||||
}
|
||||
if (!is_null($focus->parent_shipping_iln) && $focus->parent_shipping_iln) {
|
||||
if ($nip) $content .= '<br>';
|
||||
$nip = false;
|
||||
$content .= 'ILN: ' . $focus->parent_shipping_iln;
|
||||
}
|
||||
$content .= '
|
||||
</td>';
|
||||
$content .= '
|
||||
<td valign="top" style="width: ' . $w3 . '%">';
|
||||
if (!is_null($focus->parent_payer_address_nip) && $focus->parent_payer_address_nip) {
|
||||
$content .= $labels['LBL_PDF_CONTENT_NIP'] . ' ' . $focus->parent_payer_address_nip;
|
||||
$nip = true;
|
||||
}
|
||||
if (!is_null($focus->parent_payer_iln) && $focus->parent_payer_iln) {
|
||||
if ($nip) $content .= '<br>';
|
||||
$nip = false;
|
||||
$content .= 'ILN: ' . $focus->parent_payer_iln;
|
||||
}
|
||||
$content .= '</td>
|
||||
<td colspan="0" valign="top" style="text-align: right">
|
||||
|
||||
</td>
|
||||
</tr>';
|
||||
$content .= '
|
||||
</table>
|
||||
';
|
||||
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:left;vertical-align:top;">
|
||||
<tr><td width="18%" >' . $labels['LBL_PDF_CONTENT_REGISTER_DATE'] . '<br>' . $labels['LBL_PLACE_PDF'] . '<br>' . $labels['LBL_PDF_CONTENT_SELL_DATE'] . '<br>' . $corl . '</td>
|
||||
<td style="text-align: left;" width="35%"><b>' . $focus->register_date . '</b><br><b>Warszawa</b><br><b>' . $focus->sell_date . '</b>' . $korekta . '</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>';
|
||||
}
|
||||
if ($focus->supplier_code != '') {
|
||||
$content .= $labels['LBL_SUPPLIER_CODE'] . ':<br>';
|
||||
}
|
||||
if ($focus->payment_date != '') {
|
||||
$content .= $labels['LBL_PAYMENT_DATE_PDF'] . ':<br>';
|
||||
}
|
||||
if ($focus->ecmpaymentcondition_id != '') {
|
||||
$content .= $labels['LBL_PAYMENT_METHOD_PDF'] . ':<br>';
|
||||
}
|
||||
|
||||
$pay = new EcmPaymentCondition();
|
||||
|
||||
$pay->retrieve($focus->ecmpaymentcondition_id);
|
||||
|
||||
$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>';
|
||||
}
|
||||
if ($focus->supplier_code != '') {
|
||||
$content .= '<b>' . $focus->supplier_code . '</b><br>';
|
||||
}
|
||||
if ($focus->payment_date != '') {
|
||||
$content .= '<b>' . date('d.m.Y', strtotime($focus->payment_date)) . '</b><br>';
|
||||
}
|
||||
if ($focus->ecmpaymentcondition_id != '') {
|
||||
$content .= '<b>' . $GLOBALS['app_list_strings']['ecmpaymentconditions_payment_method_dom'][$pay->payment_method] . '</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'
|
||||
);
|
||||
if ($recipient_code == 1) {
|
||||
$columns['recipient_code'] = array(
|
||||
'field' => array(
|
||||
'recipient_code'
|
||||
),
|
||||
'label' => 'Kod Tow.',
|
||||
'align' => 'center'
|
||||
);
|
||||
}
|
||||
$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';
|
||||
if ($recipient_code == 1) {
|
||||
$columns['recipient_code']['width'] = '10';
|
||||
}
|
||||
$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>
|
||||
<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>';
|
||||
}
|
||||
$total_paid_vat = 0;
|
||||
$total_paid_netto = 0;
|
||||
if ($focus->prepaid != '') {
|
||||
|
||||
$vat_value = substr($k,0,-1)+'';
|
||||
if (strlen($vat_value) == 1) $vat_value = '0'.$vat_value;
|
||||
$paid_netto = round($focus->prepaid / 1.23,2);
|
||||
$paid_vat = $focus->prepaid - $paid_netto;
|
||||
$total_paid_netto += $paid_netto;
|
||||
$total_paid_vat += $paid_vat;
|
||||
$content .= '
|
||||
<tr>
|
||||
<td style="font-size: 7pt; border: 0.5 solid black; width: 23%;text-align: center;">
|
||||
23%
|
||||
</td>
|
||||
<td style="font-size: 7pt; border: 0.5 solid black; width: 25%;text-align: right;">
|
||||
-' .format_number($paid_netto). '
|
||||
</td>
|
||||
<td style="font-size: 7pt; border: 0.5 solid black; width: 25%;text-align: right;">
|
||||
-' .format_number($paid_vat). '
|
||||
</td>
|
||||
<td style="font-size: 7pt; border: 0.5 solid black; width: 27%;text-align: right;">
|
||||
-' . format_number($focus->prepaid) . '
|
||||
</td></tr>';
|
||||
}
|
||||
// totals
|
||||
$content .= '
|
||||
<tr>
|
||||
<td style="font-size: 6.5pt; border: 0.5 solid black; width: 23%;text-align: center;background-color: #E9E9E9;">
|
||||
<b>Razem</b>
|
||||
</td>
|
||||
<td style="font-size: 6.5pt; border: 0.5 solid black; width: 25%;text-align: right;background-color: #E9E9E9;">
|
||||
<b>' . format_number($focus->total_netto-$total_paid_netto) . '</b>
|
||||
</td>
|
||||
<td style="font-size: 6.5pt; border: 0.5 solid black; width: 25%;text-align: right;background-color: #E9E9E9;">
|
||||
<b>' . format_number($focus->total_vat-$total_paid_vat) . '</b>
|
||||
</td>
|
||||
<td style="font-size: 6.5pt; border: 0.5 solid black; width: 27%;text-align: right;background-color: #E9E9E9;">
|
||||
<b>' . format_number($focus->total_brutto-$focus->prepaid) . '</b>
|
||||
</td></tr>';
|
||||
$left_to_paid = $focus->total_brutto - $focus->paid_val - $focus->prepaid;
|
||||
$content .= '
|
||||
</table>
|
||||
<table style="font-size: 7pt;">';
|
||||
if ($focus->prepaid != '') {
|
||||
$content .= '<tr><td>FV przedpłatowa:</td><td style="text-align: right;"><b>' . $focus->prepaid_nr . '</b></td><td style="text-align:left;"></td></tr>';
|
||||
}
|
||||
$content .= '<tr><td>' . $labels['LBL_PDF_TO_PAY'] . '</td><td style="text-align: right;"><b>' . format_number($focus->total_brutto) . ' ' . $symbol . '</b></td><td></td></tr>';
|
||||
if ($focus->prepaid != '') {
|
||||
$content .= '<tr><td>Przedpłata</td><td style="text-align: right;"><b>' . format_number($focus->prepaid) . ' ' . $symbol . '</b></td><td style="text-align:left;"></td></tr>';
|
||||
}
|
||||
if ($focus->paid_val != '') {
|
||||
if ($focus->paid_val != 0) $pay_text = $GLOBALS['app_list_strings']['ecmpaymentconditions_payment_method_dom'][$focus->payment_method_paid];
|
||||
$content .= '<tr><td>' . $labels['LBL_PDF_PAID'] . '</td><td style="text-align: right;"><b>' . format_number($focus->paid_val) . ' ' . $symbol . '</b></td><td style="text-align:left;">' . $pay_text . '</td></tr>';
|
||||
}
|
||||
|
||||
if ($focus->ecmpaymentcondition_id != '') {
|
||||
|
||||
$q = $db->query("select name from ecmpaymentconditions where id='$focus->ecmpaymentcondition_id'");
|
||||
$r = $db->fetchByAssoc($q);
|
||||
//$paid_text='w Terminie <b>'.$r['name'].'</b> do <b>'.date('d.m.Y',strtotime($focus->payment_date)).'</b> '.$GLOBALS['app_list_strings']['payment_method_dom'][$focus->payment_method];
|
||||
} else {
|
||||
if ($focus->payment_date != '') {
|
||||
|
||||
$dni = (strtotime($focus->payment_date) - strtotime($focus->sell_date)) / (3600 * 24);
|
||||
//$paid_text='w Terminie <b>'.$dni.' dni</b> do <b>'.date('d.m.Y',strtotime($focus->payment_date)).'</b> '.$GLOBALS['app_list_strings']['payment_method_dom'][$focus->payment_method];
|
||||
}
|
||||
}
|
||||
|
||||
$content .= '<tr><td>' . $labels['LBL_PDF_LEFT_TO_PAID'] . '</td><td style="text-align: right;"><b>' . format_number($left_to_paid) . ' ' . $symbol . '</b></td><td style="text-align:left;">' . $paid_text . '</td></tr>
|
||||
</table>';
|
||||
if ($focus->currency_id != 'PLN') {
|
||||
//get currency date
|
||||
$dd = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT date, value FROM currency_nbp_archive WHERE currency_id='" . $focus->currency_id . "' AND nbp_table_name='" . $focus->currency_table . "' "));
|
||||
$content .= "<p style='font-size: 7pt;'>Wartość VAT w zł: " . format_number(($focus->total_vat * $dd['value'])) . ". Przeliczowo wg. kursu NBP (" . $focus->currency_table . ": " . format_number($dd['value'], 4, 4) . " zł) z dnia " . $dd['date'] . '</p>';
|
||||
}
|
||||
$content .= '<p style="font-size: 7pt;">' . $labels['LBL_PDF_CONTENT_ISSUED_BY'] . ' <b>' . $user->full_name . '</b></p>
|
||||
<br><br>
|
||||
' . $focus->pdf_text . '
|
||||
';
|
||||
462
modules/EcmInvoiceOuts/PDFTemplate/tpl/content_k_correct.php
Normal file
462
modules/EcmInvoiceOuts/PDFTemplate/tpl/content_k_correct.php
Normal file
@@ -0,0 +1,462 @@
|
||||
<?php
|
||||
$w = "35"; // first column width
|
||||
$w3 = "35";
|
||||
$w2 = "25"; // second column width
|
||||
|
||||
|
||||
$db = $GLOBALS['db'];
|
||||
$ret = $db->query("
|
||||
SELECT distinct o.ecminvoiceout_id
|
||||
FROM
|
||||
ecminvoiceoutitems as ii
|
||||
INNER JOIN ecminvoiceouts as i
|
||||
ON ii.ecminvoiceout_id = i.id
|
||||
INNER JOIN ecminvoiceoutitems AS o
|
||||
ON o.id = ii.ecminvoiceoutitem_id
|
||||
WHERE
|
||||
ii.ecminvoiceout_id = '$focus->id'");
|
||||
|
||||
|
||||
if ($ret->num_rows > 1) $multi_correct = true;
|
||||
|
||||
|
||||
|
||||
$content = '
|
||||
<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->parent_shipping_address_name!=''){
|
||||
$content.= '<b>'.$labels['LBL_PDF_CONTENT_DELIVERY'].'</b>';
|
||||
}
|
||||
|
||||
$content.= '</td>
|
||||
<td style="width: ' . $w2 . '%">';
|
||||
if($focus->parent_payer_address_name!=''){
|
||||
$content.= '<b>'.$labels['LBL_PDF_CONTENT_PAYER'].'</b>';
|
||||
}$content.= '</td>
|
||||
<td style="text-align: right"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_name . '
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
'.$focus->parent_shipping_address_name.'
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">'.$focus->parent_payer_address_name.'</td>
|
||||
<td style="text-align: right"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_address_street . '
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
' . $focus->parent_shipping_address_street . '
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
' . $focus->parent_payer_address_street . '
|
||||
</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->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.='
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
'. $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.='
|
||||
</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.='ILN: '.$focus->parent_iln;
|
||||
}
|
||||
$content.='
|
||||
</td>';
|
||||
$content.='
|
||||
<td valign="top" style="width: ' . $w3 . '%">';
|
||||
if (!is_null($focus->parent_shipping_address_nip) && $focus->parent_shipping_address_nip) {
|
||||
$content.=$labels['LBL_PDF_CONTENT_NIP'].' '.$focus->parent_shipping_address_nip;
|
||||
$nip = true;
|
||||
}
|
||||
if (!is_null($focus->parent_shipping_iln) && $focus->parent_shipping_iln) {
|
||||
if ($nip) $content.='<br>'; $nip = false;
|
||||
$content.='ILN: '.$focus->parent_shipping_iln;
|
||||
}
|
||||
$content.='
|
||||
</td>';
|
||||
$content.='
|
||||
<td valign="top" style="width: ' . $w3 . '%">';
|
||||
if (!is_null($focus->parent_payer_address_nip) && $focus->parent_payer_address_nip) {
|
||||
$content.=$labels['LBL_PDF_CONTENT_NIP'].' '.$focus->parent_payer_address_nip;
|
||||
$nip = true;
|
||||
}
|
||||
if (!is_null($focus->parent_payer_iln) && $focus->parent_payer_iln) {
|
||||
if ($nip) $content.='<br>'; $nip = false;
|
||||
$content.='ILN: '.$focus->parent_payer_iln;
|
||||
}
|
||||
$content.='</td>
|
||||
<td colspan="0" valign="top" style="text-align: right">
|
||||
|
||||
</td>
|
||||
</tr>';
|
||||
$content.='
|
||||
</table>
|
||||
';
|
||||
if ($focus->name && $focus->name != '') {
|
||||
$content .= '
|
||||
<table style="width: 100%; text-align: center">
|
||||
<tr><td>
|
||||
<b>' . $focus->name . '</b>
|
||||
</td></tr>
|
||||
</table>
|
||||
';
|
||||
}
|
||||
if($focus->type=='correct'){
|
||||
$corl=$labels['LBL_PDF_CORRECT_TO'];
|
||||
$labels['LBL_PDF_CONTENT_PARENT_DOCUMENT_NO'] = "Numer zwrotu";
|
||||
}
|
||||
|
||||
|
||||
if (!$multi_correct) {
|
||||
$inv = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT register_date FROM ecminvoiceouts WHERE id='".$focus->ecminvoiceout_id."'"));
|
||||
$content .= '<br><table width="100%" style="font-size: 7pt;text-align:left;vertical-align:top;">
|
||||
<tr><td width="18%" >'.$labels['LBL_PDF_CONTENT_REGISTER_DATE'].'<br>'.$labels['LBL_PLACE_PDF'].'<br>'.$labels['LBL_PDF_CONTENT_SELL_DATE'].'<br>'.$corl.'</td>
|
||||
<td style="text-align: left;" width="50%"><b>' . $focus->register_date . '</b><br><b>Warszawa</b><br><b>' . $focus->sell_date . '</b><br><b>' . $focus->ecminvoiceout_name . '</b>, z dnia '.$inv['register_date'].'</td>
|
||||
<td rowspan="2" style="text-align: left;vertical-align:top;">';
|
||||
} else {
|
||||
$content .= '<br><table width="100%" style="font-size: 7pt;text-align:left;vertical-align:top;">
|
||||
<tr><td width="18%" >'.$labels['LBL_PDF_CONTENT_REGISTER_DATE'].'<br>'.$labels['LBL_PLACE_PDF'].'<br>'.$labels['LBL_PDF_CONTENT_SELL_DATE'].'<br></td>
|
||||
<td style="text-align: left;" width="50%"><b>' . $focus->register_date . '</b><br><b>Warszawa</b><br><b>' . $focus->sell_date . '</b><br><b></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>';
|
||||
}
|
||||
if($focus->supplier_code!=''){
|
||||
$content.=$labels['LBL_SUPPLIER_CODE'].':<br>';
|
||||
}
|
||||
if($focus->payment_date!=''){
|
||||
$content.=$labels['LBL_PAYMENT_DATE_PDF'].':<br>';
|
||||
}
|
||||
if($focus->ecmpaymentcondition_id!=''){
|
||||
$content.=$labels['LBL_PAYMENT_METHOD_PDF'].':<br>';
|
||||
}
|
||||
|
||||
$pay=new EcmPaymentCondition();
|
||||
|
||||
$pay->retrieve($focus->ecmpaymentcondition_id);
|
||||
|
||||
$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>';
|
||||
}
|
||||
if($focus->supplier_code!=''){
|
||||
$content.='<b>' . $focus->supplier_code.'</b><br>';
|
||||
}
|
||||
if($focus->payment_date!=''){
|
||||
$content.='<b>' . date('d.m.Y',strtotime($focus->payment_date)).'</b><br>';
|
||||
}
|
||||
if($focus->ecmpaymentcondition_id!=''){
|
||||
$content.='<b>' . $GLOBALS['app_list_strings']['payment_method_dom'][$focus->payment_method].'</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'
|
||||
);
|
||||
if($recipient_code==1){
|
||||
$columns ['recipient_code'] = array (
|
||||
'field' => array (
|
||||
'recipient_code'
|
||||
),
|
||||
'label' => 'Kod Tow.',
|
||||
'align' => 'center'
|
||||
);
|
||||
}
|
||||
$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';
|
||||
if($recipient_code==1){
|
||||
$columns ['recipient_code'] ['width'] = '10';
|
||||
}
|
||||
$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] == '') && $f!='quantity')
|
||||
$pos [$f] = '-';
|
||||
$content .= $pos [$f] . '<br>';
|
||||
|
||||
}
|
||||
$content .= '</td>';
|
||||
}
|
||||
$content .= '</tr><tr>';
|
||||
// old correct item
|
||||
$pos['name'] = 'było';
|
||||
if ($multi_correct) {
|
||||
// get invoice
|
||||
$c = $db->fetchByAssoc ( $db->query ( "
|
||||
SELECT i.document_no, i.order_no, register_date FROM ecminvoiceouts AS i
|
||||
INNER JOIN ecminvoiceoutitems as ii
|
||||
ON i.id=ii.ecminvoiceout_id
|
||||
WHERE ii.id = '" . $pos ['ecminvoiceoutitem_id'] . "'
|
||||
" ) );
|
||||
if ($c['order_no'] && $c['order_no']!='')
|
||||
$pos['name'] .= '<br>' . $corl . ' ' . $c ['document_no'] .' - '.$c['register_date'].'<br>' .
|
||||
$mod_strings ['LBL_PDF_ORDER_NO'].' '.$c['order_no'];
|
||||
else
|
||||
$pos['name'] .= '<br>' . $corl .' '.$c ['document_no'] .' - '.$c['register_date'];
|
||||
unset ( $c );
|
||||
}
|
||||
$pos['total_netto'] = $pos['old_total_netto'];
|
||||
$pos['total_brutto'] = $pos['old_total_brutto'];
|
||||
$pos['total_vat'] = $pos['old_total_vat'];
|
||||
$pos['price_netto'] = $pos['old_price_netto'];
|
||||
$pos['quantity'] = $pos['old_quantity'];
|
||||
$pos['position']='';
|
||||
$pos['product_code']=' ';
|
||||
|
||||
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>
|
||||
<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: 6.5pt; border: 0.5 solid black; width: 23%;text-align: center;background-color: #E9E9E9;">
|
||||
<b>Razem</b>
|
||||
</td>
|
||||
<td style="font-size: 6.5pt; 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: 6.5pt; 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: 6.5pt; border: 0.5 solid black; width: 27%;text-align: right;background-color: #E9E9E9;">
|
||||
<b>'.format_number($focus->total_brutto).'</b>
|
||||
</td></tr>';
|
||||
$left_to_paid=$focus->total_brutto-$focus->paid_val;
|
||||
|
||||
if ($focus->total_brutto > 0)
|
||||
$labels['LBL_PDF_TO_PAY'] = 'Do zapłaty: ';
|
||||
else
|
||||
$labels['LBL_PDF_TO_PAY'] = 'Do zwrotu: ';
|
||||
|
||||
$total_brutto = abs($focus->total_brutto);
|
||||
$content .= '
|
||||
</table>
|
||||
<table style="font-size: 7pt;">
|
||||
<tr><td>'.$labels['LBL_PDF_TO_PAY'].'</td><td style="text-align: right;"><b>'.format_number($total_brutto).' '.$symbol.'</b></td><td></td></tr>';
|
||||
|
||||
|
||||
if($focus->ecmpaymentcondition_id!=''){
|
||||
|
||||
$q= $db->query ( "select name from ecmpaymentconditions where id='$focus->ecmpaymentcondition_id'" );
|
||||
$r=$db->fetchByAssoc($q);
|
||||
//$paid_text='w Terminie <b>'.$r['name'].'</b> do <b>'.date('d.m.Y',strtotime($focus->payment_date)).'</b> '.$GLOBALS['app_list_strings']['payment_method_dom'][$focus->payment_method];
|
||||
} else {
|
||||
if($focus->payment_date!=''){
|
||||
|
||||
$dni=(strtotime($focus->payment_date)-strtotime($focus->sell_date))/(3600*24);
|
||||
//$paid_text='w Terminie <b>'.$dni.' dni</b> do <b>'.date('d.m.Y',strtotime($focus->payment_date)).'</b> '.$GLOBALS['app_list_strings']['payment_method_dom'][$focus->payment_method];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$focus->pdf_text || $focus->pdf_text=="")
|
||||
$focus->pdf_text = "Przyczyna korekty: Zwrot towaru.";
|
||||
|
||||
$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 . '
|
||||
';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
366
modules/EcmInvoiceOuts/PDFTemplate/tpl/content_u.php
Normal file
366
modules/EcmInvoiceOuts/PDFTemplate/tpl/content_u.php
Normal file
@@ -0,0 +1,366 @@
|
||||
<?php
|
||||
$w = "35"; // first column width
|
||||
$w3 = "35";
|
||||
$w2 = "25"; // second column width
|
||||
|
||||
$content = '
|
||||
<table style="width: 100%; font-size: 8pt;">
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
<b>'.$labels['LBL_PDF_UE_BUYER_TITLE'].'</b>
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">';
|
||||
if($focus->parent_shipping_address_name!=''){
|
||||
$content.= '<b>'.$labels['LBL_PDF_UE_DELIVERY_TITLE'].'</b>';
|
||||
}
|
||||
|
||||
$content.= '</td>
|
||||
<td style="width: ' . $w2 . '%">';
|
||||
if($focus->parent_payer_address_name!=''){
|
||||
$content.= '<b>'.$labels['LBL_PDF_UE_PAYER_TITLE'].'</b>';
|
||||
}$content.= '</td>
|
||||
<td style="text-align: right"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_name . '
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
'.$focus->parent_shipping_address_name.'
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">'.$focus->parent_payer_address_name.'</td>
|
||||
<td style="text-align: right"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: ' . $w . '%">
|
||||
' . $focus->parent_address_street . '
|
||||
</td>
|
||||
<td style="width: ' . $w3 . '%">
|
||||
' . $focus->parent_shipping_address_street . '
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
' . $focus->parent_payer_address_street . '
|
||||
</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->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.='
|
||||
</td>
|
||||
<td style="width: ' . $w2 . '%">
|
||||
'. $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.='
|
||||
</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_UE_NIP'].' '.$focus->parent_nip;
|
||||
$nip = true;
|
||||
}
|
||||
if (!is_null($focus->parent_iln) && $focus->parent_iln) {
|
||||
if ($nip) $content.='<br>'; $nip = false;
|
||||
$content.='ILN: '.$focus->parent_iln;
|
||||
}
|
||||
$content.='
|
||||
</td>';
|
||||
$content.='
|
||||
<td valign="top" style="width: ' . $w3 . '%">';
|
||||
if (!is_null($focus->parent_shipping_address_nip) && $focus->parent_shipping_address_nip) {
|
||||
$content.=$labels['LBL_PDF_UE_NIP'].' '.$focus->parent_shipping_address_nip;
|
||||
$nip = true;
|
||||
}
|
||||
if (!is_null($focus->parent_shipping_iln) && $focus->parent_shipping_iln) {
|
||||
if ($nip) $content.='<br>'; $nip = false;
|
||||
$content.='ILN: '.$focus->parent_shipping_iln;
|
||||
}
|
||||
$content.='
|
||||
</td>';
|
||||
$content.='
|
||||
<td valign="top" style="width: ' . $w3 . '%">';
|
||||
if (!is_null($focus->parent_payer_address_nip) && $focus->parent_payer_address_nip) {
|
||||
$content.=$labels['LBL_PDF_UE_NIP'].' '.$focus->parent_shipping_address_nip;
|
||||
$nip = true;
|
||||
}
|
||||
if (!is_null($focus->parent_shipping_iln) && $focus->parent_shipping_iln) {
|
||||
if ($nip) $content.='<br>'; $nip = false;
|
||||
$content.='ILN: '.$focus->parent_shipping_iln;
|
||||
}
|
||||
$content.='</td>
|
||||
<td colspan="0" valign="top" style="text-align: right">
|
||||
|
||||
</td>
|
||||
</tr>';
|
||||
$content.='
|
||||
</table>
|
||||
';
|
||||
if ($focus->name && $focus->name != '') {
|
||||
$content .= '
|
||||
<table style="width: 100%; text-align: center">
|
||||
<tr><td>
|
||||
<b>' . $focus->name . '</b>
|
||||
</td></tr>
|
||||
</table>
|
||||
';
|
||||
}
|
||||
if($focus->ecminvoiceout_name!=''){
|
||||
$corl='Korekta do / Correct to:<br>';
|
||||
}
|
||||
$content .= '<br><table width="100%" style="font-size: 7pt;text-align:right;vertical-align:top;">
|
||||
<tr><td width="44%" >Data wystawienia / '.$labels['LBL_PDF_CONTENT_REGISTER_DATE'].'<br>Miejsce wystawienia / Place of register:<br>Data sprzedaży / Selling date:<br>'.$corl.'</td>
|
||||
<td style="text-align: left;" width="20%"><b>' . $focus->register_date . '</b><br><b>Warszawa</b><br><b>' . $focus->sell_date . '</b><br><b>' . $focus->ecminvoiceout_name . '</b></td>
|
||||
<td rowspan="2" style="text-align: left;vertical-align:top;">';
|
||||
if($focus->wz_name!=''){
|
||||
$content.='Dokument WZ / WZ Document:<br>';
|
||||
}
|
||||
if($focus->order_no!=''){
|
||||
$content.='Nr zamówienia / Order No:<br>';
|
||||
}
|
||||
if($focus->supplier_code!=''){
|
||||
$content.='Kod dostawcy / Supplier code:<br>';
|
||||
}
|
||||
if($focus->payment_date!=''){
|
||||
$content.='Termin płatności / Payment date:<br>';
|
||||
}
|
||||
if($focus->ecmpaymentcondition_id!=''){
|
||||
$content.='Metoda płatności / Payment method:<br>';
|
||||
}
|
||||
$pay=new EcmPaymentCondition();
|
||||
|
||||
$pay->retrieve($focus->ecmpaymentcondition_id);
|
||||
$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>';
|
||||
}
|
||||
if($focus->supplier_code!=''){
|
||||
$content.='<b>' . $focus->supplier_code.'</b><br>';
|
||||
}
|
||||
if($focus->payment_date!=''){
|
||||
$content.='<b>' . date('d.m.Y',strtotime($focus->payment_date)).'</b><br>';
|
||||
}
|
||||
if($focus->ecmpaymentcondition_id!=''){
|
||||
$content.='<b>' . $GLOBALS['app_list_strings']['ecmpaymentconditions_payment_method_dom'][$pay->payment_method].'</b><br>';
|
||||
}
|
||||
$content.='</td></tr></table><br>';
|
||||
// start items table
|
||||
$columns = array ();
|
||||
|
||||
$columns ['position'] = array (
|
||||
'field' => array (
|
||||
'position'
|
||||
),
|
||||
'label' => 'Lp. / Pos.',
|
||||
'align' => 'center'
|
||||
);
|
||||
|
||||
$columns ['name'] = array (
|
||||
'field' => array (
|
||||
'name',
|
||||
'product_code'
|
||||
),
|
||||
'label' => 'Nazwa / Name<br>Indeks / Index ',
|
||||
'align' => 'left'
|
||||
);
|
||||
if($recipient_code==1){
|
||||
$columns ['recipient_code'] = array (
|
||||
'field' => array (
|
||||
'recipient_code'
|
||||
),
|
||||
'label' => 'Kod Tow. / Recipient Code',
|
||||
'align' => 'center'
|
||||
);
|
||||
}
|
||||
$columns ['qty'] = array (
|
||||
'field' => array (
|
||||
'quantity',
|
||||
'unit_name'
|
||||
),
|
||||
'label' => 'Ilość / Qantity<br>J.m. / Unit',
|
||||
'align' => 'right'
|
||||
);
|
||||
|
||||
$columns ['price_netto'] = array (
|
||||
'field' => array (
|
||||
'price_netto'
|
||||
),
|
||||
'label' => 'Cena / Price',
|
||||
'align' => 'right'
|
||||
);
|
||||
$columns ['total_brutto'] = array (
|
||||
'field' => array (
|
||||
'total_brutto'
|
||||
),
|
||||
'label' => 'Wartość / Value',
|
||||
'align' => 'right'
|
||||
);
|
||||
// set widths
|
||||
$totals = array ();
|
||||
|
||||
$columns ['position'] ['width'] = '5';
|
||||
$columns ['name'] ['width'] = '41';
|
||||
if($recipient_code==1){
|
||||
$columns ['recipient_code'] ['width'] = '10';
|
||||
}
|
||||
$columns ['qty'] ['width'] = '10';
|
||||
$columns ['price_netto'] ['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;
|
||||
if($focus->type=='normal'){
|
||||
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>';
|
||||
}
|
||||
} else {
|
||||
foreach ( $positions as $pos ) {
|
||||
$content .= '<tr>';
|
||||
$pos2= formatPDFPositionsCorrect ($focus->getCorrectedPosition($pos['ecminvoiceoutitem_id']), $focus );
|
||||
$pos2['name']='było / was';
|
||||
$pos2['position']='';
|
||||
$pos2['product_code']=' ';
|
||||
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><tr>';
|
||||
// old correct item
|
||||
foreach ( $columns as $col ) {
|
||||
|
||||
$content .= '<td style="border: 0.5 solid black; text-align: ' . $col ['align'] . ';">';
|
||||
foreach ( $col ['field'] as $f ) {
|
||||
|
||||
if (! $pos2 [$f] || $pos2 [$f] == '')
|
||||
$pos2 [$f] = '-';
|
||||
$content .= $pos2 [$f] . '<br>';
|
||||
|
||||
}
|
||||
$content .= '</td>';
|
||||
}
|
||||
$content .= '</tr>';
|
||||
}
|
||||
}
|
||||
$content .= '
|
||||
</tbody></table>
|
||||
';
|
||||
// summary table
|
||||
// get currency symbol
|
||||
$c = new Currency ();
|
||||
$c->retrieve ( $focus->currency_id );
|
||||
$symbol = $c->name;
|
||||
unset ( $c );
|
||||
$content .= '
|
||||
<br>
|
||||
<table style="font-size: 9pt; border: 0.5 solid black; border-collapse: collapse; width: 300px; margin-left: 60%">
|
||||
';
|
||||
|
||||
$content.='</tr>
|
||||
';
|
||||
|
||||
// totals
|
||||
$content .= '
|
||||
<tr>
|
||||
<td style="font-size: 6.5pt; border: 0.5 solid black; width: 23%;text-align: center;background-color: #E9E9E9;">
|
||||
<b>Razem / Total</b>
|
||||
</td>
|
||||
|
||||
<td style="font-size: 6.5pt; border: 0.5 solid black; width: 27%;text-align: right;background-color: #E9E9E9;">
|
||||
<b>'.format_number($focus->total_brutto).' '.$symbol.'</b>
|
||||
</td></tr></table>';
|
||||
$left_to_paid=$focus->total_brutto-$focus->paid_val;
|
||||
if($focus->type=='correct'){
|
||||
$content .= '<table style="font-size: 7pt;"><tr><td >Do zwrotu / To paid back:</td><td style="text-align: right;">
|
||||
<b>'.format_number($left_to_paid).' '.$symbol.'</b></td><td style="text-align:left;">'.$paid_text.'</td></tr></table>';
|
||||
} else {
|
||||
$content .= '
|
||||
|
||||
<table style="font-size: 7pt;">
|
||||
<tr><td>Do zapłaty / To pay:</td><td style="text-align: right;"><b>'.format_number($focus->total_brutto).' '.$symbol.'</b></td><td></td></tr>';
|
||||
if($focus->paid_val!=''){
|
||||
if($focus->paid_val!=0)$pay_text=$GLOBALS['app_list_strings']['ecmpaymentconditions_payment_method_dom'][$focus->payment_method_paid];
|
||||
$content .= '<tr><td>Zapłacono / Paid:</td><td style="text-align: right;"><b>'.format_number($focus->paid_val).' '.$symbol.'</b></td><td style="text-align:left;">'.$pay_text.'</td></tr>';
|
||||
}
|
||||
|
||||
if($focus->ecmpaymentcondition_id!=''){
|
||||
|
||||
$q= $db->query ( "select name from ecmpaymentconditions where id='$focus->ecmpaymentcondition_id'" );
|
||||
$r=$db->fetchByAssoc($q);
|
||||
//$paid_text='w Terminie <b>'.$r['name'].'</b> do <b>'.date('d.m.Y',strtotime($focus->payment_date)).'</b> '.$GLOBALS['app_list_strings']['payment_method_dom'][$focus->payment_method];
|
||||
} else {
|
||||
if($focus->payment_date!=''){
|
||||
|
||||
$dni=(strtotime($focus->payment_date)-strtotime($focus->sell_date))/(3600*24);
|
||||
//$paid_text='w Terminie <b>'.$dni.' dni</b> do <b>'.date('d.m.Y',strtotime($focus->payment_date)).'</b> '.$GLOBALS['app_list_strings']['payment_method_dom'][$focus->payment_method];
|
||||
}
|
||||
}
|
||||
|
||||
$content .= '<tr><td>Pozostało do zapłaty / Left to paid:</td><td style="text-align: right;"><b>'.format_number($left_to_paid).' '.$symbol.'</b></td><td style="text-align:left;">'.$paid_text.'</td></tr>
|
||||
</table>';}$content .= '<br><b>Dla wszystkich pozycji faktury zastosowano stawkę VAT 0%
|
||||
<br>VAT is 0% for all invoice items
|
||||
<br>(Zgodnie z art. 41 ust. 3 ustawy o podatku VAT)</b><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();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
110
modules/EcmInvoiceOuts/PDFTemplate/tpl/footer-en_us.php
Normal file
110
modules/EcmInvoiceOuts/PDFTemplate/tpl/footer-en_us.php
Normal file
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
$w = "62"; //first column width
|
||||
$w2 = "12"; //second column width
|
||||
//get bank information
|
||||
$a = new Account();
|
||||
$a->retrieve($focus->parent_id);
|
||||
|
||||
if ($focus->currency_id=='6336d9a0-ee5f-52e3-7d0c-4e6f1472b2bf'){
|
||||
// eur
|
||||
$ba_number = 'PL 36 1160 2202 0000 0000 6408 0587';
|
||||
$ba_name = 'BANK MILLENIUM';
|
||||
$ba_swift = 'BIGBPLPW';
|
||||
}
|
||||
|
||||
if ($focus->currency_id=='98b2b752-b0be-37c2-d2eb-511e29f81cab'){
|
||||
// usd
|
||||
$ba_number = 'PL 49 1160 2202 0000 0000 6408 0741';
|
||||
$ba_name = 'BANK MILLENIUM';
|
||||
$ba_swift = 'BIGBPLPW';
|
||||
}
|
||||
if ($focus->parent_id=='75de804b-4dad-854f-5e6f-533e81e6289c'){
|
||||
// usd
|
||||
$ba_number = 'PL 48 1160 2244 7107 0000 0000 3020';
|
||||
$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>
|
||||
';
|
||||
93
modules/EcmInvoiceOuts/PDFTemplate/tpl/footer-pl_pl.php
Normal file
93
modules/EcmInvoiceOuts/PDFTemplate/tpl/footer-pl_pl.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
$w = "62"; //first column width
|
||||
$w2 = "12"; //second column width
|
||||
//get bank information
|
||||
$a = new Account();
|
||||
$a->retrieve($focus->parent_id);
|
||||
|
||||
$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">
|
||||
PL525273990
|
||||
</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>
|
||||
';
|
||||
23
modules/EcmInvoiceOuts/PDFTemplate/tpl/header.php
Normal file
23
modules/EcmInvoiceOuts/PDFTemplate/tpl/header.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
if($focus->type=='normal')$text='Faktura nr';
|
||||
if($focus->type=='correct')$text='Faktura korygująca nr';
|
||||
|
||||
$header = '
|
||||
<table style="font-size: 8pt; width: 100%"><tr>
|
||||
<td width="35%" style="text-align: left; vertical-align: top;">
|
||||
<b>SPRZEDAWCA</b><br />
|
||||
e5 Polska Sp. z o. o.<br />
|
||||
ul. Wąwozowa 11<br />
|
||||
02-796 Warszawa<br />
|
||||
NIP: 5252173990<br>
|
||||
BDO: 000036962
|
||||
</td>
|
||||
<td style="text-align: left; vertical-align: middle;"><p style="text-align: center;font-size: 12pt;"><b>'.$text.' '.$focus->document_no.'</b></p>
|
||||
</td>
|
||||
|
||||
<td width="15%">
|
||||
<img style="width: 70px;" src="modules/EcmDocumentTemplates/files/13899e0f-321c-229a-aa3e-48be4a1532c1.png"/>
|
||||
</td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
';
|
||||
25
modules/EcmInvoiceOuts/PDFTemplate/tpl/header_en.php
Normal file
25
modules/EcmInvoiceOuts/PDFTemplate/tpl/header_en.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
if($focus->type=='normal')$text='Faktura/Invoice';
|
||||
if($focus->type=='correct')$text='Faktura korygująca nr/Correct Invoice';
|
||||
|
||||
$header = '
|
||||
<table style="font-size: 8pt; width: 100%"><tr>
|
||||
|
||||
<td width="35%" style="text-align: left; vertical-align: top;">
|
||||
<b>SPRZEDAWCA / SELLER
|
||||
</b><br />
|
||||
e5 Polska Sp. z o. o.<br />
|
||||
ul. Wąwozowa 11<br />
|
||||
02-796 Warszawa<br />
|
||||
NIP: PL5252173990<br>
|
||||
BDO: 000036962
|
||||
</td>
|
||||
</td>
|
||||
<td style="text-align: left; vertical-align: middle;"><p style="text-align: center;font-size: 12pt;"><b>'.$text.' '.$focus->document_no.'</b></p>
|
||||
</td>
|
||||
<td width="15%">
|
||||
<img style="width: 70px;" src="modules/EcmDocumentTemplates/files/13899e0f-321c-229a-aa3e-48be4a1532c1.png"/>
|
||||
</td>
|
||||
</tr></table>
|
||||
<hr>
|
||||
';
|
||||
Reference in New Issue
Block a user