Add php files
This commit is contained in:
77
modules/EcmDocumentTemplates/templates/E/footer.php
Executable file
77
modules/EcmDocumentTemplates/templates/E/footer.php
Executable file
@@ -0,0 +1,77 @@
|
||||
<?
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetY($this->fh-15);
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->SetFillColor(255,255,255);
|
||||
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Cell(0, 10, $this->PageNo().'/{nb}');
|
||||
|
||||
$this->Ln(5);
|
||||
$this->AliasNbPages();
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->getBreakLine()-16,$this->fw-$this->rMargin,$this->fh-$this->bMargin-16+1);
|
||||
|
||||
|
||||
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->SetXY($this->lMargin,$this->fh-$this->bMargin+3-16);
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,$this->edt->footer_account);
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'KRS: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->footer_krs,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,$this->edt->footer_address);
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'NIP: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->footer_nip,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,$this->edt->footer_phone);
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'REGON: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->footer_regon,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,$this->edt->footer_fax);
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'Bank: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->footer_bankname,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,'www.e5.pl');
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'Numer konta: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->account_number,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,'');
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'Numer GIOS: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,"E0006254W",0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont("arialpl","B",8);
|
||||
$this->SetXY(40,$this->GetY()+1);
|
||||
$r=mysql_fetch_array(mysql_query("select document_no from ".strtolower($_REQUEST['module'])." where id='".$_REQUEST['record']."'"));
|
||||
$this->Cell(45,4,$r['document_no'],0,0,'L');
|
||||
?>
|
||||
17
modules/EcmDocumentTemplates/templates/E/header.back.php
Executable file
17
modules/EcmDocumentTemplates/templates/E/header.back.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//logo
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
|
||||
if(file_exists($this->edt->logo_path))
|
||||
$this->Image($this->edt->logo_path,$this->rMargin+132,$this->tMargin,0,18.3);
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->lMargin,$this->tMargin+3);
|
||||
$this->MultiCell(100,3.15,$this->edt->header_text,0,'L');
|
||||
|
||||
$this->SetY(32);
|
||||
?>
|
||||
20
modules/EcmDocumentTemplates/templates/E/header.php
Executable file
20
modules/EcmDocumentTemplates/templates/E/header.php
Executable file
@@ -0,0 +1,20 @@
|
||||
<?
|
||||
error_reporting(0);
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->lMargin,$this->tMargin+2);
|
||||
//$this->MultiCell(100,3.15,$this->edt->header_text.'
|
||||
//'.translate('LBL_PDF_NIP',$module_t).': '.$nip,0,'L');
|
||||
//$this->MultiCell(100,4,"Wystawca:\n".$this->edt->header_text,0,'L');
|
||||
|
||||
//logo
|
||||
//$this->MultiCell(80,7,$this->edt->logo_path."mmm",0,'C');
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '' && file_exists($this->edt->logo_path)){
|
||||
$this->Image($this->edt->logo_path,$this->lMargin,$this->tMargin+5,0,12.3);
|
||||
}
|
||||
|
||||
?>
|
||||
38
modules/EcmDocumentTemplates/templates/E/subfooter.php
Executable file
38
modules/EcmDocumentTemplates/templates/E/subfooter.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?
|
||||
|
||||
|
||||
|
||||
//payment conditions
|
||||
if(!empty($this->ecmpaymentcondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmpaymentcondition_text,0,'L');
|
||||
}
|
||||
|
||||
//delivery conditions
|
||||
if(!empty($this->ecmdeliverycondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmdeliverycondition_text,0,'L');
|
||||
}
|
||||
|
||||
|
||||
//footer text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
/*
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
|
||||
*/
|
||||
?>
|
||||
235
modules/EcmDocumentTemplates/templates/E/subheader.back.php
Executable file
235
modules/EcmDocumentTemplates/templates/E/subheader.back.php
Executable file
@@ -0,0 +1,235 @@
|
||||
<?
|
||||
$pdf->Ln(2);
|
||||
|
||||
|
||||
//to address
|
||||
|
||||
$address = $this->parent_name;
|
||||
if($this->parent_contact_name) {
|
||||
$address .= "\n".$this->parent_contact_name;
|
||||
if($this->parent_contact_title) $address .= "\n".$this->parent_contact_title;
|
||||
}
|
||||
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
|
||||
|
||||
if($this->parent_address_postalcode) $address .= "\n".$this->parent_address_postalcode;
|
||||
|
||||
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
|
||||
|
||||
if($this->to_vatid) $address .= "\n\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
|
||||
|
||||
$pdf->SetFont('arialpl', '', 10);
|
||||
|
||||
$pdf->Ln(2);
|
||||
$current = $pdf->GetY();
|
||||
//$pdf->MultiCell(0,4,$address,0,'L');
|
||||
$current2 = $pdf->GetY();
|
||||
|
||||
//$current = $pdf->GetY();
|
||||
//$pdf->Ln(7);
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-30,$current);
|
||||
$table = array();
|
||||
$table [0]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [1]['data'] = array('width' => 30, 'value' => $this->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [2]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [3]['data'] = array('width' => 30, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
|
||||
$next = 4;
|
||||
if(isset($this->validtill_date) && $this->validtill_date != '') {
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_VALIDTILL_DATE'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $this->validtill_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
}
|
||||
if($this->correct_id){
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_CORRECT_TO'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$r=mysql_fetch_array(mysql_query("select document_no from ecmstockdocins where id='".$this->correct_id."'"));
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $r['document_no'], 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
}
|
||||
|
||||
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
$pdf->SetY($current2);
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','22');
|
||||
|
||||
$pdf->SetY(45);
|
||||
$pdf->SetX(65);
|
||||
if($this->correct_id) $pdf->MultiCell(90,10,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT'],70,'C');
|
||||
else $pdf->MultiCell(90,10,$mod_strings['LBL_PDF_DOCUMENT_NAME'],70,'C');
|
||||
|
||||
$yaftername=$pdf->GetY()+7;
|
||||
if($this->correct_id)$yaftername+=7;
|
||||
|
||||
|
||||
if(isset($this->validtill_date) && $this->validtill_date != '') $pdf->Ln(9);
|
||||
|
||||
|
||||
$this->loadParser();
|
||||
|
||||
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(20);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->SetY(36);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_QUOTE_FOR'],0,'J');
|
||||
$pdf->Ln(1);
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
$pdf->MultiCell(0,4,$address,0,'J');
|
||||
|
||||
|
||||
|
||||
$pdf->Ln(20);
|
||||
$pdf->SetY($yaftername);
|
||||
|
||||
|
||||
|
||||
|
||||
global $mod_strings;
|
||||
if(!isset($this->position_list) || !is_array($this->position_list))
|
||||
$this->position_list = $this->getPositionList(true);
|
||||
$calc = $this->calculate($this->position_list,true);
|
||||
$this->position_list = $this->formatPositions($this->position_list);
|
||||
|
||||
$calc['total'] .= ' '.$this->currency_symbol;
|
||||
$calc['subtotal'] .= ' '.$this->currency_symbol;
|
||||
if($calc['discount']) {
|
||||
$calc['total2'] .= ' '.$this->currency_symbol;
|
||||
$calc['discount']['value'] .= ' '.$this->currency_symbol;
|
||||
}
|
||||
|
||||
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
|
||||
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
|
||||
|
||||
|
||||
|
||||
$name_w = 42;
|
||||
$image_w = 10;
|
||||
$recipient_code_w = 10;
|
||||
|
||||
if($this->show_images_on_offers){
|
||||
$name_w -= $image_w;
|
||||
}
|
||||
if($this->show_recipient_code){
|
||||
$name_w -= $recipient_code_w;
|
||||
}
|
||||
|
||||
if($calc['draw_discount']){
|
||||
$name_w -= 8;
|
||||
}
|
||||
if($calc['draw_vat']){
|
||||
$name_w -= 8;
|
||||
}
|
||||
|
||||
$table = array();
|
||||
if($this->show_images_on_offers)
|
||||
$table [0]['image'] = array('width' => $image_w, 'value' => $mod_strings['LBL_PDF_LIST_IMAGE'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
|
||||
$table [0]['position'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['code'] = array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_CODE'],'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
if($this->show_recipient_code)
|
||||
$table [0]['recipient_code'] = array('width' => $recipient_code_w, 'value' => $mod_strings['LBL_PDF_LIST_RECIPIENT_CODE'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
//$table [0]['unit'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'],'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['description'] = array('width' => $name_w, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['quantity'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'],'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['unit'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'], 'border' => 0,'background' => array(233,233,233), 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['unit_price'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
if($calc['draw_discount']) $table [0]['discount'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_DISCOUNT'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
|
||||
if($calc['draw_vat']) $table [0]['vat_id'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_VAT'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
|
||||
$table [0]['total'] = array('width' => 14, 'value' => "Suma netto", 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
|
||||
|
||||
$i = 1;
|
||||
$lv=return_app_list_strings_language($this->ecmlanguage);
|
||||
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
if($this->show_images_on_offers){
|
||||
if(file_exists($this->getProductImage($p['id']))){$table [$i]['image'] = array('width' => $image_w, 'value' => '', 'border' => 0, 'align' => 'R', 'image_path' => $this->getProductImage($p['id']));
|
||||
//$iarr[]=$this->getProductImage($p['id']);
|
||||
}
|
||||
else $table [$i]['image'] = array('width' => $image_w, 'value' => '', 'border' => 0, 'align' => 'R');
|
||||
}
|
||||
$table [$i]['position'] = array('width' => 5, 'value' => $i, 'border' => 0, 'align' => 'C', );
|
||||
$table [$i]['code'] = array('width' => 12, 'value' => $p['code'], 'border' => 0, 'align' => 'C', );
|
||||
if($this->show_recipient_code)
|
||||
$table [$i]['recipient_code'] = array('width' => $recipient_code_w, 'value' => $p['recipient_code'], 'border' => 0, 'align' => 'C', );
|
||||
//$table [$i]['unit'] = array('width' => 10, 'value' => $p['unit_id'], 'border' => 0, 'align' => 'C', );
|
||||
|
||||
/*
|
||||
if($this->ecmlanguage=="en_us"){
|
||||
$r=mysql_fetch_array(mysql_query("select short_description from ecmproduct_language_en_view where ecmproduct_id='".$p['id']."'"));
|
||||
$dname=$r['short_description'];
|
||||
}
|
||||
elseif($this->ecmlanguage=="ge_ge"){
|
||||
$r=mysql_fetch_array(mysql_query("select short_description from ecmproduct_language_de_view where ecmproduct_id='".$p['id']."'"));
|
||||
$dname=$r['short_description'];
|
||||
}
|
||||
else $dname=$p['name'];
|
||||
*/
|
||||
|
||||
$table [$i]['description'] = array('width' => $name_w, 'value' => htmlspecialchars_decode($p['name']), 'border' => 0, 'align' => 'L', );
|
||||
$table [$i]['quantity'] = array('width' => 8, 'value' => $p['quantity'], 'border' => 0, 'align' => 'C', );
|
||||
$table [$i]['unit'] = array('width' => 5, 'value' => $lv['ecmproducts_unit_dom'][$p['unit_id']], 'border' => 0, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit_price'] = array('width' => 14, 'value' => $p['price'], 'border' => 0, 'align' => 'C', );
|
||||
if($calc['draw_discount']) $table [$i]['discount'] = array('width' => 8, 'value' => $p['discount'], 'border' => 0, 'align' => 'R', );
|
||||
if($calc['draw_vat']) $table [$i]['vat_id'] = array('width' => 8, 'value' => $p['vat_name'], 'border' => 0, 'align' => 'R', );
|
||||
$table [$i]['total'] = array('width' => 14, 'value' => $p['total'], 'border' => 0, 'align' => 'R', );
|
||||
$i++;
|
||||
}
|
||||
$starttab=$pdf->GetY()+10;
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$endtab=$pdf->GetY();
|
||||
//for($n=0;$n<$i;$n++){
|
||||
//if(file_exists($iarr[$n]))$pdf->Image($iarr[$n],$pdf->GetX()+1,$starttab+$n*18+1,15,0);
|
||||
//}
|
||||
$pdf->SetY($endtab);
|
||||
//total, vat, subtotal
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
|
||||
//$pdf->SetX($pdf->fw-$pdf->rMargin-$pr*34);
|
||||
$table = array();
|
||||
|
||||
if($calc['vats']) {
|
||||
$table [] = array(
|
||||
'subtotal1' => array('width' => 66, 'value' => "Suma netto", 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9),
|
||||
'subtotal2' => array('width' => 34, 'value' => $calc['subtotal'], 'border' => 0, 'overflow' => 1, 'align' => 'R', 'font-size' => 9), );
|
||||
|
||||
foreach($calc['vats'] as $key => $value){
|
||||
$r=mysql_fetch_array(mysql_query("select name from ecmvats where id='".$key."'"));
|
||||
$vvn=$r['name'];
|
||||
$table [] = array(
|
||||
'vat1' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_VAT'].' ('.$vvn.')', 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9),
|
||||
'vat2' => array('width' => 34, 'value' => $value, 'border' => 0, 'overflow' => 1, 'align' => 'R', 'font-size' => 9), );
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($calc['discount'])) {
|
||||
$table [] = array(
|
||||
'total21' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
|
||||
'total22' => array('width' => 34, 'value' => $calc['total2'], 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 9), );
|
||||
$table [] = array(
|
||||
'discount1' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_DISCOUNT'].' '.$calc['discount']['procent'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
|
||||
'discount2' => array('width' => 34, 'value' => $calc['discount']['value'], 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 9), );
|
||||
}
|
||||
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 66, 'value' => "Suma brutto", 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
|
||||
'total2' => array('width' => 34, 'value' => $calc['total'], 'border' => 0, 'background' => array(233,233,233), 'overflow' => 1, 'align' => 'R' , 'font-size' => 9, 'font-style' => 'b'), );
|
||||
|
||||
$pdf->DrawTable($table);
|
||||
?>
|
||||
191
modules/EcmDocumentTemplates/templates/E/subheader.php
Executable file
191
modules/EcmDocumentTemplates/templates/E/subheader.php
Executable file
@@ -0,0 +1,191 @@
|
||||
<?
|
||||
global $app_list_strings;
|
||||
|
||||
|
||||
$address = str_replace("<","<",str_replace(">",">",$this->parent_name));
|
||||
if($this->parent_contact_name) {
|
||||
$address .= "\n".$this->parent_contact_name;
|
||||
if($this->parent_contact_title) {
|
||||
$address .= "\n".$this->parent_contact_title;
|
||||
}
|
||||
$personplus=5;
|
||||
}
|
||||
else $personplus=0;
|
||||
|
||||
if($this->parent_address_street) $address .= "\n".str_replace("\n","",$this->parent_address_street);
|
||||
if($this->parent_address_postalcode) $address .= "\n".$this->parent_address_postalcode;
|
||||
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
|
||||
if($this->to_nip) $address .= "\n".$mod_strings['LBL_PDF_NIP'].": ".$this->to_nip;
|
||||
elseif(!$this->to_nip && $this->to_vatid) $address .= "\n".$mod_strings['LBL_PDF_NIP'].": ".$this->to_vatid;
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iln from accounts where id='".$this->parent_id."'"));
|
||||
if($r['iln'])$address .= "\nILN: ".$r['iln'];
|
||||
|
||||
//to address
|
||||
$old_x=$pdf->GetX();
|
||||
$old_y=$pdf->GetY();
|
||||
|
||||
$pdf->SetXY(25,37);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35,1,"WYSTAWCA:",0,0,'L',1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(25);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select vatid from accounts where id='".$pdf->edt->account_id."'"));
|
||||
if($r['vatid'])$pdf->edt->header_text .= "\nNip: ".$r['vatid'];
|
||||
if($r['iln'])$pdf->edt->header_text .= "\nILN: ".$r['iln'];
|
||||
$pdf->MultiCell(60,4,$pdf->edt->header_text,0,'L');
|
||||
|
||||
$pdf->SetXY(81,37);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35,1,"ODBIORCA:",0,0,'L',1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(81);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$pdf->MultiCell(60,4,$address,0,'L');
|
||||
|
||||
|
||||
$pdf->SetXY(160,$old_y+10+$personplus);
|
||||
|
||||
$table = array();
|
||||
|
||||
$table [1]['date_reg'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [1]['date_reg_value'] = array('width' => 36, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
$table [2]['date_end'] = array('width' => 20, 'value' => "Data zakonczenia", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [2]['date_end_value'] = array('width' => 36, 'value' => $this->end_date, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$table [3]['data'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [3]['data_value'] = array('width' => 36, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$rs=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select name from ecmstocks where id='".$this->pw_stock_id."'"));
|
||||
$table [4]['pw'] = array('width' => 20, 'value' => "Magazyn dokumentu PW", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [4]['pw_value'] = array('width' => 36, 'value' => $rs['name'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$rs=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select name from ecmstocks where id='".$this->rw_stock_id."'"));
|
||||
$table [5]['rw'] = array('width' => 20, 'value' => "Magazyn dokumentu RW", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [5]['rw_value'] = array('width' => 36, 'value' => $rs['name'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$emp=str_replace("|","
|
||||
",$this->employers);
|
||||
$table [6]['data'] = array('width' => 20, 'value' => "Osoby", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [6]['data_value'] = array('width' => 36, 'value' => $emp, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$pdf->SetXY(143,$pdf->tMargin);
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
|
||||
$pdf->Ln(9);
|
||||
|
||||
$pdf->SetFont('arialpl','','18');
|
||||
$pdf->SetXY(60,$pdf->tMargin+10);
|
||||
|
||||
$pdf->MultiCell(80,7,$mod_strings['LBL_PDF_DOCUMENT_NAME']." ".$this->document_no,0,'C');
|
||||
$pdf->SetFont('arialpl', 'B', 7);
|
||||
$pdf->Ln(3);
|
||||
|
||||
$this->loadParser();
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
$pdf->SetY($ynew);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$pdf->SetFont('arialpl','','7');
|
||||
global $mod_strings;
|
||||
|
||||
|
||||
$currency = new Currency();
|
||||
$currency->retrieve($this->currency_id);
|
||||
$this->currency_symbol=$currency->iso4217;
|
||||
|
||||
if(!isset($this->position_list) || !is_array($this->position_list))
|
||||
$this->position_list = $this->getPositionList(true);
|
||||
$calc = $this->calculate($this->position_list,true);
|
||||
|
||||
$calc['total'] .= ' '.$this->currency_symbol;
|
||||
$calc['subtotal'] .= ' '.$this->currency_symbol;
|
||||
if($calc['discount']) {
|
||||
$calc['total2'] .= ' '.$this->currency_symbol;
|
||||
$calc['discount']['value'] .= ' '.$this->currency_symbol;
|
||||
}
|
||||
|
||||
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
|
||||
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
|
||||
|
||||
|
||||
|
||||
$pdf->Ln(7);
|
||||
$name_w = 41;
|
||||
$table = array();
|
||||
|
||||
$table [0]['position'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['code'] = array('width' => 12, 'value' => "Index", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['description'] = array('width' => $name_w, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'], 'border' => 1, 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['quantity'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'], 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['prod_quantity'] = array('width' => 8, 'value' => "Il. prod", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['unit_price'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'], 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['total'] = array('width' => 14, 'value' => "Suma netto", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'R');
|
||||
$pdf->SetY(60);
|
||||
if($this->header_text){
|
||||
$pdf->MultiCell(80,4,$this->header_text,0,'L');$pdf->Ln();
|
||||
}
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
$table=array();
|
||||
$i = 1;
|
||||
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
if($p['component']!=1){
|
||||
$no++;
|
||||
$n=$no;
|
||||
$up=format_number($p['price']).' '.$this->currency_symbol;
|
||||
$tot=format_number($p['total']).' '.$this->currency_symbol;
|
||||
}
|
||||
else {
|
||||
$n="";
|
||||
$up="";
|
||||
$tot="";
|
||||
}
|
||||
if($p['prod_quantity']==0)$pq="";
|
||||
else $pq=$p['prod_quantity'];
|
||||
$table [$i]['position'] = array('width' => 5, 'value' => $n, 'border' => 1, 'align' => 'C', );
|
||||
$table [$i]['code'] = array('width' => 12, 'value' => $p['code'], 'border' => 1, 'align' => 'C', );
|
||||
$table [$i]['description'] = array('width' => $name_w, 'value' => htmlspecialchars_decode($p['name']), 'border' => 1, 'align' => 'L', );
|
||||
$table [$i]['quantity'] = array('width' => 8, 'value' => $p['quantity'], 'border' => 1, 'align' => 'C', );
|
||||
$table [$i]['prod_quantity'] = array('width' => 8, 'value' => $pq, 'border' => 1, 'align' => 'C', );
|
||||
$table [$i]['unit_price'] = array('width' => 14, 'value' => $up, 'border' => 1, 'align' => 'C');
|
||||
$table [$i]['total'] = array('width' => 14, 'value' => $tot, 'border' => 1, 'align' => 'R', );
|
||||
$i++;
|
||||
}
|
||||
$pdf->DrawTable($table,array(0));
|
||||
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
|
||||
$table = array();
|
||||
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 16,'font-style' => 'b', 'value' => "Suma netto",'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
|
||||
'total2' => array('width' => 28, 'value' => $calc['total'], 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 9, 'font-style' => 'b'),
|
||||
);
|
||||
|
||||
if($pdf->GetY()+30>$pdf->fh-$pdf->bMargin)$pdf->AddPage();
|
||||
$pdf->SetX(124);
|
||||
$pdf->DrawTable($table);
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->Cell(85,1,".........................................................",0,0,'L',1);
|
||||
$pdf->Cell(85,1,".........................................................",0,0,'R',1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetFont('arialpl','','5');
|
||||
$pdf->Cell(85,1," (podpis produkujacego)",0,0,'L',1);
|
||||
$pdf->Cell(85,1,"(podpis kontrolujacego) ",0,0,'R',1);
|
||||
|
||||
?>
|
||||
31
modules/EcmDocumentTemplates/templates/EcmDeliveryNotes/e5/footer.php
Executable file
31
modules/EcmDocumentTemplates/templates/EcmDeliveryNotes/e5/footer.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetY($this->fh-15);
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->SetFillColor(255,255,255);
|
||||
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Cell(0, 10, $this->PageNo().'/{nb}');
|
||||
|
||||
$this->Ln(5);
|
||||
$this->AliasNbPages();
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->getBreakLine(),$this->fw-$this->rMargin,$this->fh-$this->bMargin+1);
|
||||
|
||||
|
||||
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
|
||||
// $this->bMargin = 3;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin);
|
||||
return;
|
||||
} else {
|
||||
// $this->bMargin = 19;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin+$this->tMarign+5);
|
||||
}
|
||||
|
||||
$this->SetFont('arialpl','','8');
|
||||
$this->SetXY($this->lMargin+10,$this->fh-$this->bMargin+3);
|
||||
$this->MultiCell($this->fw-$this->lMargin-$this->rMargin-20,4,$this->edt->footer_text,0,'C');
|
||||
?>
|
||||
17
modules/EcmDocumentTemplates/templates/EcmDeliveryNotes/e5/header.php
Executable file
17
modules/EcmDocumentTemplates/templates/EcmDeliveryNotes/e5/header.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//logo
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
|
||||
if(file_exists($this->edt->logo_path))
|
||||
$this->Image($this->edt->logo_path,$this->rMargin+132,$this->tMargin,0,18.3);
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->lMargin,$this->tMargin+3);
|
||||
$this->MultiCell(100,3.15,$this->edt->header_text,0,'L');
|
||||
|
||||
$this->SetY(32);
|
||||
?>
|
||||
37
modules/EcmDocumentTemplates/templates/EcmDeliveryNotes/e5/subfooter.php
Executable file
37
modules/EcmDocumentTemplates/templates/EcmDeliveryNotes/e5/subfooter.php
Executable file
@@ -0,0 +1,37 @@
|
||||
<?
|
||||
|
||||
|
||||
|
||||
//payment conditions
|
||||
/*if(!empty($this->ecmpaymentcondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmpaymentcondition_text,0,'L');
|
||||
}*/
|
||||
|
||||
//delivery conditions
|
||||
/*if(!empty($this->ecmdeliverycondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmdeliverycondition_text,0,'L');
|
||||
}*/
|
||||
|
||||
|
||||
//footer text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
|
||||
|
||||
|
||||
|
||||
//ads text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
|
||||
?>
|
||||
91
modules/EcmDocumentTemplates/templates/EcmDeliveryNotes/e5/subheader.php
Executable file
91
modules/EcmDocumentTemplates/templates/EcmDeliveryNotes/e5/subheader.php
Executable file
@@ -0,0 +1,91 @@
|
||||
<?
|
||||
$pdf->Ln(2);
|
||||
|
||||
|
||||
//to address
|
||||
|
||||
$address = $this->parent_name;
|
||||
if($this->parent_contact_name) {
|
||||
$address .= "\n".$this->parent_contact_name;
|
||||
if($this->parent_contact_title) $address .= "\n".$this->parent_contact_title;
|
||||
}
|
||||
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
|
||||
|
||||
if($this->parent_address_postalcode) $address .= "\n".$this->parent_address_postalcode;
|
||||
|
||||
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
|
||||
|
||||
if($this->to_vatid) $address .= "\n\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
|
||||
|
||||
$pdf->SetFont('arialpl', '', 10);
|
||||
|
||||
$pdf->Ln(2);
|
||||
$current = $pdf->GetY();
|
||||
$pdf->MultiCell(0,4,$address,0,'L');
|
||||
$current2 = $pdf->GetY();
|
||||
|
||||
//$current = $pdf->GetY();
|
||||
//$pdf->Ln(7);
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-20,$current);
|
||||
$table = array();
|
||||
$table [0]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [1]['data'] = array('width' => 30, 'value' => $this->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [2]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [3]['data'] = array('width' => 30, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
|
||||
$next = 4;
|
||||
if(isset($this->validtill_date) && $this->validtill_date != '') {
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_VALIDTILL_DATE'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $this->validtill_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
}
|
||||
if(isset($this->delivery_date) && $this->delivery_date != '') {
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => "Data dostawy", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $this->delivery_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
}
|
||||
|
||||
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
$pdf->SetY($current2);
|
||||
|
||||
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','16');
|
||||
|
||||
$pdf->SetY(55);
|
||||
if($this->type=="sales_order")$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME'],0,'C');
|
||||
elseif($this->type=="back")$pdf->MultiCell(0,3,"Zwrot Towaru",0,'C');
|
||||
elseif($this->type=="serwis_back")$pdf->MultiCell(0,3,"Zwrot Serwisowy",0,'C');
|
||||
elseif($this->type=="gratis")$pdf->MultiCell(0,3,"Gratis",0,'C');
|
||||
else $pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME'],0,'C');
|
||||
|
||||
|
||||
if(isset($this->validtill_date) && $this->validtill_date != '') $pdf->Ln(9);
|
||||
|
||||
|
||||
$this->loadParser();
|
||||
|
||||
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->header_text,0,'J');
|
||||
|
||||
|
||||
|
||||
$pdf->Ln(4);
|
||||
?>
|
||||
31
modules/EcmDocumentTemplates/templates/EcmDeliveryNotes/saascrm/footer.php
Executable file
31
modules/EcmDocumentTemplates/templates/EcmDeliveryNotes/saascrm/footer.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetY($this->fh-15);
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->SetFillColor(255,255,255);
|
||||
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Cell(0, 10, $this->PageNo().'/{nb}');
|
||||
|
||||
$this->Ln(5);
|
||||
$this->AliasNbPages();
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->getBreakLine(),$this->fw-$this->rMargin,$this->fh-$this->bMargin+1);
|
||||
|
||||
|
||||
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
|
||||
// $this->bMargin = 3;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin);
|
||||
return;
|
||||
} else {
|
||||
// $this->bMargin = 19;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin+$this->tMarign+5);
|
||||
}
|
||||
|
||||
$this->SetFont('arialpl','','8');
|
||||
$this->SetXY($this->lMargin+10,$this->fh-$this->bMargin+3);
|
||||
$this->MultiCell($this->fw-$this->lMargin-$this->rMargin-20,4,$this->edt->footer_text,0,'C');
|
||||
?>
|
||||
32
modules/EcmDocumentTemplates/templates/EcmDeliveryNotes/saascrm/header.php
Executable file
32
modules/EcmDocumentTemplates/templates/EcmDeliveryNotes/saascrm/header.php
Executable file
@@ -0,0 +1,32 @@
|
||||
<?
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->fw-100-$this->rMargin,$this->tMargin);
|
||||
$this->MultiCell(100,3.15,$this->edt->header_text,0,'R');
|
||||
//logo
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
|
||||
if(file_exists($this->edt->logo_path))
|
||||
$this->Image($this->edt->logo_path,$this->lMargin,$this->tMargin,0,22.3);
|
||||
|
||||
/*
|
||||
//line
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->tMargin-1,$this->fw-$this->rMargin,$this->tMargin-1);
|
||||
*/
|
||||
//if($this->GetY() < $this->tMargin) $this->SetY($this->tMargin); else
|
||||
|
||||
$this->Ln(6);
|
||||
if($this->page == 1)
|
||||
if($this->edt->address) {
|
||||
$this->Ln(9);
|
||||
$this->SetFont('arialpl', 'u', 8);
|
||||
$this->SetX($this->lMargin);
|
||||
$this->MultiCell(0,3.15,$this->edt->address,0,'L');
|
||||
$this->Ln(5);
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?
|
||||
|
||||
|
||||
|
||||
//payment conditions
|
||||
if(!empty($this->ecmpaymentcondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmpaymentcondition_text,0,'L');
|
||||
}
|
||||
|
||||
//delivery conditions
|
||||
if(!empty($this->ecmdeliverycondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmdeliverycondition_text,0,'L');
|
||||
}
|
||||
|
||||
|
||||
//footer text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
|
||||
?>
|
||||
@@ -0,0 +1,99 @@
|
||||
<?
|
||||
/*
|
||||
$pdf->Ln(10);
|
||||
|
||||
//$this->SetY($this->tMargin);
|
||||
|
||||
//from address
|
||||
|
||||
$this->template->setAccount();
|
||||
|
||||
$address = $this->template->account->name;
|
||||
|
||||
if($this->template->account->billing_address_street) $address .= " - ".$this->template->account->billing_address_street;
|
||||
|
||||
if($this->template->account->billing_address_postalcode) $address .= " - ".$this->template->account->billing_address_postalcode;
|
||||
|
||||
if($this->template->account->billing_address_city) $address .= " ".$this->template->account->billing_address_city;
|
||||
|
||||
$pdf->SetFont('arialpl', 'u', 8);
|
||||
*/
|
||||
$pdf->Ln(2);
|
||||
|
||||
//$pdf->MultiCell(0,5,$address,0,'L');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//to address
|
||||
|
||||
$address = $this->parent_name;
|
||||
if($this->parent_contact_name) {
|
||||
$address .= "\n".$this->parent_contact_name;
|
||||
if($this->parent_contact_title) $address .= "\n".$this->parent_contact_title;
|
||||
}
|
||||
|
||||
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
|
||||
|
||||
if($this->parent_address_postalcode) $address .= "\n\n".$this->parent_address_postalcode;
|
||||
|
||||
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
|
||||
|
||||
if($this->to_vatid) $address .= "\n\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
|
||||
|
||||
$pdf->SetFont('arialpl', '', 10);
|
||||
|
||||
$pdf->Ln(2);
|
||||
$current = $pdf->GetY();
|
||||
$pdf->MultiCell(0,4,$address,0,'L');
|
||||
$current2 = $pdf->GetY();
|
||||
|
||||
// $pdf->Ln(7);
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-20,$current);
|
||||
$table = array();
|
||||
$table [0]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [1]['data'] = array('width' => 30, 'value' => $this->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [2]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [3]['data'] = array('width' => 30, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [4]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [5]['data'] = array('width' => 30, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
$pdf->SetY($current2);
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','24');
|
||||
|
||||
$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME'],0,'L');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$this->loadParser();
|
||||
|
||||
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->header_text,0,'J');
|
||||
|
||||
|
||||
|
||||
$pdf->Ln(10);
|
||||
?>
|
||||
31
modules/EcmDocumentTemplates/templates/EcmDocuments/e5/footer.php
Executable file
31
modules/EcmDocumentTemplates/templates/EcmDocuments/e5/footer.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetY($this->fh-15);
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->SetFillColor(255,255,255);
|
||||
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Cell(0, 10, $this->PageNo().'/{nb}');
|
||||
|
||||
$this->Ln(5);
|
||||
$this->AliasNbPages();
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->getBreakLine(),$this->fw-$this->rMargin,$this->fh-$this->bMargin+1);
|
||||
|
||||
|
||||
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
|
||||
// $this->bMargin = 3;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin);
|
||||
return;
|
||||
} else {
|
||||
// $this->bMargin = 19;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin+$this->tMarign+5);
|
||||
}
|
||||
|
||||
$this->SetFont('arialpl','','8');
|
||||
$this->SetXY($this->lMargin+10,$this->fh-$this->bMargin+3);
|
||||
$this->MultiCell($this->fw-$this->lMargin-$this->rMargin-20,4,$this->edt->footer_text,0,'C');
|
||||
?>
|
||||
17
modules/EcmDocumentTemplates/templates/EcmDocuments/e5/header.php
Executable file
17
modules/EcmDocumentTemplates/templates/EcmDocuments/e5/header.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//logo
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
|
||||
if(file_exists($this->edt->logo_path))
|
||||
$this->Image($this->edt->logo_path,$this->rMargin+132,$this->tMargin,0,18.3);
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->lMargin,$this->tMargin+3);
|
||||
$this->MultiCell(100,3.15,$this->edt->header_text,0,'L');
|
||||
|
||||
$this->SetY(32);
|
||||
?>
|
||||
3
modules/EcmDocumentTemplates/templates/EcmDocuments/e5/subfooter.php
Executable file
3
modules/EcmDocumentTemplates/templates/EcmDocuments/e5/subfooter.php
Executable file
@@ -0,0 +1,3 @@
|
||||
<?
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
?>
|
||||
9
modules/EcmDocumentTemplates/templates/EcmDocuments/e5/subheader.php
Executable file
9
modules/EcmDocumentTemplates/templates/EcmDocuments/e5/subheader.php
Executable file
@@ -0,0 +1,9 @@
|
||||
<?
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->UseCSS(true);
|
||||
$pdf->noPPadding = true;
|
||||
$this->document_text = "<p></p>".$this->document_text;
|
||||
$this->document_text = str_replace(array("<", ">", """), array("<", ">", "\""), $this->document_text);
|
||||
$pdf->WriteHTML($this->getParsedDocumentText($this->document_text));
|
||||
?>
|
||||
31
modules/EcmDocumentTemplates/templates/EcmDocuments/saascrm/footer.php
Executable file
31
modules/EcmDocumentTemplates/templates/EcmDocuments/saascrm/footer.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetY($this->fh-15);
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->SetFillColor(255,255,255);
|
||||
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Cell(0, 10, $this->PageNo().'/{nb}');
|
||||
|
||||
$this->Ln(5);
|
||||
$this->AliasNbPages();
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->getBreakLine(),$this->fw-$this->rMargin,$this->fh-$this->bMargin+1);
|
||||
|
||||
|
||||
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
|
||||
// $this->bMargin = 3;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin);
|
||||
return;
|
||||
} else {
|
||||
// $this->bMargin = 19;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin+$this->tMarign+5);
|
||||
}
|
||||
|
||||
$this->SetFont('arialpl','','8');
|
||||
$this->SetXY($this->lMargin+10,$this->fh-$this->bMargin+3);
|
||||
$this->MultiCell($this->fw-$this->lMargin-$this->rMargin-20,4,$this->edt->footer_text,0,'C');
|
||||
?>
|
||||
34
modules/EcmDocumentTemplates/templates/EcmDocuments/saascrm/header.php
Executable file
34
modules/EcmDocumentTemplates/templates/EcmDocuments/saascrm/header.php
Executable file
@@ -0,0 +1,34 @@
|
||||
<?
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->fw-100-$this->rMargin,$this->tMargin);
|
||||
$this->MultiCell(100,3.15,$this->edt->header_text,0,'R');
|
||||
//logo
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
|
||||
if(file_exists($this->edt->logo_path))
|
||||
$this->Image($this->edt->logo_path,$this->lMargin,$this->tMargin,0,22.3);
|
||||
|
||||
/*
|
||||
//line
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->tMargin-1,$this->fw-$this->rMargin,$this->tMargin-1);
|
||||
*/
|
||||
//if($this->GetY() < $this->tMargin) $this->SetY($this->tMargin); else
|
||||
|
||||
/*
|
||||
$this->Ln(6);
|
||||
if($this->page == 1)
|
||||
if($this->edt->address) {
|
||||
$this->Ln(9);
|
||||
$this->SetFont('arialpl', 'u', 8);
|
||||
$this->SetX($this->lMargin);
|
||||
//$this->MultiCell(0,3.15,$this->edt->address,0,'L');
|
||||
$this->Ln(5);
|
||||
}
|
||||
*/
|
||||
?>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
?>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->UseCSS(true);
|
||||
$pdf->noPPadding = true;
|
||||
$this->document_text = "<p></p>".$this->document_text;
|
||||
$this->document_text = str_replace(array("<", ">", """), array("<", ">", "\""), $this->document_text);
|
||||
$pdf->WriteHTML($this->getParsedDocumentText($this->document_text));
|
||||
?>
|
||||
93
modules/EcmDocumentTemplates/templates/EcmInsideOrders/e5/footer.php
Executable file
93
modules/EcmDocumentTemplates/templates/EcmInsideOrders/e5/footer.php
Executable file
@@ -0,0 +1,93 @@
|
||||
<?
|
||||
error_reporting(0);
|
||||
|
||||
$r=mysql_fetch_array(mysql_query("select document_no, ecmlanguage from ".strtolower($_REQUEST['module'])." where id='".$_REQUEST['record']."'"));
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetY($this->fh-15);
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->SetFillColor(255,255,255);
|
||||
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Cell(0, 10, $this->PageNo().'/{nb}');
|
||||
|
||||
$this->Ln(5);
|
||||
$this->AliasNbPages();
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,-17-16+1,$this->fw-$this->rMargin,-17-16+1);
|
||||
|
||||
|
||||
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->SetXY($this->lMargin,-20-16);
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,$this->edt->footer_account);
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'Bank: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->footer_bankname,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
if ($r['ecmlanguage']=='pl_pl')
|
||||
$this->Cell(110,4,$this->edt->footer_address);
|
||||
else
|
||||
$this->Cell(110,4,$this->edt->footer_address.', Poland');
|
||||
$this->SetFont('arialpl','B','7');
|
||||
if ($r['ecmlanguage']=='pl_pl')
|
||||
$this->Cell(20,4,'Numer konta: ');
|
||||
else
|
||||
$this->Cell(20,4,'Bank IBAN: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->account_number,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,$this->edt->footer_phone);
|
||||
if ($r['ecmlanguage']=='pl_pl') {
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'Numer GIOS: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,"E0006254W",0,0,'L');
|
||||
} else {
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'Bank SWIFT: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,"BIGBPLPW",0,0,'L');
|
||||
}
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,$this->edt->footer_fax);
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'KRS: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->footer_krs,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,'www.e5.pl');
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'NIP: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->footer_nip,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,'');
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'REGON: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->footer_regon,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont("arialpl","B",8);
|
||||
$this->SetXY(40,$this->GetY()+1);
|
||||
|
||||
$this->Cell(45,4,$r['document_no'],0,0,'L');
|
||||
?>
|
||||
17
modules/EcmDocumentTemplates/templates/EcmInsideOrders/e5/header.back.php
Executable file
17
modules/EcmDocumentTemplates/templates/EcmInsideOrders/e5/header.back.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//logo
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
|
||||
if(file_exists($this->edt->logo_path))
|
||||
$this->Image($this->edt->logo_path,$this->rMargin+132,$this->tMargin,0,18.3);
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->lMargin,$this->tMargin+3);
|
||||
$this->MultiCell(100,3.15,$this->edt->header_text,0,'L');
|
||||
|
||||
$this->SetY(32);
|
||||
?>
|
||||
20
modules/EcmDocumentTemplates/templates/EcmInsideOrders/e5/header.php
Executable file
20
modules/EcmDocumentTemplates/templates/EcmInsideOrders/e5/header.php
Executable file
@@ -0,0 +1,20 @@
|
||||
<?
|
||||
error_reporting(0);
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->lMargin,$this->tMargin+2);
|
||||
//$this->MultiCell(100,3.15,$this->edt->header_text.'
|
||||
//'.translate('LBL_PDF_NIP',$module_t).': '.$nip,0,'L');
|
||||
//$this->MultiCell(100,4,"Wystawca:\n".$this->edt->header_text,0,'L');
|
||||
|
||||
//logo
|
||||
//$this->MultiCell(80,7,$this->edt->logo_path."mmm",0,'C');
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '' && file_exists($this->edt->logo_path)){
|
||||
$this->Image($this->edt->logo_path,$this->lMargin,$this->tMargin+5,0,12.3);
|
||||
}
|
||||
|
||||
?>
|
||||
38
modules/EcmDocumentTemplates/templates/EcmInsideOrders/e5/subfooter.php
Executable file
38
modules/EcmDocumentTemplates/templates/EcmInsideOrders/e5/subfooter.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?
|
||||
|
||||
|
||||
|
||||
//payment conditions
|
||||
if(!empty($this->ecmpaymentcondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmpaymentcondition_text,0,'L');
|
||||
}
|
||||
|
||||
//delivery conditions
|
||||
if(!empty($this->ecmdeliverycondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmdeliverycondition_text,0,'L');
|
||||
}
|
||||
|
||||
|
||||
//footer text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
/*
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
|
||||
*/
|
||||
?>
|
||||
235
modules/EcmDocumentTemplates/templates/EcmInsideOrders/e5/subheader.back.php
Executable file
235
modules/EcmDocumentTemplates/templates/EcmInsideOrders/e5/subheader.back.php
Executable file
@@ -0,0 +1,235 @@
|
||||
<?
|
||||
$pdf->Ln(2);
|
||||
|
||||
|
||||
//to address
|
||||
|
||||
$address = $this->parent_name;
|
||||
if($this->parent_contact_name) {
|
||||
$address .= "\n".$this->parent_contact_name;
|
||||
if($this->parent_contact_title) $address .= "\n".$this->parent_contact_title;
|
||||
}
|
||||
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
|
||||
|
||||
if($this->parent_address_postalcode) $address .= "\n".$this->parent_address_postalcode;
|
||||
|
||||
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
|
||||
|
||||
if($this->to_vatid) $address .= "\n\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
|
||||
|
||||
$pdf->SetFont('arialpl', '', 10);
|
||||
|
||||
$pdf->Ln(2);
|
||||
$current = $pdf->GetY();
|
||||
//$pdf->MultiCell(0,4,$address,0,'L');
|
||||
$current2 = $pdf->GetY();
|
||||
|
||||
//$current = $pdf->GetY();
|
||||
//$pdf->Ln(7);
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-30,$current);
|
||||
$table = array();
|
||||
$table [0]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [1]['data'] = array('width' => 30, 'value' => $this->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [2]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [3]['data'] = array('width' => 30, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
|
||||
$next = 4;
|
||||
if(isset($this->validtill_date) && $this->validtill_date != '') {
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_VALIDTILL_DATE'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $this->validtill_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
}
|
||||
if($this->correct_id){
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_CORRECT_TO'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$r=mysql_fetch_array(mysql_query("select document_no from ecmstockdocins where id='".$this->correct_id."'"));
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $r['document_no'], 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
}
|
||||
|
||||
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
$pdf->SetY($current2);
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','22');
|
||||
|
||||
$pdf->SetY(45);
|
||||
$pdf->SetX(65);
|
||||
if($this->correct_id) $pdf->MultiCell(90,10,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT'],70,'C');
|
||||
else $pdf->MultiCell(90,10,$mod_strings['LBL_PDF_DOCUMENT_NAME'],70,'C');
|
||||
|
||||
$yaftername=$pdf->GetY()+7;
|
||||
if($this->correct_id)$yaftername+=7;
|
||||
|
||||
|
||||
if(isset($this->validtill_date) && $this->validtill_date != '') $pdf->Ln(9);
|
||||
|
||||
|
||||
$this->loadParser();
|
||||
|
||||
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(20);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->SetY(36);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_QUOTE_FOR'],0,'J');
|
||||
$pdf->Ln(1);
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
$pdf->MultiCell(0,4,$address,0,'J');
|
||||
|
||||
|
||||
|
||||
$pdf->Ln(20);
|
||||
$pdf->SetY($yaftername);
|
||||
|
||||
|
||||
|
||||
|
||||
global $mod_strings;
|
||||
if(!isset($this->position_list) || !is_array($this->position_list))
|
||||
$this->position_list = $this->getPositionList(true);
|
||||
$calc = $this->calculate($this->position_list,true);
|
||||
$this->position_list = $this->formatPositions($this->position_list);
|
||||
|
||||
$calc['total'] .= ' '.$this->currency_symbol;
|
||||
$calc['subtotal'] .= ' '.$this->currency_symbol;
|
||||
if($calc['discount']) {
|
||||
$calc['total2'] .= ' '.$this->currency_symbol;
|
||||
$calc['discount']['value'] .= ' '.$this->currency_symbol;
|
||||
}
|
||||
|
||||
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
|
||||
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
|
||||
|
||||
|
||||
|
||||
$name_w = 42;
|
||||
$image_w = 10;
|
||||
$recipient_code_w = 10;
|
||||
|
||||
if($this->show_images_on_offers){
|
||||
$name_w -= $image_w;
|
||||
}
|
||||
if($this->show_recipient_code){
|
||||
$name_w -= $recipient_code_w;
|
||||
}
|
||||
|
||||
if($calc['draw_discount']){
|
||||
$name_w -= 8;
|
||||
}
|
||||
if($calc['draw_vat']){
|
||||
$name_w -= 8;
|
||||
}
|
||||
|
||||
$table = array();
|
||||
if($this->show_images_on_offers)
|
||||
$table [0]['image'] = array('width' => $image_w, 'value' => $mod_strings['LBL_PDF_LIST_IMAGE'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
|
||||
$table [0]['position'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['code'] = array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_CODE'],'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
if($this->show_recipient_code)
|
||||
$table [0]['recipient_code'] = array('width' => $recipient_code_w, 'value' => $mod_strings['LBL_PDF_LIST_RECIPIENT_CODE'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
//$table [0]['unit'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'],'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['description'] = array('width' => $name_w, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['quantity'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'],'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['unit'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'], 'border' => 0,'background' => array(233,233,233), 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['unit_price'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
if($calc['draw_discount']) $table [0]['discount'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_DISCOUNT'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
|
||||
if($calc['draw_vat']) $table [0]['vat_id'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_VAT'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
|
||||
$table [0]['total'] = array('width' => 14, 'value' => "Suma netto", 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
|
||||
|
||||
$i = 1;
|
||||
$lv=return_app_list_strings_language($this->ecmlanguage);
|
||||
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
if($this->show_images_on_offers){
|
||||
if(file_exists($this->getProductImage($p['id']))){$table [$i]['image'] = array('width' => $image_w, 'value' => '', 'border' => 0, 'align' => 'R', 'image_path' => $this->getProductImage($p['id']));
|
||||
//$iarr[]=$this->getProductImage($p['id']);
|
||||
}
|
||||
else $table [$i]['image'] = array('width' => $image_w, 'value' => '', 'border' => 0, 'align' => 'R');
|
||||
}
|
||||
$table [$i]['position'] = array('width' => 5, 'value' => $i, 'border' => 0, 'align' => 'C', );
|
||||
$table [$i]['code'] = array('width' => 12, 'value' => $p['code'], 'border' => 0, 'align' => 'C', );
|
||||
if($this->show_recipient_code)
|
||||
$table [$i]['recipient_code'] = array('width' => $recipient_code_w, 'value' => $p['recipient_code'], 'border' => 0, 'align' => 'C', );
|
||||
//$table [$i]['unit'] = array('width' => 10, 'value' => $p['unit_id'], 'border' => 0, 'align' => 'C', );
|
||||
|
||||
/*
|
||||
if($this->ecmlanguage=="en_us"){
|
||||
$r=mysql_fetch_array(mysql_query("select short_description from ecmproduct_language_en_view where ecmproduct_id='".$p['id']."'"));
|
||||
$dname=$r['short_description'];
|
||||
}
|
||||
elseif($this->ecmlanguage=="ge_ge"){
|
||||
$r=mysql_fetch_array(mysql_query("select short_description from ecmproduct_language_de_view where ecmproduct_id='".$p['id']."'"));
|
||||
$dname=$r['short_description'];
|
||||
}
|
||||
else $dname=$p['name'];
|
||||
*/
|
||||
|
||||
$table [$i]['description'] = array('width' => $name_w, 'value' => htmlspecialchars_decode($p['name']), 'border' => 0, 'align' => 'L', );
|
||||
$table [$i]['quantity'] = array('width' => 8, 'value' => $p['quantity'], 'border' => 0, 'align' => 'C', );
|
||||
$table [$i]['unit'] = array('width' => 5, 'value' => $lv['ecmproducts_unit_dom'][$p['unit_id']], 'border' => 0, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit_price'] = array('width' => 14, 'value' => $p['price'], 'border' => 0, 'align' => 'C', );
|
||||
if($calc['draw_discount']) $table [$i]['discount'] = array('width' => 8, 'value' => $p['discount'], 'border' => 0, 'align' => 'R', );
|
||||
if($calc['draw_vat']) $table [$i]['vat_id'] = array('width' => 8, 'value' => $p['vat_name'], 'border' => 0, 'align' => 'R', );
|
||||
$table [$i]['total'] = array('width' => 14, 'value' => $p['total'], 'border' => 0, 'align' => 'R', );
|
||||
$i++;
|
||||
}
|
||||
$starttab=$pdf->GetY()+10;
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$endtab=$pdf->GetY();
|
||||
//for($n=0;$n<$i;$n++){
|
||||
//if(file_exists($iarr[$n]))$pdf->Image($iarr[$n],$pdf->GetX()+1,$starttab+$n*18+1,15,0);
|
||||
//}
|
||||
$pdf->SetY($endtab);
|
||||
//total, vat, subtotal
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
|
||||
//$pdf->SetX($pdf->fw-$pdf->rMargin-$pr*34);
|
||||
$table = array();
|
||||
|
||||
if($calc['vats']) {
|
||||
$table [] = array(
|
||||
'subtotal1' => array('width' => 66, 'value' => "Suma netto", 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9),
|
||||
'subtotal2' => array('width' => 34, 'value' => $calc['subtotal'], 'border' => 0, 'overflow' => 1, 'align' => 'R', 'font-size' => 9), );
|
||||
|
||||
foreach($calc['vats'] as $key => $value){
|
||||
$r=mysql_fetch_array(mysql_query("select name from ecmvats where id='".$key."'"));
|
||||
$vvn=$r['name'];
|
||||
$table [] = array(
|
||||
'vat1' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_VAT'].' ('.$vvn.')', 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9),
|
||||
'vat2' => array('width' => 34, 'value' => $value, 'border' => 0, 'overflow' => 1, 'align' => 'R', 'font-size' => 9), );
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($calc['discount'])) {
|
||||
$table [] = array(
|
||||
'total21' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
|
||||
'total22' => array('width' => 34, 'value' => $calc['total2'], 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 9), );
|
||||
$table [] = array(
|
||||
'discount1' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_DISCOUNT'].' '.$calc['discount']['procent'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
|
||||
'discount2' => array('width' => 34, 'value' => $calc['discount']['value'], 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 9), );
|
||||
}
|
||||
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 66, 'value' => "Suma brutto", 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
|
||||
'total2' => array('width' => 34, 'value' => $calc['total'], 'border' => 0, 'background' => array(233,233,233), 'overflow' => 1, 'align' => 'R' , 'font-size' => 9, 'font-style' => 'b'), );
|
||||
|
||||
$pdf->DrawTable($table);
|
||||
?>
|
||||
192
modules/EcmDocumentTemplates/templates/EcmInsideOrders/e5/subheader.php
Executable file
192
modules/EcmDocumentTemplates/templates/EcmInsideOrders/e5/subheader.php
Executable file
@@ -0,0 +1,192 @@
|
||||
<?
|
||||
global $app_list_strings;
|
||||
|
||||
|
||||
$address = str_replace("<","<",str_replace(">",">",$this->parent_name));
|
||||
if($this->parent_contact_name) {
|
||||
$address .= "\n".$this->parent_contact_name;
|
||||
if($this->parent_contact_title) {
|
||||
$address .= "\n".$this->parent_contact_title;
|
||||
}
|
||||
$personplus=5;
|
||||
}
|
||||
else $personplus=0;
|
||||
|
||||
if($this->parent_address_street) $address .= "\n".str_replace("\n","",$this->parent_address_street);
|
||||
if($this->parent_address_postalcode) $address .= "\n".$this->parent_address_postalcode;
|
||||
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
|
||||
if($this->to_nip) $address .= "\n".$mod_strings['LBL_PDF_NIP'].": ".$this->to_nip;
|
||||
elseif(!$this->to_nip && $this->to_vatid) $address .= "\n".$mod_strings['LBL_PDF_NIP'].": ".$this->to_vatid;
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iln from accounts where id='".$this->parent_id."'"));
|
||||
if($r['iln'])$address .= "\nILN: ".$r['iln'];
|
||||
|
||||
//to address
|
||||
$old_x=$pdf->GetX();
|
||||
$old_y=$pdf->GetY();
|
||||
|
||||
$pdf->SetXY(25,37);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35,1,"WYSTAWCA:",0,0,'L',1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(25);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select vatid from accounts where id='".$pdf->edt->account_id."'"));
|
||||
if($r['vatid'])$pdf->edt->header_text .= "\nNip: ".$r['vatid'];
|
||||
if($r['iln'])$pdf->edt->header_text .= "\nILN: ".$r['iln'];
|
||||
$pdf->MultiCell(60,4,$pdf->edt->header_text,0,'L');
|
||||
|
||||
$pdf->SetXY(81,37);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35,1,"ODBIORCA:",0,0,'L',1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(81);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$pdf->MultiCell(60,4,$address,0,'L');
|
||||
|
||||
|
||||
$pdf->SetXY(160,$old_y+10+$personplus);
|
||||
|
||||
$table = array();
|
||||
|
||||
$table [1]['date_reg'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [1]['date_reg_value'] = array('width' => 36, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
$table [2]['date_end'] = array('width' => 20, 'value' => "Data zakonczenia", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [2]['date_end_value'] = array('width' => 36, 'value' => $this->end_date, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$table [3]['data'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [3]['data_value'] = array('width' => 36, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$rs=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select name from ecmstocks where id='".$this->pw_stock_id."'"));
|
||||
$table [4]['pw'] = array('width' => 20, 'value' => "Magazyn dokumentu PW", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [4]['pw_value'] = array('width' => 36, 'value' => $rs['name'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$rs=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select name from ecmstocks where id='".$this->rw_stock_id."'"));
|
||||
$table [5]['rw'] = array('width' => 20, 'value' => "Magazyn dokumentu RW", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [5]['rw_value'] = array('width' => 36, 'value' => $rs['name'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$emp=str_replace("|","
|
||||
",$this->employers);
|
||||
$table [6]['data'] = array('width' => 20, 'value' => "Osoby", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [6]['data_value'] = array('width' => 36, 'value' => $emp, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$pdf->SetXY(143,$pdf->tMargin);
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
|
||||
$pdf->Ln(9);
|
||||
|
||||
$pdf->SetFont('arialpl','','18');
|
||||
$pdf->SetXY(60,$pdf->tMargin+10);
|
||||
|
||||
$pdf->MultiCell(80,7,$mod_strings['LBL_PDF_DOCUMENT_NAME']." ".$this->document_no,0,'C');
|
||||
$pdf->SetFont('arialpl', 'B', 7);
|
||||
$pdf->Ln(3);
|
||||
|
||||
//$this->loadParser();
|
||||
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
$pdf->SetY($ynew);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$pdf->SetFont('arialpl','','7');
|
||||
global $mod_strings;
|
||||
|
||||
|
||||
$currency = new Currency();
|
||||
$currency->retrieve($this->currency_id);
|
||||
$this->currency_symbol=$currency->iso4217;
|
||||
|
||||
if(!isset($this->position_list) || !is_array($this->position_list))
|
||||
$this->position_list = $this->getPositionList(true);
|
||||
$calc = $this->calculate($this->position_list,true);
|
||||
|
||||
$calc['total'] .= ' '.$this->currency_symbol;
|
||||
$calc['subtotal'] .= ' '.$this->currency_symbol;
|
||||
if($calc['discount']) {
|
||||
$calc['total2'] .= ' '.$this->currency_symbol;
|
||||
$calc['discount']['value'] .= ' '.$this->currency_symbol;
|
||||
}
|
||||
|
||||
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
|
||||
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
|
||||
|
||||
|
||||
|
||||
$pdf->Ln(7);
|
||||
$name_w = 41;
|
||||
$table = array();
|
||||
|
||||
$table [0]['position'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['code'] = array('width' => 12, 'value' => "Index", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['description'] = array('width' => $name_w, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'], 'border' => 1, 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['quantity'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'], 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['prod_quantity'] = array('width' => 8, 'value' => "Il. prod", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['unit_price'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'], 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['total'] = array('width' => 14, 'value' => "Suma netto", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'R');
|
||||
$pdf->SetY(60);
|
||||
if($this->header_text){
|
||||
$pdf->MultiCell(80,4,$this->header_text,0,'L');$pdf->Ln();
|
||||
}
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
$table=array();
|
||||
$i = 1;
|
||||
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
if($p['component']!=1){
|
||||
$no++;
|
||||
$n=$no;
|
||||
$up=format_number($p['price']).' '.$this->currency_symbol;
|
||||
$tot=format_number($p['total']).' '.$this->currency_symbol;
|
||||
}
|
||||
else {
|
||||
$n="";
|
||||
$up="";
|
||||
$tot="";
|
||||
}
|
||||
if($p['prod_quantity']==0)$pq="";
|
||||
else $pq=$p['prod_quantity'];
|
||||
$table [$i]['position'] = array('width' => 5, 'value' => $n, 'border' => 1, 'align' => 'C', );
|
||||
$table [$i]['code'] = array('width' => 12, 'value' => $p['code'], 'border' => 1, 'align' => 'C', );
|
||||
$table [$i]['description'] = array('width' => $name_w, 'value' => htmlspecialchars_decode($p['name']), 'border' => 1, 'align' => 'L', );
|
||||
$table [$i]['quantity'] = array('width' => 8, 'value' => $p['quantity'], 'border' => 1, 'align' => 'C', );
|
||||
$table [$i]['prod_quantity'] = array('width' => 8, 'value' => $pq, 'border' => 1, 'align' => 'C', );
|
||||
$table [$i]['unit_price'] = array('width' => 14, 'value' => $up, 'border' => 1, 'align' => 'C');
|
||||
$table [$i]['total'] = array('width' => 14, 'value' => $tot, 'border' => 1, 'align' => 'R', );
|
||||
$i++;
|
||||
}
|
||||
$pdf->DrawTable($table,array(0));
|
||||
/*
|
||||
*/
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
|
||||
$table = array();
|
||||
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 16,'font-style' => 'b', 'value' => "Suma netto",'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
|
||||
'total2' => array('width' => 28, 'value' => $calc['total'], 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 9, 'font-style' => 'b'),
|
||||
);
|
||||
|
||||
if($pdf->GetY()+30>$pdf->fh-$pdf->bMargin)$pdf->AddPage();
|
||||
$pdf->SetX(124);
|
||||
$pdf->DrawTable($table);
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->Cell(85,1,".........................................................",0,0,'L',1);
|
||||
$pdf->Cell(85,1,".........................................................",0,0,'R',1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetFont('arialpl','','5');
|
||||
$pdf->Cell(85,1," (podpis produkujacego)",0,0,'L',1);
|
||||
$pdf->Cell(85,1,"(podpis kontrolujacego) ",0,0,'R',1);
|
||||
|
||||
?>
|
||||
49
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/_footer.php
Executable file
49
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/_footer.php
Executable file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/*
|
||||
//if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
if ($this->page > 1) {
|
||||
$y = $this->fh - 20;
|
||||
$this->Line(10, $y, 200, $y);
|
||||
|
||||
$this->SetFont('arialpl', '', 10);
|
||||
|
||||
$this->SetXY(10, $this->fh - 16);
|
||||
$this->Cell(10, 0, 'Oferta nr ' . $this->focus->document_no);
|
||||
|
||||
$this->SetXY($this->fw / 2, $this->fh - 16);
|
||||
$this->Cell(10, 0, $this->PageNo() . '/{nb}');
|
||||
} else {
|
||||
$y = $this->fh - 20;
|
||||
$this->Line(10, $y, 200, $y);
|
||||
$this->SetFont('arialpl', '', 7.5);
|
||||
|
||||
$this->SetXY(10, $this->fh - 16);
|
||||
$this->Cell(49, 0, "Prezes Zarządu - J.Lasowy");
|
||||
$this->Cell(40, 0, "NIP: 879-016-88-72");
|
||||
$this->Cell(50, 0, "Sąd Rejonowy w Toruniu");
|
||||
|
||||
if($this->focus->pdf_type == 'K')
|
||||
$this->Cell(30, 0, "Konto: Alior Bank S.A. Oddział w Toruniu");
|
||||
else
|
||||
$this->Cell(30, 0, "Bank: City Handlowy");
|
||||
|
||||
$this->SetXY(10, $this->fh - 12.5);
|
||||
$this->Cell(49, 0, "Wiceprezes - M.Lasowy");
|
||||
$this->Cell(40, 0, "REGON: 870525737");
|
||||
$this->Cell(50, 0, "VII Wydział Gospodarczy KRS");
|
||||
|
||||
if($this->focus->pdf_type == 'K')
|
||||
$this->Cell(30, 0, "14 2490 0005 0000 4530 1266 3471");
|
||||
else
|
||||
$this->Cell(30, 0, "IBAN: PL 02 1030 1090 0000 0000 5802 0503");
|
||||
|
||||
|
||||
$this->SetXY(10, $this->fh - 9);
|
||||
$this->Cell(49, 0, "");
|
||||
$this->Cell(40, 0, "Kapitał zakładowy 50 000 PLN");
|
||||
$this->Cell(50, 0, "KRS 0000160548");
|
||||
|
||||
if($this->focus->pdf_type != 'K')
|
||||
$this->Cell(30, 0, "SWITF: CITIPLPX");
|
||||
}
|
||||
251
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/_subfooter_e.php
Executable file
251
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/_subfooter_e.php
Executable file
@@ -0,0 +1,251 @@
|
||||
<?php
|
||||
|
||||
//payment conditions
|
||||
//
|
||||
//if (!empty($this->ecmpaymentcondition_text)) {
|
||||
// $pdf->Ln(4);
|
||||
// $pdf->SetFont('arialpl', '', '8');
|
||||
// $pdf->MultiCell(0, 4, $this->ecmpaymentcondition_text, 0, 'L');
|
||||
// $pdf->Ln();
|
||||
//}
|
||||
//
|
||||
//if ($this->type == "correct") {
|
||||
// $pdf->SetFont('arialpl', 'b', '12');
|
||||
// $pdf->Ln(3);
|
||||
// $pdf->MultiCell(0, 4, $mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . '/' . $mod_strings2['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . " " . format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))) . ' ' . $this->currency_symbol);
|
||||
// $pdf->Ln(3);
|
||||
//}
|
||||
|
||||
$pdf->writeHTML('</table>'); // fix background-color overflowing FROM table ... why ? //
|
||||
|
||||
if ($this->type == "correct") {
|
||||
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
|
||||
$w = $GLOBALS['db']->query($qw);
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$qrr = "SELECT price, quantity, ecmvat_value FROM ecminvoiceoutitems WHERE id = '" . $r['ecminvoiceoutitem_id'] . "'";
|
||||
$rr_prepayment = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query($qrr));
|
||||
|
||||
$total += $r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
$total -= $rr_prepayment['price'] * $rr_prepayment['quantity'] + round($rr_prepayment['price'] * $rr_prepayment['quantity'] * $rr_prepayment['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
$total -= $this->paid_val;
|
||||
|
||||
if ($total > 0) {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID'] . '/' . $mod_strings2['LBL_PDF_TO_PAID'];
|
||||
} else {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'] . '/' . $mod_strings2['LBL_PDF_TO_PAID_BACK'];
|
||||
}
|
||||
|
||||
$total = format_number(abs($total));
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(50, 4, 'Razem do zapłaty:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
|
||||
} else {
|
||||
$total = 0;
|
||||
|
||||
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
|
||||
$w = $GLOBALS['db']->query($qw);
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$total+=$r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
$total-=floatval(str_replace(",", ".", str_replace(".", "", $this->discount)));
|
||||
|
||||
//$total -= $this->paid_val;
|
||||
|
||||
if ($total > 0) {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID'] . '/' . $mod_strings2['LBL_PDF_TO_PAID'];
|
||||
} else {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'] . '/' . $mod_strings2['LBL_PDF_TO_PAID_BACK'];
|
||||
}
|
||||
|
||||
$total = format_number(abs($total));
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(50, 4, 'Razem do zapłaty/Total to pay:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
}
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
if ($this->prepaid) {
|
||||
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID_DOCUMENTS'] . '/' . $mod_strings2['LBL_PDF_PREPAID_DOCUMENTS'] . ':', 0, 0, 'L', 1);
|
||||
// $pdf->Cell(30, 4, implode(', ', $rr_prepayment), 0, 0, 'L', 1);
|
||||
//
|
||||
// $pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID'] . '/' . $mod_strings2['LBL_PDF_PREPAID'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($this->prepaid) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
}
|
||||
|
||||
//$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAID'] . '/' . $mod_strings2['LBL_PDF_PAID'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($this->paid_val) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
|
||||
if($this->paid_val > 0) {
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml($app_list_strings['payment_method_dom'][$this->payment_method_paid] . '/' . $lv['payment_method_dom'][$this->payment_method_paid]);
|
||||
}
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
//if ($pdf->GetY() > 240) {
|
||||
// $pdf->AddPage();
|
||||
//}
|
||||
|
||||
$total -= ($this->paid_val);
|
||||
|
||||
if(($pleft = $brutto - $this->prepaid - $this->paid_val) > 0) {
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$pdf->Cell(50, 4, 'Pozostało do zapłaty/To pay:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($pleft). ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml(sprintf($mod_strings['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $app_list_strings['payment_method_dom'][$this->payment_method]));
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml(sprintf($mod_strings2['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $lv['payment_method_dom'][$this->payment_method]));
|
||||
|
||||
//echo '<pre>' . var_export($cx, true) . '</pre>';
|
||||
//echo '<pre>' . var_export($cy, true) . '</pre>'; exit;
|
||||
}
|
||||
|
||||
//$pdf->Ln(4);
|
||||
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//
|
||||
//if (false == is_null($pc)) {
|
||||
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_METHOD'] . ':', 0, 0, 'L', 1);
|
||||
// $pdf->Cell(50, 4, $pc->name ? : '-', 0, 0, 'L', 1);
|
||||
//
|
||||
// $pdf->Ln(4);
|
||||
//}
|
||||
//
|
||||
//$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_TERMIN'] . ':', 0, 0, 'L', 1);
|
||||
//$pdf->Cell(50, 4, $this->payment_date ? : '-', 0, 0, 'L', 1);
|
||||
//
|
||||
//$pdf->Ln(4);
|
||||
//
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//$pdf->Cell(30, 4, "Słownie:", 0, 0, 'L', 1);
|
||||
//$pdf->SetFont('arialpl', 'B', '8');
|
||||
//
|
||||
//if ($this->type == "correct") {
|
||||
// $tot = format_number(abs((float) $total - array_sum($inv_value)));
|
||||
// $tot = str_replace(".", "", $tot);
|
||||
// //$tot=str_replace(",",".",$tot);
|
||||
// $sl = $this->slowniePL($tot);
|
||||
//} else {
|
||||
// $tot = str_replace(".", "", str_replace("PLN", "", $total - array_sum($inv_value)));
|
||||
// $sl = $this->slowniePL($tot);
|
||||
//}
|
||||
//
|
||||
//if ($this->document_no == "FV 1421/10") {
|
||||
// $sl = "one thousand one hundred six EUR 41/100";
|
||||
//}
|
||||
//
|
||||
//$pdf->Cell(150, 4, $sl, 0, 0, 'L', 1);
|
||||
|
||||
//echo '<pre>' . var_export(format_number('9.9999', 4, 4), true) . '</pre>'; exit;
|
||||
//echo '<pre>' . var_export(gettype((double)$this->currency_value), true) . '</pre>'; exit;
|
||||
|
||||
if ($this->currency_value > 1 && $this->currency_symbol != 'EUR') {
|
||||
$pdf->Ln(8);
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->WriteHtml(sprintf('Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. wystawienia faktury: 1 %s = %s %s', $this->currency_symbol, format_number($this->currency_value, 4, 4), 'PLN'));
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->WriteHtml(sprintf('Prices are calculated by currency exchange rates of City Handlowy bank dated by invoice sale date: 1 %s = %s %s', $this->currency_symbol, format_number($this->currency_value, 4, 4), 'PLN'));
|
||||
|
||||
|
||||
//$pdf->Cell(50, 4, 'Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. wystawienia faktury: ' , 0, 0, 'L', 1); // $mod_strings['LBL_CURRENCY_VALUE'] . ':'
|
||||
//$pdf->Cell(30, 4, '1 ' . $this->currency_symbol . ' = ' . format_number($this->currency_value, 4, 4) . ' zł', 0, 0, 'R', 1);
|
||||
}
|
||||
|
||||
$pdf->Ln(8);
|
||||
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetX(10);
|
||||
$pdf->Cell(85, 1, 'Dla wszystkich pozycji faktury zastosowano stawkę VAT 0%', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->Cell(85, 1, 'VAT is 0% for all invoice items', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->Cell(85, 1, 'Zgodnie z art. 41 ust. 4 ustawy o podatku VAT', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(16);
|
||||
|
||||
//$pdf->SetX(10);
|
||||
//$pdf->SetFont('arialpl', '', '7');
|
||||
//
|
||||
//$pdf->Cell(95, 1, "...............................................................", 0, 0, 'L', 1);
|
||||
//$pdf->Cell(95, 1, "...............................................................", 0, 0, 'R', 1);
|
||||
//
|
||||
//$pdf->Ln(4);
|
||||
//
|
||||
//$pdf->SetX(10);
|
||||
//$pdf->Cell(43, 1, $mod_strings['LBL_PDF_OWNER_SIGNATURE'] . '/' . $mod_strings2['LBL_PDF_OWNER_SIGNATURE'], 0, 0, 'C', 1);
|
||||
//
|
||||
//$pdf->SetX(162);
|
||||
//$pdf->Cell(35, 1, $mod_strings['LBL_PDF_RECEIVER_SIGNATURE'], 0, 0, 'C', 1);
|
||||
//
|
||||
//$pdf->Ln(4);
|
||||
//$pdf->SetX(10);
|
||||
//$pdf->Cell(43, 1, $this->setUser()->full_name, 0, 0, 'C', 1);
|
||||
|
||||
//footer text
|
||||
$pdf->Ln(18);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->MultiCell(0, 4, $this->footer_text, 0, 'J');
|
||||
|
||||
//header text
|
||||
$pdf->Ln(6);
|
||||
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->MultiCell(0, 4, $this->ads_text, 0, 'J');
|
||||
241
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/_subfooter_k.php
Executable file
241
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/_subfooter_k.php
Executable file
@@ -0,0 +1,241 @@
|
||||
<?php
|
||||
|
||||
//payment conditions
|
||||
//
|
||||
//if (!empty($this->ecmpaymentcondition_text)) {
|
||||
// $pdf->Ln(4);
|
||||
// $pdf->SetFont('arialpl', '', '8');
|
||||
// $pdf->MultiCell(0, 4, $this->ecmpaymentcondition_text, 0, 'L');
|
||||
// $pdf->Ln();
|
||||
//}
|
||||
//
|
||||
//if ($this->type == "correct") {
|
||||
// $pdf->SetFont('arialpl', 'b', '12');
|
||||
// $pdf->Ln(3);
|
||||
// $pdf->MultiCell(0, 4, $mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . " " . format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))) . ' ' . $this->currency_symbol);
|
||||
// $pdf->Ln(3);
|
||||
//}
|
||||
|
||||
$pdf->writeHTML('</table>'); // fix background-color overflowing FROM table ... why ? //
|
||||
|
||||
if ($this->type == "correct") {
|
||||
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
|
||||
$w = $GLOBALS['db']->query($qw);
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$qrr = "SELECT price, quantity, ecmvat_value FROM ecminvoiceoutitems WHERE id = '" . $r['ecminvoiceoutitem_id'] . "'";
|
||||
$rr_prepayment = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query($qrr));
|
||||
|
||||
$total += $r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
$total -= $rr_prepayment['price'] * $rr_prepayment['quantity'] + round($rr_prepayment['price'] * $rr_prepayment['quantity'] * $rr_prepayment['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
$total -= $this->paid_val;
|
||||
|
||||
if ($total > 0) {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID'];
|
||||
} else {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'];
|
||||
}
|
||||
|
||||
$total = format_number(abs($total));
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(50, 4, 'Razem do zapłaty:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
|
||||
} else {
|
||||
$total = 0;
|
||||
|
||||
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
|
||||
$w = $GLOBALS['db']->query($qw);
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$total+=$r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
$total-=floatval(str_replace(",", ".", str_replace(".", "", $this->discount)));
|
||||
|
||||
//$total -= $this->paid_val;
|
||||
|
||||
if ($total > 0) {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID'];
|
||||
} else {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'];
|
||||
}
|
||||
|
||||
$total = format_number(abs($total));
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(50, 4, 'Razem do zapłaty:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
}
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
if ($this->prepaid) {
|
||||
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID_DOCUMENTS'] . ':', 0, 0, 'L', 1);
|
||||
// $pdf->Cell(30, 4, implode(', ', $rr_prepayment), 0, 0, 'L', 1);
|
||||
//
|
||||
// $pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($this->prepaid) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
}
|
||||
|
||||
//$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAID'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($this->paid_val) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
|
||||
if($this->paid_val > 0) {
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml($app_list_strings['payment_method_dom'][$this->payment_method_paid]);
|
||||
}
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
//if ($pdf->GetY() > 240) {
|
||||
// $pdf->AddPage();
|
||||
//}
|
||||
|
||||
$total -= ($this->paid_val);
|
||||
|
||||
//var_export($numberLength);
|
||||
//var_export($fNumber);
|
||||
|
||||
//var_export(str_pad(format_number($this->paid_val), $numberLength, '_', STR_PAD_LEFT));
|
||||
//var_export(implode(array_fill(0, 10 - 5, ' ')) . format_number($pleft));exit;
|
||||
|
||||
|
||||
if(($pleft = $brutto - $this->prepaid - $this->paid_val) > 0) {
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$pdf->Cell(50, 4, 'Pozostało do zapłaty:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($pleft) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml(sprintf($mod_strings['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $app_list_strings['payment_method_dom'][$this->payment_method]));
|
||||
|
||||
//$pdf->Ln(4);
|
||||
|
||||
//$pdf->SetX(90);
|
||||
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//$pdf->WriteHtml(sprintf($mod_strings2['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $this->payment_method));
|
||||
|
||||
//echo '<pre>' . var_export($cx, true) . '</pre>';
|
||||
//echo '<pre>' . var_export($cy, true) . '</pre>'; exit;
|
||||
}
|
||||
|
||||
//$pdf->Ln(4);
|
||||
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//
|
||||
//if (false == is_null($pc)) {
|
||||
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_METHOD'] . ':', 0, 0, 'L', 1);
|
||||
// $pdf->Cell(50, 4, $pc->name ? : '-', 0, 0, 'L', 1);
|
||||
//
|
||||
// $pdf->Ln(4);
|
||||
//}
|
||||
//
|
||||
//$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_TERMIN'] . ':', 0, 0, 'L', 1);
|
||||
//$pdf->Cell(50, 4, $this->payment_date ? : '-', 0, 0, 'L', 1);
|
||||
//
|
||||
//$pdf->Ln(4);
|
||||
//
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//$pdf->Cell(30, 4, "Słownie:", 0, 0, 'L', 1);
|
||||
//$pdf->SetFont('arialpl', 'B', '8');
|
||||
//
|
||||
//if ($this->type == "correct") {
|
||||
// $tot = format_number(abs((float) $total - array_sum($inv_value)));
|
||||
// $tot = str_replace(".", "", $tot);
|
||||
// //$tot=str_replace(",",".",$tot);
|
||||
// $sl = $this->slowniePL($tot);
|
||||
//} else {
|
||||
// $tot = str_replace(".", "", str_replace("PLN", "", $total - array_sum($inv_value)));
|
||||
// $sl = $this->slowniePL($tot);
|
||||
//}
|
||||
//
|
||||
//if ($this->document_no == "FV 1421/10") {
|
||||
// $sl = "one thousand one hundred six EUR 41/100";
|
||||
//}
|
||||
//
|
||||
//$pdf->Cell(150, 4, $sl, 0, 0, 'L', 1);
|
||||
|
||||
//echo '<pre>' . var_export(format_number('9.9999', 4, 4), true) . '</pre>'; exit;
|
||||
//echo '<pre>' . var_export(gettype((double)$this->currency_value), true) . '</pre>'; exit;
|
||||
|
||||
if ($this->currency_value > 1 && $this->currency_symbol != 'EUR') {
|
||||
$pdf->Ln(8);
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->WriteHtml(sprintf('Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. %s: 1 %s = %s %s', 'EUR', date('Y-m-d'), format_number($this->currency_value, 4, 4), $this->currency_symbol));
|
||||
|
||||
|
||||
//$pdf->Cell(50, 4, 'Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. wystawienia faktury: ' , 0, 0, 'L', 1); // $mod_strings['LBL_CURRENCY_VALUE'] . ':'
|
||||
//$pdf->Cell(30, 4, '1 ' . $this->currency_symbol . ' = ' . format_number($this->currency_value, 4, 4) . ' zł', 0, 0, 'R', 1);
|
||||
}
|
||||
|
||||
$pdf->Ln(20);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '7');
|
||||
|
||||
$pdf->Cell(95, 1, "...............................................................", 0, 0, 'L', 1);
|
||||
$pdf->Cell(95, 1, "...............................................................", 0, 0, 'R', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->Cell(43, 1, $mod_strings['LBL_PDF_OWNER_SIGNATURE'], 0, 0, 'C', 1);
|
||||
|
||||
$pdf->SetX(162);
|
||||
$pdf->Cell(35, 1, $mod_strings['LBL_PDF_RECEIVER_SIGNATURE'], 0, 0, 'C', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetX(10);
|
||||
$pdf->Cell(43, 1, $this->setUser()->full_name, 0, 0, 'C', 1);
|
||||
|
||||
//footer text
|
||||
$pdf->Ln(18);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->MultiCell(0, 4, $this->footer_text, 0, 'J');
|
||||
|
||||
//header text
|
||||
$pdf->Ln(6);
|
||||
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->MultiCell(0, 4, $this->ads_text, 0, 'J');
|
||||
|
||||
/*
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
|
||||
$pdf->DeletePage(6);exit;
|
||||
*/
|
||||
251
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/_subfooter_u.php
Executable file
251
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/_subfooter_u.php
Executable file
@@ -0,0 +1,251 @@
|
||||
<?php
|
||||
|
||||
//payment conditions
|
||||
//
|
||||
//if (!empty($this->ecmpaymentcondition_text)) {
|
||||
// $pdf->Ln(4);
|
||||
// $pdf->SetFont('arialpl', '', '8');
|
||||
// $pdf->MultiCell(0, 4, $this->ecmpaymentcondition_text, 0, 'L');
|
||||
// $pdf->Ln();
|
||||
//}
|
||||
//
|
||||
//if ($this->type == "correct") {
|
||||
// $pdf->SetFont('arialpl', 'b', '12');
|
||||
// $pdf->Ln(3);
|
||||
// $pdf->MultiCell(0, 4, $mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . '/' . $mod_strings2['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . " " . format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))) . ' ' . $this->currency_symbol);
|
||||
// $pdf->Ln(3);
|
||||
//}
|
||||
|
||||
$pdf->writeHTML('</table>'); // fix background-color overflowing FROM table ... why ? //
|
||||
|
||||
if ($this->type == "correct") {
|
||||
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
|
||||
$w = $GLOBALS['db']->query($qw);
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$qrr = "SELECT price, quantity, ecmvat_value FROM ecminvoiceoutitems WHERE id = '" . $r['ecminvoiceoutitem_id'] . "'";
|
||||
$rr_prepayment = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query($qrr));
|
||||
|
||||
$total += $r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
$total -= $rr_prepayment['price'] * $rr_prepayment['quantity'] + round($rr_prepayment['price'] * $rr_prepayment['quantity'] * $rr_prepayment['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
$total -= $this->paid_val;
|
||||
|
||||
if ($total > 0) {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID'] . '/' . $mod_strings2['LBL_PDF_TO_PAID'];
|
||||
} else {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'] . '/' . $mod_strings2['LBL_PDF_TO_PAID_BACK'];
|
||||
}
|
||||
|
||||
$total = format_number(abs($total));
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(50, 4, 'Razem do zapłaty:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
|
||||
} else {
|
||||
$total = 0;
|
||||
|
||||
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
|
||||
$w = $GLOBALS['db']->query($qw);
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$total+=$r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
$total-=floatval(str_replace(",", ".", str_replace(".", "", $this->discount)));
|
||||
|
||||
//$total -= $this->paid_val;
|
||||
|
||||
if ($total > 0) {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID'] . '/' . $mod_strings2['LBL_PDF_TO_PAID'];
|
||||
} else {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'] . '/' . $mod_strings2['LBL_PDF_TO_PAID_BACK'];
|
||||
}
|
||||
|
||||
$total = format_number(abs($total));
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(50, 4, 'Razem do zapłaty/Total to pay:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
}
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
if ($this->prepaid) {
|
||||
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID_DOCUMENTS'] . '/' . $mod_strings2['LBL_PDF_PREPAID_DOCUMENTS'] . ':', 0, 0, 'L', 1);
|
||||
// $pdf->Cell(30, 4, implode(', ', $rr_prepayment), 0, 0, 'L', 1);
|
||||
//
|
||||
// $pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID'] . '/' . $mod_strings2['LBL_PDF_PREPAID'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($this->prepaid) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
}
|
||||
|
||||
//$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAID'] . '/' . $mod_strings2['LBL_PDF_PAID'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($this->paid_val) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
|
||||
if($this->paid_val > 0) {
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml($app_list_strings['payment_method_dom'][$this->payment_method_paid] . '/' . $lv['payment_method_dom'][$this->payment_method_paid]);
|
||||
}
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
//if ($pdf->GetY() > 240) {
|
||||
// $pdf->AddPage();
|
||||
//}
|
||||
|
||||
$total -= ($this->paid_val);
|
||||
|
||||
if(($pleft = $brutto - $this->prepaid - $this->paid_val) > 0) {
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$pdf->Cell(50, 4, 'Pozostało do zapłaty/To pay:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($pleft). ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml(sprintf($mod_strings['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $app_list_strings['payment_method_dom'][$this->payment_method]));
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml(sprintf($mod_strings2['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $lv['payment_method_dom'][$this->payment_method]));
|
||||
|
||||
//echo '<pre>' . var_export($cx, true) . '</pre>';
|
||||
//echo '<pre>' . var_export($cy, true) . '</pre>'; exit;
|
||||
}
|
||||
|
||||
//$pdf->Ln(4);
|
||||
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//
|
||||
//if (false == is_null($pc)) {
|
||||
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_METHOD'] . ':', 0, 0, 'L', 1);
|
||||
// $pdf->Cell(50, 4, $pc->name ? : '-', 0, 0, 'L', 1);
|
||||
//
|
||||
// $pdf->Ln(4);
|
||||
//}
|
||||
//
|
||||
//$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_TERMIN'] . ':', 0, 0, 'L', 1);
|
||||
//$pdf->Cell(50, 4, $this->payment_date ? : '-', 0, 0, 'L', 1);
|
||||
//
|
||||
//$pdf->Ln(4);
|
||||
//
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//$pdf->Cell(30, 4, "Słownie:", 0, 0, 'L', 1);
|
||||
//$pdf->SetFont('arialpl', 'B', '8');
|
||||
//
|
||||
//if ($this->type == "correct") {
|
||||
// $tot = format_number(abs((float) $total - array_sum($inv_value)));
|
||||
// $tot = str_replace(".", "", $tot);
|
||||
// //$tot=str_replace(",",".",$tot);
|
||||
// $sl = $this->slowniePL($tot);
|
||||
//} else {
|
||||
// $tot = str_replace(".", "", str_replace("PLN", "", $total - array_sum($inv_value)));
|
||||
// $sl = $this->slowniePL($tot);
|
||||
//}
|
||||
//
|
||||
//if ($this->document_no == "FV 1421/10") {
|
||||
// $sl = "one thousand one hundred six EUR 41/100";
|
||||
//}
|
||||
//
|
||||
//$pdf->Cell(150, 4, $sl, 0, 0, 'L', 1);
|
||||
|
||||
//echo '<pre>' . var_export(format_number('9.9999', 4, 4), true) . '</pre>'; exit;
|
||||
//echo '<pre>' . var_export(gettype((double)$this->currency_value), true) . '</pre>'; exit;
|
||||
|
||||
if ($this->currency_value > 1 && $this->currency_symbol != 'EUR') {
|
||||
$pdf->Ln(8);
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->WriteHtml(sprintf('Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. wystawienia faktury: 1 %s = %s %s', $this->currency_symbol, format_number($this->currency_value, 4, 4), 'PLN'));
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->WriteHtml(sprintf('Prices are calculated by currency exchange rates of City Handlowy bank dated by invoice sale date: 1 %s = %s %s', $this->currency_symbol, format_number($this->currency_value, 4, 4), 'PLN'));
|
||||
|
||||
|
||||
//$pdf->Cell(50, 4, 'Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. wystawienia faktury: ' , 0, 0, 'L', 1); // $mod_strings['LBL_CURRENCY_VALUE'] . ':'
|
||||
//$pdf->Cell(30, 4, '1 ' . $this->currency_symbol . ' = ' . format_number($this->currency_value, 4, 4) . ' zł', 0, 0, 'R', 1);
|
||||
}
|
||||
|
||||
$pdf->Ln(8);
|
||||
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetX(10);
|
||||
$pdf->Cell(85, 1, 'Dla wszystkich pozycji faktury zastosowano stawkę VAT 0%', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->Cell(85, 1, 'VAT is 0% for all invoice items', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->Cell(85, 1, 'Zgodnie z art. 41 ust. 3 ustawy o podatku VAT', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(16);
|
||||
|
||||
//$pdf->SetX(10);
|
||||
//$pdf->SetFont('arialpl', '', '7');
|
||||
//
|
||||
//$pdf->Cell(95, 1, "...............................................................", 0, 0, 'L', 1);
|
||||
//$pdf->Cell(95, 1, "...............................................................", 0, 0, 'R', 1);
|
||||
//
|
||||
//$pdf->Ln(4);
|
||||
//
|
||||
//$pdf->SetX(10);
|
||||
//$pdf->Cell(43, 1, $mod_strings['LBL_PDF_OWNER_SIGNATURE'] . '/' . $mod_strings2['LBL_PDF_OWNER_SIGNATURE'], 0, 0, 'C', 1);
|
||||
//
|
||||
//$pdf->SetX(162);
|
||||
//$pdf->Cell(35, 1, $mod_strings['LBL_PDF_RECEIVER_SIGNATURE'], 0, 0, 'C', 1);
|
||||
//
|
||||
//$pdf->Ln(4);
|
||||
//$pdf->SetX(10);
|
||||
//$pdf->Cell(43, 1, $this->setUser()->full_name, 0, 0, 'C', 1);
|
||||
|
||||
//footer text
|
||||
$pdf->Ln(18);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->MultiCell(0, 4, $this->footer_text, 0, 'J');
|
||||
|
||||
//header text
|
||||
$pdf->Ln(6);
|
||||
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->MultiCell(0, 4, $this->ads_text, 0, 'J');
|
||||
1420
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/_subheader_e.php
Executable file
1420
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/_subheader_e.php
Executable file
File diff suppressed because it is too large
Load Diff
1425
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/_subheader_k.php
Executable file
1425
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/_subheader_k.php
Executable file
File diff suppressed because it is too large
Load Diff
1420
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/_subheader_u.php
Executable file
1420
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/_subheader_u.php
Executable file
File diff suppressed because it is too large
Load Diff
84
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/footer.en.php
Executable file
84
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/footer.en.php
Executable file
@@ -0,0 +1,84 @@
|
||||
<?
|
||||
error_reporting ( 0 );
|
||||
|
||||
$r = mysql_fetch_array ( mysql_query ( "select document_no, ecmlanguage from " . strtolower ( $_REQUEST ['module'] ) . " where id='" . $_REQUEST ['record'] . "'" ) );
|
||||
$this->SetFont ( 'arialpl', '', 8 );
|
||||
$this->SetY ( $this->fh - 15 );
|
||||
|
||||
$this->SetDrawColor ( 0, 0, 0 );
|
||||
$this->SetFillColor ( 255, 255, 255 );
|
||||
$this->Rect ( 0, $this->getBreakLine (), $this->fw, $this->bMargin + 1, "F" );
|
||||
|
||||
$this->SetDrawColor ( 0, 0, 0 );
|
||||
$this->Cell ( 0, 10, $this->PageNo () . '/{nb}' );
|
||||
|
||||
$this->Ln ( 5 );
|
||||
$this->AliasNbPages ();
|
||||
$this->SetLineWidth ();
|
||||
$this->SetDrawColor ( 0, 0, 0 );
|
||||
$this->Line ( $this->lMargin, - 17 - 16 + 1, $this->fw - $this->rMargin, - 17 - 16 + 1 );
|
||||
|
||||
if ($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->SetXY ( $this->lMargin, - 20 - 16 );
|
||||
|
||||
$this->Line(10,$this->fh-37,200,$this->fh-37);
|
||||
|
||||
|
||||
$this->SetFont ( 'arialpl', '', '7' );
|
||||
$this->Cell ( 110, 4, 'e5 Polska Sp. z o.o.' );
|
||||
$this->SetFont ( 'arialpl', 'B', '7' );
|
||||
$this->Cell ( 20, 4, 'Bank: ' );
|
||||
$this->SetFont ( 'arialpl', '', '7' );
|
||||
$this->Cell ( 45, 4, 'BANK MILLENIUM', 0, 0, 'L' );
|
||||
$this->Ln ();
|
||||
|
||||
$this->SetFont ( 'arialpl', '', '7' );
|
||||
$this->Cell ( 110, 4, 'ul. Wąwozowa 11, 02-796 Warszawa, Poland' );
|
||||
$this->SetFont ( 'arialpl', 'B', '7' );
|
||||
$this->Cell ( 20, 4, 'Bank IBAN: ' );
|
||||
$this->SetFont ( 'arialpl', '', '7' );
|
||||
$this->Cell ( 45, 4, 'PL36116022020000000064080587', 0, 0, 'L' );
|
||||
$this->Ln ();
|
||||
|
||||
$this->SetFont ( 'arialpl', '', '7' );
|
||||
$this->Cell ( 110, 4, '22 228 20 90');
|
||||
|
||||
$this->SetFont ( 'arialpl', 'B', '7' );
|
||||
$this->Cell ( 20, 4, 'Bank SWIFT: ' );
|
||||
$this->SetFont ( 'arialpl', '', '7' );
|
||||
$this->Cell ( 45, 4, "BIGBPLPW", 0, 0, 'L' );
|
||||
|
||||
$this->Ln ();
|
||||
|
||||
$this->SetFont ( 'arialpl', '', '7' );
|
||||
$this->Cell ( 110, 4, '+ 48 (56) 674 60 47' );
|
||||
$this->SetFont ( 'arialpl', 'B', '7' );
|
||||
$this->Cell ( 20, 4, 'KRS: ' );
|
||||
$this->SetFont ( 'arialpl', '', '7' );
|
||||
$this->Cell ( 45, 4, '28207', 0, 0, 'L' );
|
||||
$this->Ln ();
|
||||
|
||||
$this->SetFont ( 'arialpl', '', '7' );
|
||||
$this->Cell ( 110, 4, 'www.e5.pl' );
|
||||
$this->SetFont ( 'arialpl', 'B', '7' );
|
||||
$this->Cell ( 20, 4, 'NIP: ' );
|
||||
$this->SetFont ( 'arialpl', '', '7' );
|
||||
$this->Cell ( 45, 4, 'PL 525-21-73-990', 0, 0, 'L' );
|
||||
$this->Ln ();
|
||||
|
||||
$this->SetFont ( 'arialpl', '', '7' );
|
||||
$this->Cell ( 110, 4, '' );
|
||||
$this->SetFont ( 'arialpl', 'B', '7' );
|
||||
$this->Cell ( 20, 4, 'REGON: ' );
|
||||
$this->SetFont ( 'arialpl', '', '7' );
|
||||
$this->Cell ( 45, 4, '016280234', 0, 0, 'L' );
|
||||
$this->Ln ();
|
||||
|
||||
$this->SetFont ( "arialpl", "B", 8 );
|
||||
$this->SetXY ( 40, $this->GetY () + 1 );
|
||||
|
||||
$this->Cell ( 45, 4, $r ['document_no'], 0, 0, 'L' );
|
||||
?>
|
||||
51
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/footer.php
Executable file
51
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/footer.php
Executable file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
//if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
if ($this->page > 1) {
|
||||
$y = $this->fh - 20;
|
||||
$this->Line(10, $y, 200, $y);
|
||||
|
||||
$this->SetFont('arialpl', '', 10);
|
||||
|
||||
$this->SetXY(10, $this->fh - 16);
|
||||
$this->Cell(10, 0, $mod_strings['LBL_PDF_FOOTER_DOCUMENT_NAME'].' '.$this->focus->document_no);
|
||||
|
||||
$this->SetXY($this->fw-25,$this->fh-16);
|
||||
$this->Cell(10, 0, $mod_strings['LBL_PDF_SITE'].' '.$this->PageNo().'/{nb}');
|
||||
} else {
|
||||
$y = $this->fh - 20;
|
||||
$this->Line(10, $y, 200, $y);
|
||||
$this->SetFont('arialpl', '', 7.5);
|
||||
|
||||
$this->SetXY(10, $this->fh - 16);
|
||||
$this->Cell(49, 0, "Prezes Zarządu - J.Lasowy");
|
||||
$this->Cell(40, 0, "NIP: 879-016-88-72");
|
||||
$this->Cell(50, 0, "Sąd Rejonowy w Toruniu");
|
||||
|
||||
if($this->focus->currency_symbol == 'EUR')
|
||||
$this->Cell(30, 0, "Bank: City Handlowy");
|
||||
else
|
||||
$this->Cell(30, 0, "Konto: Alior Bank S.A. Oddział w Toruniu");
|
||||
|
||||
$this->SetXY(10, $this->fh - 12.5);
|
||||
$this->Cell(49, 0, "Wiceprezes - M.Lasowy");
|
||||
$this->Cell(40, 0, "REGON: 870525737");
|
||||
$this->Cell(50, 0, "VII Wydział Gospodarczy KRS");
|
||||
|
||||
if($this->focus->currency_symbol == 'EUR')
|
||||
$this->Cell(30, 0, "IBAN: PL 02 1030 1090 0000 0000 5802 0503");
|
||||
else
|
||||
$this->Cell(30, 0, "14 2490 0005 0000 4530 1266 3471");
|
||||
|
||||
$this->SetXY(10, $this->fh - 9);
|
||||
$this->Cell(49, 0, "");
|
||||
$this->Cell(40, 0, "Kapitał zakładowy 50 000 PLN");
|
||||
$this->Cell(50, 0, "KRS 0000160548");
|
||||
|
||||
if($this->focus->currency_symbol == 'EUR')
|
||||
$this->Cell(30, 0, "SWITF: CITIPLPX");
|
||||
|
||||
$this->SetXY($this->fw-22,$this->fh-7);
|
||||
$this->Cell(10, 0, $mod_strings['LBL_PDF_SITE'].' '.$this->PageNo().'/{nb}');
|
||||
}
|
||||
47
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/footer.pl.php
Executable file
47
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/footer.pl.php
Executable file
@@ -0,0 +1,47 @@
|
||||
<?
|
||||
|
||||
error_reporting ( 0 );
|
||||
|
||||
$r = mysql_fetch_array ( mysql_query ( "select document_no, ecmlanguage from " . strtolower ( $_REQUEST ['module'] ) . " where id='" . $_REQUEST ['record'] . "'" ) );
|
||||
$this->SetFont ( 'arialpl', '', 8 );
|
||||
$this->SetY ( $this->fh - 15 );
|
||||
|
||||
$this->SetDrawColor ( 0, 0, 0 );
|
||||
$this->SetFillColor ( 255, 255, 255 );
|
||||
$this->Rect ( 0, $this->getBreakLine (), $this->fw, $this->bMargin + 1, "F" );
|
||||
|
||||
$this->SetDrawColor ( 0, 0, 0 );
|
||||
$this->Cell ( 0, 10, $this->PageNo () . '/{nb}' );
|
||||
|
||||
$this->Ln ( 5 );
|
||||
$this->AliasNbPages ();
|
||||
$this->SetLineWidth ();
|
||||
$this->SetDrawColor ( 0, 0, 0 );
|
||||
$this->Line ( $this->lMargin, - 17 - 16 + 1, $this->fw - $this->rMargin, - 17 - 16 + 1 );
|
||||
|
||||
if ($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
|
||||
return;
|
||||
}
|
||||
$doc = new EcmDocumentTemplate();
|
||||
$doc->retrieve('97700b0d-fbe9-e366-4016-4b260f058a47');
|
||||
$this->SetXY ( $this->lMargin, - 20 - 16 );
|
||||
|
||||
$this->Line(10,$this->fh-37,200,$this->fh-37);
|
||||
|
||||
$this->SetFont ( 'arialpl', '', '7' );
|
||||
$this->Cell ( 110, 4,$doc->name );
|
||||
$this->SetFont ( 'arialpl', 'B', '7' );
|
||||
$this->Cell ( 20, 4, 'Bank: ' );
|
||||
$this->SetFont ( 'arialpl', '', '7' );
|
||||
$this->Cell ( 45, 4, 'PKO BP SA', 0, 0, 'L' );
|
||||
$this->Ln ();
|
||||
|
||||
$this->SetFont ( 'arialpl', '', '7' );
|
||||
$this->Cell ( 110, 4, $doc->footer_address );
|
||||
$this->SetFont ( 'arialpl', 'B', '7' );
|
||||
$this->Cell ( 20, 4, 'Numer konta: ' );
|
||||
$this->SetFont ( 'arialpl', '', '7' );
|
||||
$this->Cell ( 45, 4, '53 1020 5011 0000 9002 0270 6323', 0, 0, 'L' );
|
||||
$this->Ln ();
|
||||
|
||||
?>
|
||||
41
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/header.php
Executable file
41
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/header.php
Executable file
@@ -0,0 +1,41 @@
|
||||
<?
|
||||
set_time_limit(99999);
|
||||
error_reporting(0);
|
||||
$mod_strings = return_module_language($this->ecmlanguage, 'EcmSales', true);
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '' && file_exists($this->edt->logo_path)){
|
||||
$this->Image($this->edt->logo_path,15,5,0,23);
|
||||
}
|
||||
|
||||
$this->SetFont('arialpl', '', 10);
|
||||
// get document
|
||||
$doc = new EcmDocumentTemplate();
|
||||
$doc->retrieve('97700b0d-fbe9-e366-4016-4b260f058a47');
|
||||
$footer_address = explode(",", $doc->footer_address);
|
||||
// owner title
|
||||
|
||||
$this->SetXY(15+30,5);
|
||||
$this->SetFont ( 'arialpl', 'B', '10' );
|
||||
$this->Cell ( 110, 4, $mod_strings['LBL_PDF_TITLE_PROFORMA']);
|
||||
$this->Ln ();
|
||||
$this->SetXY(15+30,10);
|
||||
$this->SetFont ( 'arialpl', '', '10' );
|
||||
$this->Cell ( 110, 4, $doc->name);
|
||||
|
||||
$this->Ln ();
|
||||
$this->SetXY(15+30,14);
|
||||
$this->Cell ( 110, 4,$footer_address[0]);
|
||||
$this->Ln ();
|
||||
$this->SetXY(15+30,18);
|
||||
$this->Cell ( 110, 4,$footer_address[1] );
|
||||
$this->Ln ();
|
||||
$this->SetXY(15+30,22);
|
||||
$this->Cell ( 20, 4, 'NIP: '.$doc->footer_nip );
|
||||
$this->Ln ();
|
||||
|
||||
$this->Line(10,30,200,30);
|
||||
|
||||
?>
|
||||
114
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subfooter.php
Executable file
114
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subfooter.php
Executable file
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
//payment conditions
|
||||
|
||||
/*
|
||||
if (!empty($this->ecmpaymentcondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->MultiCell(0, 4, $this->ecmpaymentcondition_text, 0, 'L');
|
||||
$pdf->Ln();
|
||||
}
|
||||
*/
|
||||
/*
|
||||
if ($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl', 'b', '12');
|
||||
$pdf->Ln(3);
|
||||
$pdf->MultiCell(0, 4, $mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . " " . format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))) . ' ' . $this->currency_symbol);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
*/
|
||||
|
||||
$pdf->writeHTML('</table>'); // fix background-color overflowing from table ... why ? //
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
if ($pdf->GetY() > 240)
|
||||
$pdf->AddPage();
|
||||
|
||||
if ($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$w = $GLOBALS['db']->query("select price,ecmvat_value,quantity,ecminvoiceoutitem_id from ecminvoiceoutitems where ecminvoiceout_id='" . $this->id . "'");
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$total+=$r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
$rr = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select price,quantity,ecmvat_value from ecminvoiceoutitems where id='" . $r['ecminvoiceoutitem_id'] . "'"));
|
||||
$total-=$rr['price'] * $rr['quantity'] + round($rr['price'] * $rr['quantity'] * $rr['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
//if($total>0)$string=$mod_strings['LBL_PDF_TO_PAID'];
|
||||
//else $string=$mod_strings['LBL_PDF_TO_PAID_BACK'];
|
||||
|
||||
$string = "Do zapłaty:";
|
||||
$pdf->Cell(30, 4, $string, 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number(abs($total)) . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
|
||||
} else {
|
||||
$total = 0;
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$w = $GLOBALS['db']->query("select price,ecmvat_value,quantity,ecminvoiceoutitem_id from ecminvoiceoutitems where ecminvoiceout_id='" . $this->id . "'");
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$total+=$r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
$total-=floatval(str_replace(",", ".", str_replace(".", "", $this->discount)));
|
||||
$total = format_number($total);
|
||||
$pdf->Cell(30, 4, "Do zapłaty: ", 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, $total, 0, 0, 'L', 1);
|
||||
}
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(30, 4, "Słownie:", 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
|
||||
if ($this->type == "correct") {
|
||||
$tot = format_number(abs((float) $total));
|
||||
$tot = str_replace(".", "", $tot);
|
||||
//$tot=str_replace(",",".",$tot);
|
||||
$sl = $this->slowniePL($tot);
|
||||
} else {
|
||||
$tot = str_replace(".", "", str_replace("PLN", "", $total));
|
||||
$sl = $this->slowniePL($tot);
|
||||
}
|
||||
|
||||
if ($this->document_no == "FV 1421/10")
|
||||
$sl = "one thousand one hundred six EUR 41/100";
|
||||
|
||||
$pdf->Cell(150, 4, $sl, 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(10);
|
||||
$pdf->Cell(85, 1, 'Dla wszystkich pozycji faktury zastosowano stawkę VAT 0%', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(85, 1, 'VAT is 0% for all invoice items', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(85, 1, 'Zgodnie z art. 41 ust. 3 ustawy o podatku VAT', 0, 0, 'L', 1);
|
||||
|
||||
|
||||
$pdf->Ln(20);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '7');
|
||||
$pdf->Cell(85, 1, "...............................................................", 0, 0, 'L', 1);
|
||||
$pdf->Cell(85, 1, "...............................................................", 0, 0, 'R', 1);
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(43, 1, "Podpis wystawcy", 0, 0, 'C', 1);
|
||||
$pdf->SetX(155);
|
||||
$pdf->Cell(35, 1, "Podpis odbiorcy", 0, 0, 'C', 1);
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(43, 1, $this->setUser()->full_name, 0, 0, 'C', 1);
|
||||
|
||||
//footer text
|
||||
$pdf->Ln(18);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->MultiCell(0, 4, $this->footer_text, 0, 'J');
|
||||
|
||||
//header text
|
||||
$pdf->Ln(6);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->MultiCell(0, 4, $this->ads_text, 0, 'J');
|
||||
255
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subfooter_e.php
Executable file
255
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subfooter_e.php
Executable file
@@ -0,0 +1,255 @@
|
||||
<?php
|
||||
|
||||
//payment conditions
|
||||
//
|
||||
//if (!empty($this->ecmpaymentcondition_text)) {
|
||||
// $pdf->Ln(4);
|
||||
// $pdf->SetFont('arialpl', '', '8');
|
||||
// $pdf->MultiCell(0, 4, $this->ecmpaymentcondition_text, 0, 'L');
|
||||
// $pdf->Ln();
|
||||
//}
|
||||
//
|
||||
//if ($this->type == "correct") {
|
||||
// $pdf->SetFont('arialpl', 'b', '12');
|
||||
// $pdf->Ln(3);
|
||||
// $pdf->MultiCell(0, 4, $mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . '/' . $mod_strings2['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . " " . format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))) . ' ' . $this->currency_symbol);
|
||||
// $pdf->Ln(3);
|
||||
//}
|
||||
|
||||
$pdf->writeHTML('</table>'); // fix background-color overflowing FROM table ... why ? //
|
||||
|
||||
if ($this->type == "correct") {
|
||||
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
|
||||
$w = $GLOBALS['db']->query($qw);
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$qrr = "SELECT price, quantity, ecmvat_value FROM ecminvoiceoutitems WHERE id = '" . $r['ecminvoiceoutitem_id'] . "'";
|
||||
$rr_prepayment = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query($qrr));
|
||||
|
||||
$total += $r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
$total -= $rr_prepayment['price'] * $rr_prepayment['quantity'] + round($rr_prepayment['price'] * $rr_prepayment['quantity'] * $rr_prepayment['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
$total -= $this->paid_val;
|
||||
|
||||
if ($total > 0) {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID'] . '/' . $mod_strings2['LBL_PDF_TO_PAID'];
|
||||
} else {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'] . '/' . $mod_strings2['LBL_PDF_TO_PAID_BACK'];
|
||||
}
|
||||
|
||||
$total = format_number(abs($total));
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(50, 4, 'Razem do zapłaty:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
|
||||
} else {
|
||||
$total = 0;
|
||||
|
||||
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
|
||||
$w = $GLOBALS['db']->query($qw);
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$total+=$r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
$total-=floatval(str_replace(",", ".", str_replace(".", "", $this->discount)));
|
||||
|
||||
//$total -= $this->paid_val;
|
||||
|
||||
if ($total > 0) {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID'] . '/' . $mod_strings2['LBL_PDF_TO_PAID'];
|
||||
} else {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'] . '/' . $mod_strings2['LBL_PDF_TO_PAID_BACK'];
|
||||
}
|
||||
|
||||
$total = format_number(abs($total));
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(50, 4, 'Razem do zapłaty/Total to pay:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
}
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
if ($this->prepaid) {
|
||||
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID_DOCUMENTS'] . '/' . $mod_strings2['LBL_PDF_PREPAID_DOCUMENTS'] . ':', 0, 0, 'L', 1);
|
||||
// $pdf->Cell(30, 4, implode(', ', $rr_prepayment), 0, 0, 'L', 1);
|
||||
//
|
||||
// $pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID'] . '/' . $mod_strings2['LBL_PDF_PREPAID'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($this->prepaid) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
}
|
||||
|
||||
//$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAID'] . '/' . $mod_strings2['LBL_PDF_PAID'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($this->paid_val) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
|
||||
if($this->paid_val > 0) {
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml($app_list_strings['payment_method_dom'][$this->payment_method_paid] . '/' . $lv['payment_method_dom'][$this->payment_method_paid]);
|
||||
}
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
//if ($pdf->GetY() > 240) {
|
||||
// $pdf->AddPage();
|
||||
//}
|
||||
|
||||
$total -= ($this->paid_val);
|
||||
|
||||
$pleft = $brutto - $this->prepaid - $this->paid_val;
|
||||
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$pdf->Cell(50, 4, 'Pozostało do zapłaty/To pay:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number(($pleft < 0) ? 0 : $pleft). ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
$pdf->writeHTML('</b>');
|
||||
|
||||
if($pleft > 0) {
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml(sprintf($mod_strings['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $app_list_strings['payment_method_dom'][$this->payment_method]));
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml(sprintf($mod_strings2['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $lv['payment_method_dom'][$this->payment_method]));
|
||||
|
||||
//echo '<pre>' . var_export($cx, true) . '</pre>';
|
||||
//echo '<pre>' . var_export($cy, true) . '</pre>'; exit;
|
||||
}
|
||||
|
||||
//$pdf->Ln(4);
|
||||
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//
|
||||
//if (false == is_null($pc)) {
|
||||
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_METHOD'] . ':', 0, 0, 'L', 1);
|
||||
// $pdf->Cell(50, 4, $pc->name ? : '-', 0, 0, 'L', 1);
|
||||
//
|
||||
// $pdf->Ln(4);
|
||||
//}
|
||||
//
|
||||
//$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_TERMIN'] . ':', 0, 0, 'L', 1);
|
||||
//$pdf->Cell(50, 4, $this->payment_date ? : '-', 0, 0, 'L', 1);
|
||||
//
|
||||
//$pdf->Ln(4);
|
||||
//
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//$pdf->Cell(30, 4, "Słownie:", 0, 0, 'L', 1);
|
||||
//$pdf->SetFont('arialpl', 'B', '8');
|
||||
//
|
||||
//if ($this->type == "correct") {
|
||||
// $tot = format_number(abs((float) $total - array_sum($inv_value)));
|
||||
// $tot = str_replace(".", "", $tot);
|
||||
// //$tot=str_replace(",",".",$tot);
|
||||
// $sl = $this->slowniePL($tot);
|
||||
//} else {
|
||||
// $tot = str_replace(".", "", str_replace("PLN", "", $total - array_sum($inv_value)));
|
||||
// $sl = $this->slowniePL($tot);
|
||||
//}
|
||||
//
|
||||
//if ($this->document_no == "FV 1421/10") {
|
||||
// $sl = "one thousand one hundred six EUR 41/100";
|
||||
//}
|
||||
//
|
||||
//$pdf->Cell(150, 4, $sl, 0, 0, 'L', 1);
|
||||
|
||||
//echo '<pre>' . var_export(format_number('9.9999', 4, 4), true) . '</pre>'; exit;
|
||||
//echo '<pre>' . var_export(gettype((double)$this->currency_value), true) . '</pre>'; exit;
|
||||
|
||||
if ($this->currency_value > 1 && $this->currency_symbol != 'EUR') {
|
||||
$pdf->Ln(8);
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->WriteHtml(sprintf('Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. wystawienia faktury: 1 %s = %s %s', $this->currency_symbol, format_number($this->currency_value, 4, 4), 'PLN'));
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->WriteHtml(sprintf('Prices are calculated by currency exchange rates of City Handlowy bank dated by invoice sale date: 1 %s = %s %s', $this->currency_symbol, format_number($this->currency_value, 4, 4), 'PLN'));
|
||||
|
||||
|
||||
//$pdf->Cell(50, 4, 'Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. wystawienia faktury: ' , 0, 0, 'L', 1); // $mod_strings['LBL_CURRENCY_VALUE'] . ':'
|
||||
//$pdf->Cell(30, 4, '1 ' . $this->currency_symbol . ' = ' . format_number($this->currency_value, 4, 4) . ' zł', 0, 0, 'R', 1);
|
||||
}
|
||||
|
||||
$pdf->Ln(8);
|
||||
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetX(10);
|
||||
$pdf->Cell(85, 1, 'Dla wszystkich pozycji faktury zastosowano stawkę VAT 0%', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->Cell(85, 1, 'VAT is 0% for all invoice items', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->Cell(85, 1, 'Zgodnie z art. 41 ust. 4 ustawy o podatku VAT', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(16);
|
||||
|
||||
//$pdf->SetX(10);
|
||||
//$pdf->SetFont('arialpl', '', '7');
|
||||
//
|
||||
//$pdf->Cell(95, 1, "...............................................................", 0, 0, 'L', 1);
|
||||
//$pdf->Cell(95, 1, "...............................................................", 0, 0, 'R', 1);
|
||||
//
|
||||
//$pdf->Ln(4);
|
||||
//
|
||||
//$pdf->SetX(10);
|
||||
//$pdf->Cell(43, 1, $mod_strings['LBL_PDF_OWNER_SIGNATURE'] . '/' . $mod_strings2['LBL_PDF_OWNER_SIGNATURE'], 0, 0, 'C', 1);
|
||||
//
|
||||
//$pdf->SetX(162);
|
||||
//$pdf->Cell(35, 1, $mod_strings['LBL_PDF_RECEIVER_SIGNATURE'], 0, 0, 'C', 1);
|
||||
//
|
||||
//$pdf->Ln(4);
|
||||
//$pdf->SetX(10);
|
||||
//$pdf->Cell(43, 1, $this->setUser()->full_name, 0, 0, 'C', 1);
|
||||
|
||||
//footer text
|
||||
$pdf->Ln(18);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->MultiCell(0, 4, $this->footer_text, 0, 'J');
|
||||
|
||||
//header text
|
||||
$pdf->Ln(6);
|
||||
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->MultiCell(0, 4, $this->ads_text, 0, 'J');
|
||||
244
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subfooter_exp.php
Executable file
244
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subfooter_exp.php
Executable file
@@ -0,0 +1,244 @@
|
||||
<?php
|
||||
|
||||
//payment conditions
|
||||
//
|
||||
//if (!empty($this->ecmpaymentcondition_text)) {
|
||||
// $pdf->Ln(4);
|
||||
// $pdf->SetFont('arialpl', '', '8');
|
||||
// $pdf->MultiCell(0, 4, $this->ecmpaymentcondition_text, 0, 'L');
|
||||
// $pdf->Ln();
|
||||
//}
|
||||
//
|
||||
//if ($this->type == "correct") {
|
||||
// $pdf->SetFont('arialpl', 'b', '12');
|
||||
// $pdf->Ln(3);
|
||||
// $pdf->MultiCell(0, 4, $mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . " " . format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))) . ' ' . $this->currency_symbol);
|
||||
// $pdf->Ln(3);
|
||||
//}
|
||||
|
||||
$pdf->writeHTML('</table>'); // fix background-color overflowing FROM table ... why ? //
|
||||
|
||||
/*
|
||||
if ($this->type == "correct") {
|
||||
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
|
||||
$w = $GLOBALS['db']->query($qw);
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$qrr = "SELECT price, quantity, ecmvat_value FROM ecminvoiceoutitems WHERE id = '" . $r['ecminvoiceoutitem_id'] . "'";
|
||||
$rr_prepayment = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query($qrr));
|
||||
|
||||
$total += $r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
$total -= $rr_prepayment['price'] * $rr_prepayment['quantity'] + round($rr_prepayment['price'] * $rr_prepayment['quantity'] * $rr_prepayment['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
$total -= $this->paid_val;
|
||||
|
||||
if ($total > 0) {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID'];
|
||||
} else {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'];
|
||||
}
|
||||
|
||||
$total = format_number(abs($total));
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(50, 4, 'Razem do zapłaty:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
|
||||
} else {
|
||||
$total = 0;
|
||||
|
||||
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
|
||||
$w = $GLOBALS['db']->query($qw);
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$total+=$r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
$total-=floatval(str_replace(",", ".", str_replace(".", "", $this->discount)));
|
||||
|
||||
//$total -= $this->paid_val;
|
||||
|
||||
if ($total > 0) {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID'];
|
||||
} else {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'];
|
||||
}
|
||||
|
||||
$total = format_number(abs($total));
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(50, 4, 'Razem do zapłaty:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
}
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
if ($this->prepaid) {
|
||||
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID_DOCUMENTS'] . ':', 0, 0, 'L', 1);
|
||||
// $pdf->Cell(30, 4, implode(', ', $rr_prepayment), 0, 0, 'L', 1);
|
||||
//
|
||||
// $pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($this->prepaid) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
}
|
||||
|
||||
//$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAID'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($this->paid_val) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
|
||||
if($this->paid_val > 0) {
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml($app_list_strings['payment_method_dom'][$this->payment_method_paid]);
|
||||
}
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
//if ($pdf->GetY() > 240) {
|
||||
// $pdf->AddPage();
|
||||
//}
|
||||
|
||||
$total -= ($this->paid_val);
|
||||
|
||||
//var_export($numberLength);
|
||||
//var_export($fNumber);
|
||||
|
||||
//var_export(str_pad(format_number($this->paid_val), $numberLength, '_', STR_PAD_LEFT));
|
||||
//var_export(implode(array_fill(0, 10 - 5, ' ')) . format_number($pleft));exit;
|
||||
|
||||
|
||||
if(($pleft = $brutto - $this->prepaid - $this->paid_val) > 0) {
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$pdf->Cell(50, 4, 'Pozostało do zapłaty:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($pleft) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml(sprintf($mod_strings['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $app_list_strings['payment_method_dom'][$this->payment_method]));
|
||||
|
||||
//$pdf->Ln(4);
|
||||
|
||||
//$pdf->SetX(90);
|
||||
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//$pdf->WriteHtml(sprintf($mod_strings2['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $this->payment_method));
|
||||
|
||||
//echo '<pre>' . var_export($cx, true) . '</pre>';
|
||||
//echo '<pre>' . var_export($cy, true) . '</pre>'; exit;
|
||||
}
|
||||
|
||||
//$pdf->Ln(4);
|
||||
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//
|
||||
//if (false == is_null($pc)) {
|
||||
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_METHOD'] . ':', 0, 0, 'L', 1);
|
||||
// $pdf->Cell(50, 4, $pc->name ? : '-', 0, 0, 'L', 1);
|
||||
//
|
||||
// $pdf->Ln(4);
|
||||
//}
|
||||
//
|
||||
//$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_TERMIN'] . ':', 0, 0, 'L', 1);
|
||||
//$pdf->Cell(50, 4, $this->payment_date ? : '-', 0, 0, 'L', 1);
|
||||
//
|
||||
//$pdf->Ln(4);
|
||||
//
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//$pdf->Cell(30, 4, "Słownie:", 0, 0, 'L', 1);
|
||||
//$pdf->SetFont('arialpl', 'B', '8');
|
||||
//
|
||||
//if ($this->type == "correct") {
|
||||
// $tot = format_number(abs((float) $total - array_sum($inv_value)));
|
||||
// $tot = str_replace(".", "", $tot);
|
||||
// //$tot=str_replace(",",".",$tot);
|
||||
// $sl = $this->slowniePL($tot);
|
||||
//} else {
|
||||
// $tot = str_replace(".", "", str_replace("PLN", "", $total - array_sum($inv_value)));
|
||||
// $sl = $this->slowniePL($tot);
|
||||
//}
|
||||
//
|
||||
//if ($this->document_no == "FV 1421/10") {
|
||||
// $sl = "one thousand one hundred six EUR 41/100";
|
||||
//}
|
||||
//
|
||||
//$pdf->Cell(150, 4, $sl, 0, 0, 'L', 1);
|
||||
|
||||
//echo '<pre>' . var_export(format_number('9.9999', 4, 4), true) . '</pre>'; exit;
|
||||
//echo '<pre>' . var_export(gettype((double)$this->currency_value), true) . '</pre>'; exit;
|
||||
|
||||
if ($this->currency_value > 1 && $this->currency_symbol != 'EUR') {
|
||||
$pdf->Ln(8);
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->WriteHtml(sprintf('Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. %s: 1 %s = %s %s', 'EUR', date('Y-m-d'), format_number($this->currency_value, 4, 4), $this->currency_symbol));
|
||||
|
||||
|
||||
//$pdf->Cell(50, 4, 'Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. wystawienia faktury: ' , 0, 0, 'L', 1); // $mod_strings['LBL_CURRENCY_VALUE'] . ':'
|
||||
//$pdf->Cell(30, 4, '1 ' . $this->currency_symbol . ' = ' . format_number($this->currency_value, 4, 4) . ' zł', 0, 0, 'R', 1);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
$pdf->Ln(28);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '7');
|
||||
|
||||
$pdf->Cell(95, 1, "...............................................................", 0, 0, 'L', 1);
|
||||
$pdf->Cell(95, 1, "...............................................................", 0, 0, 'R', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->Cell(43, 1, $mod_strings['LBL_PDF_OWNER_SIGNATURE'], 0, 0, 'C', 1);
|
||||
|
||||
$pdf->SetX(162);
|
||||
$pdf->Cell(35, 1, $mod_strings['LBL_PDF_RECEIVER_SIGNATURE'], 0, 0, 'C', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetX(10);
|
||||
$pdf->Cell(43, 1, $this->setUser()->full_name, 0, 0, 'C', 1);
|
||||
|
||||
//footer text
|
||||
$pdf->Ln(18);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->MultiCell(0, 4, $this->footer_text, 0, 'J');
|
||||
|
||||
//header text
|
||||
$pdf->Ln(6);
|
||||
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->MultiCell(0, 4, $this->ads_text, 0, 'J');
|
||||
|
||||
/*
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
|
||||
$pdf->DeletePage(6);exit;
|
||||
*/
|
||||
262
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subfooter_k.php
Executable file
262
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subfooter_k.php
Executable file
@@ -0,0 +1,262 @@
|
||||
<?php
|
||||
|
||||
//echo __FILE__;
|
||||
//exit;
|
||||
|
||||
//payment conditions
|
||||
//
|
||||
//if (!empty($this->ecmpaymentcondition_text)) {
|
||||
// $pdf->Ln(4);
|
||||
// $pdf->SetFont('arialpl', '', '8');
|
||||
// $pdf->MultiCell(0, 4, $this->ecmpaymentcondition_text, 0, 'L');
|
||||
// $pdf->Ln();
|
||||
//}
|
||||
//
|
||||
//if ($this->type == "correct") {
|
||||
// $pdf->SetFont('arialpl', 'b', '12');
|
||||
// $pdf->Ln(3);
|
||||
// $pdf->MultiCell(0, 4, $mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . " " . format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))) . ' ' . $this->currency_symbol);
|
||||
// $pdf->Ln(3);
|
||||
//}
|
||||
|
||||
$pdf->writeHTML('</table>'); // fix background-color overflowing FROM table ... why ? //
|
||||
|
||||
if ($this->type == "correct") {
|
||||
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
|
||||
$w = $GLOBALS['db']->query($qw);
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$qrr = "SELECT price, quantity, ecmvat_value FROM ecminvoiceoutitems WHERE id = '" . $r['ecminvoiceoutitem_id'] . "'";
|
||||
$rr_prepayment = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query($qrr));
|
||||
|
||||
$total += $r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
$total -= $rr_prepayment['price'] * $rr_prepayment['quantity'] + round($rr_prepayment['price'] * $rr_prepayment['quantity'] * $rr_prepayment['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
$total -= $this->paid_val;
|
||||
|
||||
if ($total > 0) {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID'];
|
||||
} else {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'];
|
||||
}
|
||||
|
||||
$total = format_number(abs($total));
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(50, 4, 'Razem do zapłaty:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
|
||||
} else {
|
||||
$total = 0;
|
||||
|
||||
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
|
||||
$w = $GLOBALS['db']->query($qw);
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$total+=$r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
$total-=floatval(str_replace(",", ".", str_replace(".", "", $this->discount)));
|
||||
|
||||
//$total -= $this->paid_val;
|
||||
|
||||
if ($total > 0) {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID'];
|
||||
} else {
|
||||
$string = $mod_strings['LBL_PDF_TO_PAID_BACK'];
|
||||
}
|
||||
|
||||
$total = format_number(abs($total));
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(50, 4, 'Razem do zapłaty:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($brutto) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
}
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
if ($this->prepaid) {
|
||||
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID_DOCUMENTS'] . ':', 0, 0, 'L', 1);
|
||||
// $pdf->Cell(30, 4, implode(', ', $rr_prepayment), 0, 0, 'L', 1);
|
||||
//
|
||||
// $pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($this->prepaid) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
}
|
||||
|
||||
//$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAID'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($this->paid_val) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
|
||||
if($this->paid_val > 0) {
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml($app_list_strings['payment_method_dom'][$this->payment_method_paid]);
|
||||
}
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
//if ($pdf->GetY() > 240) {
|
||||
// $pdf->AddPage();
|
||||
//}
|
||||
|
||||
$total -= ($this->paid_val);
|
||||
|
||||
//var_export($numberLength);
|
||||
//var_export($fNumber);
|
||||
|
||||
//var_export(str_pad(format_number($this->paid_val), $numberLength, '_', STR_PAD_LEFT));
|
||||
//var_export(implode(array_fill(0, 10 - 5, ' ')) . format_number($pleft));exit;
|
||||
|
||||
$pleft = $brutto - $this->prepaid - $this->paid_val;
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$pdf->Cell(50, 4, 'Pozostało do zapłaty:', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number(($pleft < 0) ? 0 : $pleft) . ' ' . $this->currency_symbol, 0, 0, 'R', 1);
|
||||
$pdf->writeHTML('</b>');
|
||||
|
||||
if($pleft > 0) {
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$pdf->WriteHtml(sprintf($mod_strings['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $app_list_strings['payment_method_dom'][$this->payment_method]));
|
||||
|
||||
//$pdf->Ln(4);
|
||||
|
||||
//$pdf->SetX(90);
|
||||
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//$pdf->WriteHtml(sprintf($mod_strings2['LBL_PDF_PAYMENT_METHOD_PATTERN'], $this->payment_date_d, $this->payment_date, $this->payment_method));
|
||||
|
||||
//echo '<pre>' . var_export($cx, true) . '</pre>';
|
||||
//echo '<pre>' . var_export($cy, true) . '</pre>'; exit;
|
||||
}
|
||||
|
||||
//$pdf->Ln(4);
|
||||
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//
|
||||
//if (false == is_null($pc)) {
|
||||
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_METHOD'] . ':', 0, 0, 'L', 1);
|
||||
// $pdf->Cell(50, 4, $pc->name ? : '-', 0, 0, 'L', 1);
|
||||
//
|
||||
// $pdf->Ln(4);
|
||||
//}
|
||||
//
|
||||
//$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_TERMIN'] . ':', 0, 0, 'L', 1);
|
||||
//$pdf->Cell(50, 4, $this->payment_date ? : '-', 0, 0, 'L', 1);
|
||||
//
|
||||
//$pdf->Ln(4);
|
||||
//
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//$pdf->Cell(30, 4, "Słownie:", 0, 0, 'L', 1);
|
||||
//$pdf->SetFont('arialpl', 'B', '8');
|
||||
//
|
||||
//if ($this->type == "correct") {
|
||||
// $tot = format_number(abs((float) $total - array_sum($inv_value)));
|
||||
// $tot = str_replace(".", "", $tot);
|
||||
// //$tot=str_replace(",",".",$tot);
|
||||
// $sl = $this->slowniePL($tot);
|
||||
//} else {
|
||||
// $tot = str_replace(".", "", str_replace("PLN", "", $total - array_sum($inv_value)));
|
||||
// $sl = $this->slowniePL($tot);
|
||||
//}
|
||||
//
|
||||
//if ($this->document_no == "FV 1421/10") {
|
||||
// $sl = "one thousand one hundred six EUR 41/100";
|
||||
//}
|
||||
//
|
||||
//$pdf->Cell(150, 4, $sl, 0, 0, 'L', 1);
|
||||
|
||||
//echo '<pre>' . var_export(format_number('9.9999', 4, 4), true) . '</pre>'; exit;
|
||||
//echo '<pre>' . var_export(gettype((double)$this->currency_value_nbp), true) . '</pre>'; exit;
|
||||
|
||||
if ($this->currency_value_nbp > 1 && $this->currency_symbol != 'EUR') {
|
||||
$pdf->Ln(8);
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->WriteHtml(sprintf('Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. %s: 1 %s = %s %s', date('d.m.Y'), 'EUR', format_number($this->currency_value_nbp, 4, 4), $this->currency_symbol));
|
||||
|
||||
|
||||
//$pdf->Cell(50, 4, 'Ceny wyliczono wg kursu sprzedaży walut banku Citi Handlowego z dn. wystawienia faktury: ' , 0, 0, 'L', 1); // $mod_strings['LBL_CURRENCY_VALUE'] . ':'
|
||||
//$pdf->Cell(30, 4, '1 ' . $this->currency_symbol . ' = ' . format_number($this->currency_value_nbp, 4, 4) . ' zł', 0, 0, 'R', 1);
|
||||
}
|
||||
|
||||
//echo '<pre>' . var_export($calc, true) . '</pre>'; exit;
|
||||
//$cvatpln = '';
|
||||
|
||||
if($this->currency_value_nbp > 1 && $this->currency_symbol != 'PLN') {
|
||||
|
||||
$pdf->Ln(8);
|
||||
$pdf->Cell(85, 1, "Kurs 1 EUR = " . format_number($this->currency_value_nbp, 4, 4) . ' PLN', 0, 0, 'L', 1);
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(85, 1, "Wartość VAT = " . format_number($cVatPln) . ' PLN', 0, 0, 'L', 1);
|
||||
// $pdf->Ln(8);
|
||||
// $pdf->SetX(10);
|
||||
|
||||
// $pdf->WriteHtml(sprintf('Wartość VAT: %s PLN', format_number($cVatPln)));
|
||||
}
|
||||
|
||||
$pdf->Ln(18);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '7');
|
||||
|
||||
$pdf->Cell(95, 1, "...............................................................", 0, 0, 'L', 1);
|
||||
$pdf->Cell(95, 1, "...............................................................", 0, 0, 'R', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->Cell(43, 1, $mod_strings['LBL_PDF_OWNER_SIGNATURE'], 0, 0, 'C', 1);
|
||||
|
||||
$pdf->SetX(162);
|
||||
$pdf->Cell(35, 1, $mod_strings['LBL_PDF_RECEIVER_SIGNATURE'], 0, 0, 'C', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetX(10);
|
||||
$pdf->Cell(43, 1, $this->setUser()->full_name, 0, 0, 'C', 1);
|
||||
|
||||
//footer text
|
||||
$pdf->Ln(18);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->MultiCell(0, 4, $this->footer_text, 0, 'J');
|
||||
|
||||
//header text
|
||||
$pdf->Ln(6);
|
||||
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->MultiCell(0, 4, $this->ads_text, 0, 'J');
|
||||
|
||||
/*
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
|
||||
$pdf->DeletePage(6);exit;
|
||||
*/
|
||||
146
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subfooter_u.php
Executable file
146
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subfooter_u.php
Executable file
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
|
||||
//payment conditions
|
||||
|
||||
/*
|
||||
if (!empty($this->ecmpaymentcondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->MultiCell(0, 4, $this->ecmpaymentcondition_text, 0, 'L');
|
||||
$pdf->Ln();
|
||||
}
|
||||
*/
|
||||
/*
|
||||
if ($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl', 'b', '12');
|
||||
$pdf->Ln(3);
|
||||
$pdf->MultiCell(0, 4, $mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . " " . format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))) . ' ' . $this->currency_symbol);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
*/
|
||||
|
||||
$pdf->writeHTML('</table>'); // fix background-color overflowing from table ... why ? //
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(50, 4, 'Zapłacono/Paid:', 0, 0, 'L', 1);
|
||||
$pdf->Cell(50, 4, format_number(0) . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
if ($pdf->GetY() > 240)
|
||||
$pdf->AddPage();
|
||||
|
||||
if ($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$w = $GLOBALS['db']->query("select price,ecmvat_value,quantity,ecminvoiceoutitem_id from ecminvoiceoutitems where ecminvoiceout_id='" . $this->id . "'");
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$total+=$r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
$rr = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select price,quantity,ecmvat_value from ecminvoiceoutitems where id='" . $r['ecminvoiceoutitem_id'] . "'"));
|
||||
$total-=$rr['price'] * $rr['quantity'] + round($rr['price'] * $rr['quantity'] * $rr['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
//if($total>0)$string=$mod_strings['LBL_PDF_TO_PAID'];
|
||||
//else $string=$mod_strings['LBL_PDF_TO_PAID_BACK'];
|
||||
|
||||
$string = "Pozostało do zapłaty/To pay:";
|
||||
$pdf->Cell(50, 4, $string, 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(50, 4, format_number(abs($total)) . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
|
||||
} else {
|
||||
$total = 0;
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$w = $GLOBALS['db']->query("select price,ecmvat_value,quantity,ecminvoiceoutitem_id from ecminvoiceoutitems where ecminvoiceout_id='" . $this->id . "'");
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$total+=$r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
$total-=floatval(str_replace(",", ".", str_replace(".", "", $this->discount)));
|
||||
$total = format_number($total);
|
||||
$pdf->Cell(50, 4, "Pozostało do zapłaty/To pay: ", 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(50, 4, format_number($sum_total) . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
|
||||
}
|
||||
|
||||
$pdf->Ln(8);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
$paymentCondition = new EcmPaymentCondition();
|
||||
$paymentCondition->retrieve($this->ecmpaymentcondition_id);
|
||||
|
||||
$pdf->Cell(50, 4, 'Metoda płątności/Payment method:', 0, 0, 'L', 1);
|
||||
$pdf->Cell(50, 4, $this->payment_method ? : '-', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->Cell(50, 4, 'Termin płatności/Payment date:', 0, 0, 'L', 1);
|
||||
$pdf->Cell(50, 4, $this->payment_date, 0, 0, 'L', 1);
|
||||
|
||||
/*
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(30, 4, "Słownie:", 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
|
||||
if ($this->type == "correct") {
|
||||
$tot = format_number(abs((float) $total));
|
||||
$tot = str_replace(".", "", $tot);
|
||||
//$tot=str_replace(",",".",$tot);
|
||||
$sl = $this->slowniePL($tot);
|
||||
} else {
|
||||
$tot = str_replace(".", "", str_replace("PLN", "", $total));
|
||||
$sl = $this->slowniePL($tot);
|
||||
}
|
||||
|
||||
if ($this->document_no == "FV 1421/10")
|
||||
$sl = "one thousand one hundred six EUR 41/100";
|
||||
|
||||
*/
|
||||
|
||||
$pdf->Cell(150, 4, $sl, 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(8);
|
||||
$pdf->Cell(50, 4, 'Kurs waluty/Rate of exchange', 0, 0, 'L', 1);
|
||||
$pdf->Cell(50, 4, '1 EUR = ' . format_number($this->currency_value_nbp ? : 1, 4, 4) . ' PLN', 0, 0, 'L', 1);
|
||||
// $pdf->Cell(50, 4, format_number($this->currency_value_nbp ? : 1, 4, 4), 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
|
||||
$pdf->Cell(85, 1, 'Dla wszystkich pozycji faktury zastosowano stawkę VAT 0%', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(85, 1, 'VAT is 0% for all invoice items', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(85, 1, 'Zgodnie z art. 41 ust. 3 ustawy o podatku VAT', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(28);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '7');
|
||||
$pdf->Cell(85, 1, "...............................................................", 0, 0, 'L', 1);
|
||||
$pdf->Cell(85, 1, "...............................................................", 0, 0, 'R', 1);
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(43, 1, $mod_strings['LBL_PDF_OWNER_SIGNATURE'] . "/Owner signature", 0, 0, 'C', 1);
|
||||
$pdf->SetX(155);
|
||||
$pdf->Cell(35, 1, $mod_strings['LBL_PDF_RECEIVER_SIGNATURE'] . "/Receiver signature", 0, 0, 'C', 1);
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(43, 1, $this->setUser()->full_name, 0, 0, 'C', 1);
|
||||
|
||||
//footer text
|
||||
$pdf->Ln(18);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->MultiCell(0, 4, $this->footer_text, 0, 'J');
|
||||
|
||||
//header text
|
||||
$pdf->Ln(6);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->MultiCell(0, 4, $this->ads_text, 0, 'J');
|
||||
219
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subfooter_u3.php
Executable file
219
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subfooter_u3.php
Executable file
@@ -0,0 +1,219 @@
|
||||
<?php
|
||||
|
||||
//payment conditions
|
||||
//
|
||||
//if (!empty($this->ecmpaymentcondition_text)) {
|
||||
// $pdf->Ln(4);
|
||||
// $pdf->SetFont('arialpl', '', '8');
|
||||
// $pdf->MultiCell(0, 4, $this->ecmpaymentcondition_text, 0, 'L');
|
||||
// $pdf->Ln();
|
||||
//}
|
||||
//
|
||||
//if ($this->type == "correct") {
|
||||
// $pdf->SetFont('arialpl', 'b', '12');
|
||||
// $pdf->Ln(3);
|
||||
// $pdf->MultiCell(0, 4, $mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE'] . " " . format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))) . ' ' . $this->currency_symbol);
|
||||
// $pdf->Ln(3);
|
||||
//}
|
||||
|
||||
$pdf->writeHTML('</table>'); // fix background-color overflowing FROM table ... why ? //
|
||||
|
||||
$q = 'SELECT i.`document_no` FROM `ecmprepaymentinvoices` AS i WHERE i.`ecmsale_id` IN (SELECT DISTINCT(ii.`parent_doc_id`) FROM `ecminvoiceoutitems` AS ii JOIN `ecminvoiceouts` AS i ON ii.`ecminvoiceout_id` = i.`id` WHERE i.`id` = \'' . $this->id . '\' AND ii.`parent_doc_type` = \'EcmSales\');';
|
||||
$rr = $db->fetchByAssoc($db->query($q));
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
if ($rr) {
|
||||
$pdf->Cell(60, 4, $mod_strings['LBL_PDF_PREPAID_DOCUMENTS'] . '/' . $mod_strings2['LBL_PDF_PREPAID_DOCUMENTS'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->Cell(30, 4, implode(', ', $rr), 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PREPAID'] . '/' . $mod_strings2['LBL_PDF_PREPAID'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number(array_sum($inv_value)) . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
}
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAID'] . '/' . $mod_strings2['LBL_PDF_PAID'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number(0) . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
if ($pdf->GetY() > 240) {
|
||||
$pdf->AddPage();
|
||||
}
|
||||
|
||||
if ($this->type == "correct") {
|
||||
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
|
||||
$w = $GLOBALS['db']->query($qw);
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$qrr = "SELECT price, quantity, ecmvat_value FROM ecminvoiceoutitems WHERE id = '" . $r['ecminvoiceoutitem_id'] . "'";
|
||||
$rr = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query($qrr));
|
||||
|
||||
$total += $r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
$total -= $rr['price'] * $rr['quantity'] + round($rr['price'] * $rr['quantity'] * $rr['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
$total -= array_sum($inv_value);
|
||||
|
||||
$total = format_number(abs($total));
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_TO_PAID'] . '/' . $mod_strings2['LBL_PDF_TO_PAID']. ':', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, $total . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
|
||||
|
||||
if (false == is_null($pc)) {
|
||||
$pattern['pl_pl'] = 'w terminie <b>%s</b> dni do <b>%s</b> <b>%s</b>';
|
||||
$pattern['en_us'] = 'in <b>%s</b> days until <b>%s</b> <b>%s</b>';
|
||||
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml(sprintf($pattern['pl_pl'], $pc->days, $this->payment_date, $pc->name));
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml(sprintf($pattern['en_us'], $pc->days, $this->payment_date, $pc->name));
|
||||
|
||||
//echo '<pre>' . var_export($cx, true) . '</pre>';
|
||||
//echo '<pre>' . var_export($cy, true) . '</pre>'; exit;
|
||||
}
|
||||
} else {
|
||||
$total = 0;
|
||||
|
||||
$qw = "SELECT price, ecmvat_value, quantity, ecminvoiceoutitem_id FROM ecminvoiceoutitems WHERE ecminvoiceout_id = '" . $this->id . "'";
|
||||
$w = $GLOBALS['db']->query($qw);
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
$total+=$r['price'] * $r['quantity'] + round($r['price'] * $r['quantity'] * $r['ecmvat_value'] / 100, 2);
|
||||
}
|
||||
|
||||
$total-=floatval(str_replace(",", ".", str_replace(".", "", $this->discount)));
|
||||
|
||||
$total -= array_sum($inv_value);
|
||||
|
||||
$total = format_number(abs($total));
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_PDF_TO_PAID'] . '/' . $mod_strings2['LBL_PDF_TO_PAID'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, $total . ' ' . $this->currency_symbol, 0, 0, 'L', 1);
|
||||
|
||||
if (false == is_null($pc)) {
|
||||
$pattern['pl_pl'] = 'w terminie <b>%s</b> dni do <b>%s</b> <b>%s</b>';
|
||||
$pattern['en_us'] = 'in <b>%s</b> days until <b>%s</b> <b>%s</b>';
|
||||
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml(sprintf($pattern['pl_pl'], $pc->days, $this->payment_date, $pc->name));
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(100);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml(sprintf($pattern['en_us'], $pc->days, $this->payment_date, $pc->name));
|
||||
|
||||
//echo '<pre>' . var_export($cx, true) . '</pre>';
|
||||
//echo '<pre>' . var_export($cy, true) . '</pre>'; exit;
|
||||
}
|
||||
}
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//
|
||||
//if (false == is_null($pc)) {
|
||||
// $pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_METHOD'] . ':', 0, 0, 'L', 1);
|
||||
// $pdf->Cell(50, 4, $pc->name ? : '-', 0, 0, 'L', 1);
|
||||
//
|
||||
// $pdf->Ln(4);
|
||||
//}
|
||||
//
|
||||
//$pdf->Cell(50, 4, $mod_strings['LBL_PDF_PAYMENT_TERMIN'] . ':', 0, 0, 'L', 1);
|
||||
//$pdf->Cell(50, 4, $this->payment_date ? : '-', 0, 0, 'L', 1);
|
||||
//
|
||||
//$pdf->Ln(4);
|
||||
//
|
||||
//$pdf->SetFont('arialpl', '', '8');
|
||||
//$pdf->Cell(30, 4, "Słownie:", 0, 0, 'L', 1);
|
||||
//$pdf->SetFont('arialpl', 'B', '8');
|
||||
//
|
||||
//if ($this->type == "correct") {
|
||||
// $tot = format_number(abs((float) $total - array_sum($inv_value)));
|
||||
// $tot = str_replace(".", "", $tot);
|
||||
// //$tot=str_replace(",",".",$tot);
|
||||
// $sl = $this->slowniePL($tot);
|
||||
//} else {
|
||||
// $tot = str_replace(".", "", str_replace("PLN", "", $total - array_sum($inv_value)));
|
||||
// $sl = $this->slowniePL($tot);
|
||||
//}
|
||||
//
|
||||
//if ($this->document_no == "FV 1421/10") {
|
||||
// $sl = "one thousand one hundred six EUR 41/100";
|
||||
//}
|
||||
//
|
||||
//$pdf->Cell(150, 4, $sl, 0, 0, 'L', 1);
|
||||
|
||||
if ($this->currency_value > 1) {
|
||||
$pdf->Ln(8);
|
||||
|
||||
$pdf->Cell(50, 4, $mod_strings['LBL_CURRENCY_VALUE'] . '/' . $mod_strings2['LBL_CURRENCY_VALUE'] . ':', 0, 0, 'L', 1);
|
||||
$pdf->Cell(50, 4, '1 ' . $this->currency_symbol . ' = ' . format_number($this->currency_value ? : 1, null, 4) . ' zł', 0, 0, 'L', 1);
|
||||
}
|
||||
|
||||
$pdf->Ln(16);
|
||||
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(85, 1, 'Dla wszystkich pozycji faktury zastosowano stawkę VAT 0%', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(85, 1, 'VAT is 0% for all invoice items', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(85, 1, 'Zgodnie z art. 41 ust. 3 ustawy o podatku VAT', 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(20);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '7');
|
||||
|
||||
$pdf->Cell(85, 1, "...............................................................", 0, 0, 'L', 1);
|
||||
$pdf->Cell(85, 1, "...............................................................", 0, 0, 'R', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->Cell(43, 1, $mod_strings['LBL_PDF_OWNER_SIGNATURE'] . '/' . $mod_strings2['LBL_PDF_OWNER_SIGNATURE'], 0, 0, 'C', 1);
|
||||
|
||||
$pdf->SetX(155);
|
||||
|
||||
$pdf->Cell(35, 1, $mod_strings['LBL_PDF_RECEIVER_SIGNATURE'] . '/' . $mod_strings2['LBL_PDF_RECEIVER_SIGNATURE'], 0, 0, 'C', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->Cell(43, 1, $this->setUser()->full_name, 0, 0, 'C', 1);
|
||||
|
||||
//footer text
|
||||
$pdf->Ln(18);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->MultiCell(0, 4, $this->footer_text, 0, 'J');
|
||||
|
||||
//header text
|
||||
$pdf->Ln(6);
|
||||
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->MultiCell(0, 4, $this->ads_text, 0, 'J');
|
||||
1044
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader.php
Executable file
1044
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader.php
Executable file
File diff suppressed because it is too large
Load Diff
423
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader2.php
Executable file
423
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader2.php
Executable file
@@ -0,0 +1,423 @@
|
||||
<?php
|
||||
|
||||
//echo __LINE__;
|
||||
//exit;
|
||||
|
||||
global $app_list_strings;
|
||||
|
||||
|
||||
$address = str_replace("<", "<", str_replace(">", ">", $this->parent_name));
|
||||
if ($this->parent_contact_name) {
|
||||
$address .= "\n" . $this->parent_contact_name;
|
||||
if ($this->parent_contact_title) {
|
||||
$address .= "\n" . $this->parent_contact_title;
|
||||
}
|
||||
$personplus = 5;
|
||||
}
|
||||
else
|
||||
$personplus = 0;
|
||||
|
||||
if ($this->parent_address_street)
|
||||
$address .= "\n" . $this->parent_address_street;
|
||||
if ($this->parent_address_postalcode)
|
||||
$address .= "\n" . $this->parent_address_postalcode;
|
||||
if ($this->parent_address_city)
|
||||
$address .= " " . $this->parent_address_city;
|
||||
//if($this->to_vatid) $address .= "\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
|
||||
if ($this->to_nip)
|
||||
$address .= "\n" . $mod_strings['LBL_PDF_NIP'] . ": " . $this->to_nip;
|
||||
elseif (!$this->to_nip && $this->to_vatid)
|
||||
$address .= "\n" . $mod_strings['LBL_PDF_NIP'] . ": " . $this->to_vatid;
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iln,to_nip from accounts where id='" . $this->parent_id . "'"));
|
||||
if ($r['iln'])
|
||||
$address .= "\nILN: " . $r['iln'];
|
||||
|
||||
//to address
|
||||
$old_x = $pdf->GetX();
|
||||
$old_y = $pdf->GetY();
|
||||
|
||||
$pdf->SetXY(25, 53);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35, 1, "SPRZEDAWCA:", 0, 0, 'L', 1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(25);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select nip from accounts where id='" . $pdf->edt->account_id . "'"));
|
||||
$wys = $pdf->edt->name . "\n";
|
||||
if ($pdf->edt->footer_address)
|
||||
$wys .= $pdf->edt->footer_address . "\n";
|
||||
if ($r['nip'])
|
||||
$wys.= "Nip: " . $r['nip'];
|
||||
|
||||
$pdf->MultiCell(60, 4, $wys, 0, 'L');
|
||||
|
||||
$pdf->SetXY(81, 53);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35, 1, "NABYWCA:", 0, 0, 'L', 1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(81);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$pdf->MultiCell(60, 4, $address, 0, 'L');
|
||||
|
||||
if ($this->type == "correct") {
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select wz_id from ecminvoiceouts where id='" . $this->ecminvoiceout_id . "'"));
|
||||
$wz_id = $r['wz_id'];
|
||||
}
|
||||
else
|
||||
$wz_id = $this->wz_id;
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select * from ecmstockdocouts where id='" . $wz_id . "'"));
|
||||
if ($r['parent_id'] == $this->parent_id) {
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select name as parent_name,shipping_address_street as parent_address_street,shipping_address_city as parent_address_city,shipping_address_postalcode as parent_address_postalcode,shipping_address_country as parent_address_country from accounts where id='" . $this->parent_id . "'"));
|
||||
}
|
||||
$address = "";
|
||||
$address = str_replace("<", "<", str_replace(">", ">", $r['parent_name']));
|
||||
if ($r['parent_address_street'])
|
||||
$address .= "\n" . $r['parent_address_street'];
|
||||
if ($r['parent_address_postalcode'])
|
||||
$address .= "\n" . $r['parent_address_postalcode'];
|
||||
if ($r['parent_address_city'])
|
||||
$address .= " " . $r['parent_address_city'];
|
||||
if ($r['to_nip'])
|
||||
$address .= "\n" . $mod_strings['LBL_PDF_NIP'] . ": " . $r['to_nip'];
|
||||
elseif (!$r['to_nip'] && $r['to_vatid'])
|
||||
$address .= "\n" . $mod_strings['LBL_PDF_NIP'] . ": " . $r['to_vatid'];
|
||||
$rr = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iln from accounts where id='" . $r['parent_id'] . "'"));
|
||||
if ($rr['iln'])
|
||||
$address .= "\nILN: " . $rr['iln'];
|
||||
|
||||
if ($address) {
|
||||
$pdf->SetXY(143, 53);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35, 1, "DOSTAWA:", 0, 0, 'L', 1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(143);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$pdf->MultiCell(60, 4, $address, 0, 'L');
|
||||
}
|
||||
$ynew = $pdf->GetY() + 12;
|
||||
|
||||
|
||||
|
||||
if ($this->ecmpaymentcondition_id) {
|
||||
require_once("modules/EcmPaymentConditions/EcmPaymentCondition.php");
|
||||
$pc = new EcmPaymentCondition();
|
||||
$pc->retrieve($this->ecmpaymentcondition_id);
|
||||
}
|
||||
|
||||
$pdf->SetXY(160, $old_y + 15 + $personplus);
|
||||
|
||||
$table = array();
|
||||
|
||||
|
||||
// $table [0]['place_of_register'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_PLACE_OF_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
// $table [0]['place_of_register_value'] = array('width' => 25, 'value' => $this->template->place_of_register, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$table [1]['date_reg'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [1]['date_reg_value'] = array('width' => 36, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$table [2]['date_sell'] = array('width' => 20, 'value' => "Data dokonania, lub zakonczenia dostawy towarów, lub wykonania usługi.", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [2]['date_sell_value'] = array('width' => 36, 'value' => $this->sell_date, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8, 'valign' => 'C');
|
||||
|
||||
|
||||
|
||||
if ($this->ecmpaymentcondition_id) {
|
||||
$table [4]['payment_termin'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_PAYMENT_TERMIN'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select paid from ecminvoiceouts where id='" . $_REQUEST['record'] . "'"));
|
||||
if ($r['paid'] == 1)
|
||||
$paid = "zaplacono";
|
||||
else
|
||||
$paid = $pc->days . " " . $mod_strings['LBL_PDF_DAYS'];
|
||||
if ($this->document_no == "FV 1421/10")
|
||||
$table [4]['payment_termin_value'] = array('width' => 36, 'value' => "prepayment", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
else
|
||||
$table [4]['payment_termin_value'] = array('width' => 36, 'value' => $paid, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
}
|
||||
|
||||
if ($this->ecmpaymentcondition_id) {
|
||||
$table [5]['payment_method'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_PAYMENT_METHOD'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
if ($this->document_no == "FV 1421/10")
|
||||
$table [5]['payment_method_value'] = array('width' => 25, 'value' => "money transfer", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
else
|
||||
$table [5]['payment_method_value'] = array('width' => 25, 'value' => $app_list_strings['ecmpaymentconditions_payment_method_dom'][$pc->payment_method], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
}
|
||||
if ($this->supplier_code) {
|
||||
$table [6]['cr'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_SUPPLIER_CODE'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [6]['cr_value'] = array('width' => 25, 'value' => $this->supplier_code, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
}
|
||||
|
||||
if ($this->type == "normal") {
|
||||
if (file_exists("modules/EcmStockDocOuts/EcmStockDocOut.php")) {
|
||||
require_once("modules/EcmStockDocOuts/EcmStockDocOut.php");
|
||||
$wz = new EcmStockDocOut();
|
||||
$wz->retrieve($this->wz_id);
|
||||
}
|
||||
//$table [7]['wz'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_TO_WZ'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
//$table [7]['wz_value'] = array('width' => 25, 'value' => $wz->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
} else {
|
||||
$this->loadEcmInvoiceOut();
|
||||
$this->ecminvoiceout->format_all_fields();
|
||||
$table [7]['wz'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT_TO'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [7]['wz_value'] = array('width' => 25, 'value' => $this->ecminvoiceout->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
}
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select so_id from ecminvoiceouts where id='" . $this->id . "'"));
|
||||
$this->so_id = $r['so_id'];
|
||||
if (!$this->so_id)
|
||||
$this->so_id = $_SESSION['invoice_so_id'];
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select wz_id from ecminvoiceouts where id='" . $this->id . "'"));
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select so_id from ecmstockdocouts where id='" . $r['wz_id'] . "'"));
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select order_no from ecmsales where id='" . $r['so_id'] . "'"));
|
||||
if ($r['order_no'] && $this->type != "correct") {
|
||||
$table [8]['order_no'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_ORDER_NO'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [8]['order_no_value'] = array('width' => 25, 'value' => $r['order_no'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
}
|
||||
if ($this->type != "normal") {
|
||||
if (!$this->so_id)
|
||||
$this->so_id = $_SESSION['invoice_so_id'];
|
||||
$r_so = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select * from ecmsales where id='" . $this->so_id . "'"));
|
||||
$table [9]['cr'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_CORRECT_REASON'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [9]['cr_value'] = array('width' => 25, 'value' => $this->order_no, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
}
|
||||
|
||||
$pdf->SetXY(143, $pdf->tMargin + 20);
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
|
||||
$pdf->Ln(9);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '18');
|
||||
$pdf->SetXY(60, $pdf->tMargin + 25);
|
||||
if ($this->type == "normal") {
|
||||
$pdf->MultiCell(80, 7, "Faktura nr " . $this->document_no, 0, 'C');
|
||||
$pdf->SetFont('arialpl', 'B', 7);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(60);
|
||||
} else if ($this->type == "correct") {
|
||||
$pdf->MultiCell(80, 7, $mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT'] . " " . $this->document_no, 0, 'C');
|
||||
$pdf->SetFont('arialpl', 'B', 7);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(60);
|
||||
$pdf->Cell(80, 1, $mod_strings['LBL_PDF_ORIGINAL_COPY'], 0, 0, 'C', 1);
|
||||
}
|
||||
|
||||
$this->loadParser();
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
$pdf->SetY($ynew);
|
||||
|
||||
/* if($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl','b','10');
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_BEFORE_CORRECT']);
|
||||
$pdf->Ln(3);
|
||||
$this->ecminvoiceout->DrawPositions($pdf);
|
||||
$pdf->SetFont('arialpl','b','10');
|
||||
$pdf->Ln(4);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_AFTER_CORRECT']);
|
||||
$pdf->Ln(3);
|
||||
} */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$pdf->SetFont('arialpl', '', '7');
|
||||
global $mod_strings;
|
||||
|
||||
|
||||
$currency = new Currency();
|
||||
$currency->retrieve($this->currency_id);
|
||||
$this->currency_symbol = $currency->iso4217;
|
||||
|
||||
if (!isset($this->position_list) || !is_array($this->position_list))
|
||||
$this->position_list = $this->getPositionList(true);
|
||||
$calc = $this->calculate($this->position_list, true);
|
||||
//$this->position_list = $this->formatPositions($this->position_list);
|
||||
|
||||
$calc['total'] .= ' ' . $this->currency_symbol;
|
||||
$calc['subtotal'] .= ' ' . $this->currency_symbol;
|
||||
if ($calc['discount']) {
|
||||
$calc['total2'] .= ' ' . $this->currency_symbol;
|
||||
$calc['discount']['value'] .= ' ' . $this->currency_symbol;
|
||||
}
|
||||
|
||||
if (isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
|
||||
foreach ($calc['vats'] as $key => $value)
|
||||
$calc['vats'][$key] .= ' ' . $this->currency_symbol;
|
||||
|
||||
|
||||
|
||||
$pdf->Ln(7);
|
||||
$name_w = 20;
|
||||
//if($calc['draw_discount']) $name_w -= 8;
|
||||
//if($calc['draw_vat']) $name_w -= 8;
|
||||
$table = array();
|
||||
$table [0]['position'] = array('background' => array(233, 233, 233), 'width' => 6, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 8);
|
||||
$table [0]['description'] = array('background' => array(233, 233, 233), 'width' => $name_w + 2, 'value' => 'Nazwa', 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//$table [0]['tax_code'] = array('width' => 7, 'value' => $mod_strings['LBL_PDF_LIST_TAX_CODE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//$table [0]['recipient_code'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_TAX_CODE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['quantity'] = array('background' => array(233, 233, 233), 'width' => 9, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['unit'] = array('background' => array(233, 233, 233), 'width' => 7, 'value' => "J.m.", 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 8);
|
||||
$table [0]['unit_price'] = array('background' => array(233, 233, 233), 'width' => 12, 'value' => 'Cena netto', 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
|
||||
$table [0]['unit_price_total'] = array('background' => array(233, 233, 233), 'width' => 14, 'value' => "Wartość netto", 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//if($calc['draw_discount'])
|
||||
//$table [0]['discount'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_DISCOUNT'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//if($calc['draw_vat']) {
|
||||
if ($this->currency_symbol != "USD") {
|
||||
$table [0]['vat_id'] = array('background' => array(233, 233, 233), 'width' => 5, 'value' => 'VAT (%)', 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['vat_value'] = array('background' => array(233, 233, 233), 'width' => 13, 'value' => $mod_strings['LBL_PDF_LIST_VAT_VALUE'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//}
|
||||
}
|
||||
|
||||
if ($this->currency_symbol == "USD") {
|
||||
$table [0]['nw'] = array('background' => array(233, 233, 233), 'width' => 9, 'value' => "Netto weight", 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['bw'] = array('background' => array(233, 233, 233), 'width' => 9, 'value' => "Brutto weight", 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
}
|
||||
|
||||
$table [0]['total'] = array('background' => array(233, 233, 233), 'width' => 14, 'value' => 'Wartość brutto', 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
if ($this->type != "normal")
|
||||
$pdf->SetY(76);
|
||||
$pdf->DrawTable($table, array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
$i = 1;
|
||||
|
||||
$table = array();
|
||||
|
||||
$lv = return_app_list_strings_language($this->ecmlanguage);
|
||||
if ($this->position_list != '')
|
||||
foreach ($this->position_list as $p) {
|
||||
if ($this->type == "correct") {
|
||||
$rrrr = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select quantity,price from ecminvoiceoutitems where id='" . $p['iid'] . "'"));
|
||||
$rrr = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select quantity,price from ecminvoiceoutitems where id='" . $p['item_id'] . "'"));
|
||||
if ((float) $rrrr['quantity'] == (float) $rrr['quantity'] && (float) $rrrr['price'] == (float) $rrr['price'])
|
||||
continue;
|
||||
}
|
||||
|
||||
$j++;
|
||||
|
||||
|
||||
$table [$i]['position'] = array('width' => 6, 'value' => $j, 'border' => 1, 'align' => 'R', 'font-size' => 7);
|
||||
$table [$i]['description'] = array('width' => $name_w + 2, 'value' => htmlspecialchars_decode($p['code'] . ' ' . $p['name']), 'border' => 1, 'align' => 'L', 'font-size' => 7);
|
||||
//$table [$i]['recipient_code'] = array('width' => 10, 'value' => $p['recipient_code'],'border' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$table [$i]['quantity'] = array('width' => 9, 'value' => $p['quantity'], 'border' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$table [$i]['unit'] = array('width' => 7, 'value' => $p['unit_id'], 'border' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$table [$i]['unit_price'] = array('width' => 12, 'value' => format_number($p['price']) . ' ' . $this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7);
|
||||
$price_total = ($p['price']) * $p['quantity'];
|
||||
$table [$i]['unit_price_total'] = array('width' => 14, 'value' => format_number($price_total) . ' ' . $this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7);
|
||||
if ($this->currency_symbol != "USD") {
|
||||
$table [$i]['vat_id'] = array('width' => 5, 'value' => format_number($p['vat_value']), 'border' => 1, 'align' => 'R', 'font-size' => 7);
|
||||
$vat_value = round($price_total * ($p['vat_value'] / 100), 2);
|
||||
$table [$i]['vat_value'] = array('width' => 13, 'value' => format_number($vat_value) . ' ' . $this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7);
|
||||
}
|
||||
if ($this->currency_symbol == "USD") {
|
||||
$table [$i]['nw'] = array('width' => 9, 'value' => format_number(floatval(str_replace(",", ".", $p['netto_weight']))), 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$table [$i]['bw'] = array('width' => 9, 'value' => format_number(floatval(str_replace(",", ".", $p['brutto_weight']))), 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$nw+=floatval(str_replace(",", ".", $p['netto_weight']));
|
||||
$bw+=floatval(str_replace(",", ".", $p['brutto_weight']));
|
||||
}
|
||||
$table [$i]['total'] = array('width' => 14, 'value' => format_number($price_total + $vat_value) . ' ' . $this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7);
|
||||
|
||||
|
||||
|
||||
$totals[$p['vat_id']]['price']+=$price_total;
|
||||
$totals[$p['vat_id']]['total']+=$price_total + $vat_value;
|
||||
$totals[$p['vat_id']]['vat']+=$vat_value;
|
||||
$sum_total+=$price_total + $vat_value;
|
||||
$sum_netto+=$price_total;
|
||||
|
||||
if ($this->type == "correct") {
|
||||
$i++;
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select * from ecminvoiceoutitems where id='" . $p['item_id'] . "'"));
|
||||
if ($p['id'] == $p['item_id'])
|
||||
$ssss = "t";
|
||||
$table [$i]['position'] = array('width' => 4, 'value' => '', 'border' => 1, 'align' => 'R', 'font-size' => 7);
|
||||
$table [$i]['description'] = array('width' => $name_w, 'value' => "bylo" . $ssss, 'border' => 1, 'align' => 'L', 'font-size' => 7);
|
||||
$table [$i]['recipient_code'] = array('width' => 10, 'value' => "", 'border' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$table [$i]['quantity'] = array('width' => 7, 'value' => (int) $r['quantity'], 'border' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$table [$i]['unit'] = array('width' => 5, 'value' => $lv['ecmproducts_unit_dom'][$r['dd_unit_id']], 'border' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$table [$i]['unit_price'] = array('width' => 10, 'value' => format_number($r['price']) . ' ' . $this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7);
|
||||
$price_total = ($r['price'] - ($r['price'] * $r['discount'] / 100)) * $r['quantity'];
|
||||
$table [$i]['unit_price_total'] = array('width' => 12, 'value' => format_number($price_total) . ' ' . $this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7);
|
||||
$table [$i]['vat_id'] = array('width' => 5, 'value' => format_number($r['ecmvat_value']), 'border' => 1, 'align' => 'R', 'font-size' => 7);
|
||||
$vat_value = round($price_total * ($r['ecmvat_value'] / 100), 2);
|
||||
$table [$i]['vat_value'] = array('width' => 13, 'value' => format_number($vat_value) . ' ' . $this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7);
|
||||
$table [$i]['total'] = array('width' => 14, 'value' => format_number($price_total + $vat_value) . ' ' . $this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7);
|
||||
|
||||
$totals[$p['vat_id']]['price']-=$price_total;
|
||||
$totals[$p['vat_id']]['total']-=($price_total + $vat_value);
|
||||
$totals[$p['vat_id']]['vat']-=$vat_value;
|
||||
$sum_total-=($price_total + $vat_value);
|
||||
$sum_netto-=$price_total;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$pdf->DrawTable($table, array(0));
|
||||
//total, vat, subtotal
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw - $pdf->lMargin - $pdf->rMargin) / 100;
|
||||
//$pdf->SetX($pdf->fw-$pdf->rMargin-$pr*34);
|
||||
$table = array();
|
||||
|
||||
if ($calc['vats']) {
|
||||
/* $table [] = array(
|
||||
'subtotal1' => array('width' => 42, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7),
|
||||
'subtotal2' => array('width' => 14, 'value' => $calc['subtotal'].' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7), );
|
||||
*/
|
||||
$table [] = array(
|
||||
'vat_rate' => array('width' => 10, 'value' => 'VAT (%)', 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7),
|
||||
'netto_total' => array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL_PRICE'], 'background' => array(255, 255, 255), 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7),
|
||||
'vat_total' => array('width' => 13, 'value' => "Suma VAT", 'background' => array(255, 255, 255), 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7),
|
||||
'vat2' => array('width' => 14, 'value' => 'Suma brutto', 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7),);
|
||||
|
||||
foreach ($calc['vats'] as $key => $value) {
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select id,name,value from ecmvats where id='" . $key . "'"));
|
||||
$vvn = $r['name'];
|
||||
$table [] = array(
|
||||
'vat_rate' => array('width' => 10, 'value' => format_number($r['value']), 'background' => array(255, 255, 255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'netto_total' => array('width' => 12, 'value' => format_number($totals[$r['id']]['price']) . ' ' . $this->currency_symbol, 'background' => array(255, 255, 255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat_total' => array('width' => 13, 'value' => format_number($totals[$r['id']]['vat']) . ' ' . $this->currency_symbol, 'background' => array(255, 255, 255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat2' => array('width' => 14, 'value' => format_number($totals[$r['id']]['total']) . ' ' . $this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($calc['discount'])) {
|
||||
$disc = floatval(str_replace(",", ".", str_replace(".", "", $this->discount)));
|
||||
$table [] = array(
|
||||
'total21' => array('width' => 35, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255, 255, 255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total22' => array('width' => 14, 'value' => $calc['total2'], 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),);
|
||||
$table [] = array(
|
||||
'discount1' => array('width' => 35, 'value' => $mod_strings['LBL_PDF_DISCOUNT'], 'background' => array(255, 255, 255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'discount2' => array('width' => 14, 'value' => format_number($disc) . ' ' . $this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),);
|
||||
}
|
||||
if ($this->currency_symbol == "USD") {
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 10, 'value' => $mod_strings['LBL_PDF_END_TOTAL'], 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total2' => array('width' => 12, 'value' => format_number($sum_netto - floatval(str_replace(",", ".", str_replace(".", "", str_replace("PLN", "", $calc['discount']['value']))))) . ' ' . $this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total3' => array('width' => 9, 'value' => format_number($nw), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total4' => array('width' => 9, 'value' => format_number($bw), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total5' => array('width' => 14, 'value' => format_number($sum_total - floatval(str_replace(",", ".", str_replace(".", "", str_replace("PLN", "", $calc['discount']['value']))))) . ' ' . $this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7, 'font-style' => 'b'),);
|
||||
} else {
|
||||
$brutto = $sum_total - $disc;
|
||||
$netto = $sum_netto;
|
||||
$vvat = $brutto - $netto;
|
||||
$table [] = array(
|
||||
'total1' => array('background' => array(233, 233, 233), 'width' => 10, 'value' => $mod_strings['LBL_PDF_END_TOTAL'], 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total2' => array('background' => array(233, 233, 233), 'width' => 12, 'value' => format_number($netto) . ' ' . $this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total3' => array('background' => array(233, 233, 233), 'width' => 13, 'value' => format_number($vvat) . ' ' . $this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total4' => array( 'width' => 14, 'value' => format_number($brutto) . ' ' . $this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7, 'font-style' => 'b'),);
|
||||
}
|
||||
if ($pdf->GetY() + 30 > $pdf->fh - $pdf->bMargin)
|
||||
$pdf->AddPage();
|
||||
if ($this->currency_symbol == "USD")
|
||||
$pdf->SetX(103);
|
||||
else
|
||||
$pdf->SetX(112);
|
||||
$pdf->DrawTable($table);
|
||||
$pdf->Ln(1);
|
||||
|
||||
//$table=array();
|
||||
//$pdf->DrawTable($table);
|
||||
1515
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader_e.php
Executable file
1515
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader_e.php
Executable file
File diff suppressed because it is too large
Load Diff
1451
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader_exp.php
Executable file
1451
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader_exp.php
Executable file
File diff suppressed because it is too large
Load Diff
1554
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader_k.php
Executable file
1554
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader_k.php
Executable file
File diff suppressed because it is too large
Load Diff
327
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader_pl.php
Executable file
327
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader_pl.php
Executable file
@@ -0,0 +1,327 @@
|
||||
<?php
|
||||
|
||||
global $app_list_strings;
|
||||
|
||||
$this->parent_name = htmlspecialchars_decode($this->parent_name);
|
||||
|
||||
$address = str_replace("<", "<", str_replace(">", ">", $this->parent_name));
|
||||
|
||||
if ($this->parent_contact_name) {
|
||||
$address .= "\n" . $this->parent_contact_name;
|
||||
|
||||
if ($this->parent_contact_title) {
|
||||
$address .= "\n" . $this->parent_contact_title;
|
||||
}
|
||||
|
||||
$personplus = 5;
|
||||
} else {
|
||||
$personplus = 0;
|
||||
}
|
||||
|
||||
if ($this->parent_address_street) {
|
||||
$address .= "\n" . $this->parent_address_street;
|
||||
}
|
||||
|
||||
if ($this->parent_address_postalcode) {
|
||||
$address .= "\n" . $this->parent_address_postalcode;
|
||||
}
|
||||
|
||||
if ($this->parent_address_city) {
|
||||
$address .= " " . $this->parent_address_city;
|
||||
}
|
||||
|
||||
//if($this->to_vatid)
|
||||
// $address .= "\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
|
||||
|
||||
if ($this->to_nip) {
|
||||
$address .= "\n" . $mod_strings['LBL_PDF_NIP'] . ": " . $this->to_nip;
|
||||
} elseif (!$this->to_nip && $this->to_vatid) {
|
||||
$address .= "\n" . $mod_strings['LBL_PDF_NIP'] . ": " . $this->to_vatid;
|
||||
}
|
||||
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iln,to_nip from accounts where id='" . $this->parent_id . "'"));
|
||||
|
||||
if ($r['iln']) {
|
||||
$address .= "\nILN: " . $r['iln'];
|
||||
}
|
||||
|
||||
//to address
|
||||
$old_x = $pdf->GetX();
|
||||
$old_y = $pdf->GetY();
|
||||
|
||||
$pdf->SetXY(25, 53);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35, 1, "SPRZEDAWCA:", 0, 0, 'L', 1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(25);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select nip from accounts where id='" . $pdf->edt->account_id . "'"));
|
||||
$wys = $pdf->edt->name . "\n";
|
||||
|
||||
if ($pdf->edt->footer_address) {
|
||||
$wys .= $pdf->edt->footer_address . "\n";
|
||||
}
|
||||
|
||||
if ($r['nip']) {
|
||||
$wys.= "NIP: " . $r['nip'];
|
||||
}
|
||||
|
||||
$pdf->MultiCell(60, 4, $wys, 0, 'L');
|
||||
|
||||
$pdf->SetXY(81, 53);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35, 1, "NABYWCA:", 0, 0, 'L', 1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(81);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$pdf->MultiCell(60, 4, $address, 0, 'L');
|
||||
|
||||
|
||||
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select * from ecmstockdocouts where id='" . $wz_id . "'"));
|
||||
|
||||
if ($r['parent_id'] == $this->parent_id) {
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select name as parent_name,shipping_address_street as parent_address_street,shipping_address_city as parent_address_city,shipping_address_postalcode as parent_address_postalcode,shipping_address_country as parent_address_country from accounts where id='" . $this->parent_id . "'"));
|
||||
}
|
||||
|
||||
$address = "";
|
||||
$address = str_replace("<", "<", str_replace(">", ">", $r['parent_name']));
|
||||
|
||||
if ($r['parent_address_street']) {
|
||||
$address .= "\n" . $r['parent_address_street'];
|
||||
}
|
||||
|
||||
if ($r['parent_address_postalcode']) {
|
||||
$address .= "\n" . $r['parent_address_postalcode'];
|
||||
}
|
||||
|
||||
if ($r['parent_address_city']) {
|
||||
$address .= " " . $r['parent_address_city'];
|
||||
}
|
||||
|
||||
if ($r['to_nip']) {
|
||||
$address .= "\n" . $mod_strings['LBL_PDF_NIP'] . ": " . $r['to_nip'];
|
||||
} elseif (!$r['to_nip'] && $r['to_vatid']) {
|
||||
$address .= "\n" . $mod_strings['LBL_PDF_NIP'] . ": " . $r['to_vatid'];
|
||||
}
|
||||
|
||||
$rr = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iln from accounts where id='" . $r['parent_id'] . "'"));
|
||||
|
||||
if ($rr['iln']) {
|
||||
$address .= "\nILN: " . $rr['iln'];
|
||||
}
|
||||
|
||||
if ($address) {
|
||||
$pdf->SetXY(143, 53);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35, 1, "DOSTAWA:", 0, 0, 'L', 1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(143);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$pdf->MultiCell(60, 4, $address, 0, 'L');
|
||||
}
|
||||
|
||||
$ynew = $pdf->GetY() + 12;
|
||||
|
||||
|
||||
|
||||
$pdf->SetXY(160, $old_y + 15 + $personplus);
|
||||
|
||||
$table = array();
|
||||
|
||||
// $table [0]['place_of_register'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_PLACE_OF_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
// $table [0]['place_of_register_value'] = array('width' => 25, 'value' => $this->template->place_of_register, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$table [1]['date_reg'] = array(
|
||||
'width' => 20,
|
||||
'value' => $mod_strings['LBL_PDF_DATE_REGISTER'],
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-size' => 8,
|
||||
);
|
||||
$table [1]['date_reg_value'] = array(
|
||||
'width' => 36,
|
||||
'value' => $this->register_date,
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-style' => 'b',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
$pdf->SetXY(143, $pdf->tMargin + 20);
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
$pdf->Ln(9);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '18');
|
||||
$pdf->SetXY(60, $pdf->tMargin + 25);
|
||||
|
||||
|
||||
$pdf->MultiCell(80, 7, "Specyfikacja WZ do FV " . $this->document_no, 0, 'C');
|
||||
$pdf->SetFont('arialpl', 'B', 7);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(60);
|
||||
|
||||
|
||||
$this->loadParser();
|
||||
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
$pdf->SetY($ynew);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '7');
|
||||
|
||||
global $mod_strings;
|
||||
|
||||
$currency = new Currency();
|
||||
|
||||
$currency->retrieve($this->currency_id);
|
||||
$this->currency_symbol = $currency->iso4217;
|
||||
|
||||
if (!isset($this->position_list) || !is_array($this->position_list)) {
|
||||
$this->position_list = $this->getPositionList(true);
|
||||
}
|
||||
|
||||
$calc = $this->calculate($this->position_list, true);
|
||||
//$this->position_list = $this->formatPositions($this->position_list);
|
||||
|
||||
$calc['total'] .= ' ' . $this->currency_symbol;
|
||||
$calc['subtotal'] .= ' ' . $this->currency_symbol;
|
||||
|
||||
if ($calc['discount']) {
|
||||
$calc['total2'] .= ' ' . $this->currency_symbol;
|
||||
$calc['discount']['value'] .= ' ' . $this->currency_symbol;
|
||||
}
|
||||
|
||||
if (isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0) {
|
||||
foreach ($calc['vats'] as $key => $value) {
|
||||
$calc['vats'][$key] .= ' ' . $this->currency_symbol;
|
||||
}
|
||||
}
|
||||
|
||||
$pdf->Ln(7);
|
||||
$name_w = 80;
|
||||
//if($calc['draw_discount']) $name_w -= 8;
|
||||
//if($calc['draw_vat']) $name_w -= 8;
|
||||
$table = array();
|
||||
|
||||
$table [0]['position'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => 6,
|
||||
'value' => $mod_strings['LBL_PDF_LIST_POSITION'],
|
||||
'border' => 1,
|
||||
'overflow' => 1,
|
||||
'align' => 'C',
|
||||
'font-style' => 'b',
|
||||
'font-size' => 8,
|
||||
);
|
||||
$table [0]['description'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $name_w+2,
|
||||
'value' => 'Nazwa',
|
||||
'border' => 1,
|
||||
'overflow' => 1,
|
||||
'align' => 'C',
|
||||
'font-style' => 'b',
|
||||
'font-size' => 7,
|
||||
);
|
||||
|
||||
//$table [0]['tax_code'] = array('width' => 7, 'value' => $mod_strings['LBL_PDF_LIST_TAX_CODE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//$table [0]['recipient_code'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_TAX_CODE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
|
||||
$table [0]['quantity'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => 9,
|
||||
'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'],
|
||||
'border' => 1,
|
||||
'overflow' => 1,
|
||||
'align' => 'C',
|
||||
'font-style' => 'b',
|
||||
'font-size' => 7,
|
||||
);
|
||||
$table [0]['unit'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => 7,
|
||||
'value' => "J.m.",
|
||||
'border' => 1,
|
||||
'overflow' => 1,
|
||||
'align' => 'C',
|
||||
'font-style' => 'b',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
if ($this->type != "normal") {
|
||||
$pdf->SetY(76);
|
||||
}
|
||||
|
||||
$pdf->DrawTable($table, array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
$i = 1;
|
||||
|
||||
$table = array();
|
||||
|
||||
$lv = return_app_list_strings_language($this->ecmlanguage);
|
||||
|
||||
if ($this->position_list != '') {
|
||||
foreach ($this->position_list as $p) {
|
||||
if ($this->type == "correct") {
|
||||
$rrrr = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select quantity,price from ecminvoiceoutitems where id='" . $p['iid'] . "'"));
|
||||
$rrr = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select quantity,price from ecminvoiceoutitems where id='" . $p['item_id'] . "'"));
|
||||
|
||||
if ((float) $rrrr['quantity'] == (float) $rrr['quantity'] && (float) $rrrr['price'] == (float) $rrr['price']) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
$j++;
|
||||
|
||||
$table [$i]['position'] = array(
|
||||
'width' => 6,
|
||||
'value' => $j,
|
||||
'border' => 1,
|
||||
'align' => 'R',
|
||||
'font-size' => 7,
|
||||
);
|
||||
$table [$i]['description'] = array(
|
||||
'width' => $name_w + 2,
|
||||
'value' => htmlspecialchars_decode($p['code'] . ' ' . $p['name']),
|
||||
'border' => 1,
|
||||
'align' => 'L',
|
||||
'font-size' => 7,
|
||||
);
|
||||
|
||||
//$table [$i]['recipient_code'] = array('width' => 10, 'value' => $p['recipient_code'],'border' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
|
||||
$table [$i]['quantity'] = array(
|
||||
'width' => 9,
|
||||
'value' => $p['quantity'],
|
||||
'border' => 1,
|
||||
'align' => 'C',
|
||||
'font-size' => 7,
|
||||
);
|
||||
$table [$i]['unit'] = array(
|
||||
'width' => 7,
|
||||
'value' => $p['unit_id'],
|
||||
'border' => 1,
|
||||
'align' => 'C',
|
||||
'font-size' => 7,
|
||||
);
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$pdf->DrawTable($table, array(0));
|
||||
//total, vat, subtotal
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw - $pdf->lMargin - $pdf->rMargin) / 100;
|
||||
//$pdf->SetX($pdf->fw-$pdf->rMargin-$pr*34);
|
||||
$table = array();
|
||||
$pdf->Ln(1);
|
||||
1517
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader_u.php
Executable file
1517
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader_u.php
Executable file
File diff suppressed because it is too large
Load Diff
1321
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader_u2.php
Executable file
1321
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader_u2.php
Executable file
File diff suppressed because it is too large
Load Diff
1404
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader_u3.php
Executable file
1404
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/e5/subheader_u3.php
Executable file
File diff suppressed because one or more lines are too long
31
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/invoice_01/footer.php
Executable file
31
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/invoice_01/footer.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetY($this->fh-15);
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->SetFillColor(255,255,255);
|
||||
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Cell(0, 10, $this->PageNo().'/{nb}');
|
||||
|
||||
$this->Ln(5);
|
||||
$this->AliasNbPages();
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->getBreakLine(),$this->fw-$this->rMargin,$this->fh-$this->bMargin+1);
|
||||
|
||||
|
||||
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
|
||||
// $this->bMargin = 3;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin);
|
||||
return;
|
||||
} else {
|
||||
// $this->bMargin = 19;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin+$this->tMarign+5);
|
||||
}
|
||||
|
||||
$this->SetFont('arialpl','','8');
|
||||
$this->SetXY($this->lMargin+10,$this->fh-$this->bMargin+3);
|
||||
$this->MultiCell($this->fw-$this->lMargin-$this->rMargin-20,4,$this->edt->footer_text,0,'C');
|
||||
|
||||
23
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/invoice_01/header.php
Executable file
23
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/invoice_01/header.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->fw-100-$this->rMargin,$this->tMargin);
|
||||
$this->MultiCell(100,3.15,$this->edt->header_text,0,'R');
|
||||
//logo
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
|
||||
if(file_exists($this->edt->logo_path))
|
||||
$this->Image($this->edt->logo_path,$this->lMargin,$this->tMargin,0,22.3);
|
||||
|
||||
/*
|
||||
//line
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->tMargin-1,$this->fw-$this->rMargin,$this->tMargin-1);
|
||||
*/
|
||||
//if($this->GetY() < $this->tMargin) $this->SetY($this->tMargin); else
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?
|
||||
|
||||
|
||||
//payment conditions
|
||||
if(!empty($this->ecmpaymentcondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmpaymentcondition_text,0,'L');
|
||||
}
|
||||
|
||||
|
||||
if($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl','b','12');
|
||||
$pdf->Ln(3);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE']." ".format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))).' '.$this->currency_symbol);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
|
||||
//footer text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
|
||||
266
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/invoice_01/subheader.php
Executable file
266
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/invoice_01/subheader.php
Executable file
@@ -0,0 +1,266 @@
|
||||
<?
|
||||
/*
|
||||
$pdf->Ln(10);
|
||||
|
||||
//$this->SetY($this->tMargin);
|
||||
|
||||
//from address
|
||||
$this->template->setAccount();
|
||||
$address = $this->template->account->name;
|
||||
if($this->template->account->billing_address_street) $address .= " - ".$this->template->account->billing_address_street;
|
||||
if($this->template->account->billing_address_postalcode) $address .= " - ".$this->template->account->billing_address_postalcode;
|
||||
|
||||
if($this->template->account->billing_address_city) $address .= " ".$this->template->account->billing_address_city;
|
||||
|
||||
$pdf->SetFont('arialpl', 'u', 8);
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->MultiCell(0,5,$address,0,'L');
|
||||
*/
|
||||
$y_tmp = $pdf->GetY();
|
||||
$pdf->SetLineWidth(0.5);
|
||||
$pdf->SetDrawColor(0,0,0);
|
||||
$pdf->Line(10,100,14,100);
|
||||
$pdf->SetXY($pdf->bMargin, $y_tmp);
|
||||
$pdf->SetLineWidth(0);
|
||||
|
||||
$pdf->Ln(6);
|
||||
if($pdf->page == 1)
|
||||
if($pdf->edt->address) {
|
||||
$pdf->Ln(9);
|
||||
$pdf->SetFont('arialpl', 'u', 8);
|
||||
$pdf->SetXY($pdf->lMargin, 55);
|
||||
$pdf->MultiCell(0,3.15,$pdf->edt->address,0,'L');
|
||||
$pdf->SetXY($pdf->lMargin, 60);
|
||||
}
|
||||
|
||||
//$pdf->Ln(2);
|
||||
|
||||
|
||||
//to address
|
||||
|
||||
$address = $this->parent_name;
|
||||
if($this->parent_contact_name) {
|
||||
$address .= "\n".$this->parent_contact_name;
|
||||
if($this->parent_contact_title) $address .= "\n".$this->parent_contact_title;
|
||||
}
|
||||
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
|
||||
if($this->parent_address_postalcode) $address .= "\n".$this->parent_address_postalcode;
|
||||
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
|
||||
if($this->to_vatid) $address .= "\n\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
|
||||
|
||||
$pdf->SetFont('arialpl', '', 10);
|
||||
|
||||
//$pdf->Ln(2);
|
||||
$current = $pdf->GetY();
|
||||
$pdf->MultiCell(0,4,$address,0,'L');
|
||||
$current2 = $pdf->GetY();
|
||||
|
||||
$pdf->SetLineWidth(0.5);
|
||||
$pdf->SetDrawColor(192,192,192);
|
||||
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-40,85);
|
||||
$pdf->SetFont('arialpl', 'B', 9);
|
||||
$pdf->MultiCell(40,6,$mod_strings['LBL_PDF_NUMBER'],'LTR');
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-40, $pdf->GetY()-1);
|
||||
$pdf->SetFont('arialpl', '', 9);
|
||||
$pdf->MultiCell(40,5,$this->document_no,'LBR');
|
||||
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-40,$pdf->GetY()+0.4);
|
||||
$pdf->SetFont('arialpl', 'B', 9);
|
||||
$pdf->MultiCell(40,6,$mod_strings['LBL_PDF_DATE_REGISTER'],'LTR');
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-40, $pdf->GetY()-1);
|
||||
$pdf->SetFont('arialpl', '', 9);
|
||||
$pdf->MultiCell(40,5,$this->register_date,'LBR');
|
||||
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-40,$pdf->GetY()+0.4);
|
||||
$pdf->SetFont('arialpl', 'B', 9);
|
||||
$pdf->MultiCell(40,6,$mod_strings['LBL_PDF_OWNER'],'LTR');
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-40, $pdf->GetY()-1);
|
||||
$pdf->SetFont('arialpl', '', 9);
|
||||
$pdf->MultiCell(40,5,$this->setUser()->full_name,'LBR');
|
||||
|
||||
/*
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-40,85);
|
||||
$table = array();
|
||||
$table [0]['data'] = array('width' => 40, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [1]['data'] = array('width' => 40, 'value' => $this->document_no, 'border' => 1, 'overflow' => 1, 'align' => 'L');
|
||||
$table [2]['data'] = array('width' => 40, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [3]['data'] = array('width' => 40, 'value' => $this->register_date, 'border' => 1, 'overflow' => 1, 'align' => 'L');
|
||||
$table [4]['data'] = array('width' => 40, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [5]['data'] = array('width' => 40, 'value' => $this->setUser()->full_name, 'border' => 1, 'overflow' => 1, 'align' => 'L');
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3.5);
|
||||
*/
|
||||
//$pdf->SetY($current2);
|
||||
|
||||
//$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','24');
|
||||
$y_tmp = $pdf->GetY();
|
||||
$pdf->SetXY($pdf->lMargin, 106);
|
||||
if($this->type == "normal")
|
||||
$pdf->MultiCell(0,0,$mod_strings['LBL_PDF_DOCUMENT_NAME'],0,'L');
|
||||
else if($this->type == "correct") {
|
||||
$pdf->MultiCell(0,0,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT'],0,'L');
|
||||
$this->loadEcmInvoiceOut();
|
||||
$this->ecminvoiceout->format_all_fields();
|
||||
$pdf->Ln(5);
|
||||
$pdf->SetFont('arialpl','','18');
|
||||
$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT_TO'].' '.$this->ecminvoiceout->document_no);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->loadParser();
|
||||
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->SetY($y_tmp);
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
$pdf->Ln(8);
|
||||
|
||||
|
||||
if(isset($this->header_text) && $this->header_text != '') {
|
||||
$pdf->MultiCell(0,4,$this->header_text,0,'J');
|
||||
$pdf->Ln(10);
|
||||
}
|
||||
|
||||
|
||||
if($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl','b','10');
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_BEFORE_CORRECT']);
|
||||
$pdf->Ln(3);
|
||||
$this->ecminvoiceout->DrawPositions($pdf);
|
||||
$pdf->SetFont('arialpl','b','10');
|
||||
$pdf->Ln(4);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_AFTER_CORRECT']);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$pdf->SetFont('arialpl','','7');
|
||||
global $mod_strings;
|
||||
if(!isset($this->position_list) || !is_array($this->position_list))
|
||||
$this->position_list = $this->getPositionList(true);
|
||||
$calc = $this->calculate($this->position_list,true);
|
||||
//$this->position_list = $this->formatPositions($this->position_list);
|
||||
|
||||
$calc['total'] .= ' '.$this->currency_symbol;
|
||||
$calc['subtotal'] .= ' '.$this->currency_symbol;
|
||||
if($calc['discount']) {
|
||||
$calc['total2'] .= ' '.$this->currency_symbol;
|
||||
$calc['discount']['value'] .= ' '.$this->currency_symbol;
|
||||
}
|
||||
|
||||
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
|
||||
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
|
||||
|
||||
$pdf->SetDrawColor(0,0,0);
|
||||
$pdf->SetLineWidth(0.35);
|
||||
|
||||
$name_w = 21;
|
||||
//if($calc['draw_discount']) $name_w -= 8;
|
||||
//if($calc['draw_vat']) $name_w -= 8;
|
||||
$table = array();
|
||||
$table [0]['position'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
$table [0]['description'] = array('width' => $name_w, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
$table [0]['tax_code'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_TAX_CODE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
$table [0]['quantity'] = array('width' => 7, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
$table [0]['unit'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
$table [0]['unit_price'] = array('width' => 11, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
$table [0]['unit_price_total'] = array('width' => 11, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL_PRICE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
//if($calc['draw_discount'])
|
||||
$table [0]['discount'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_DISCOUNT'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
//if($calc['draw_vat']) {
|
||||
$table [0]['vat_id'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_VAT'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
$table [0]['vat_value'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_VAT_VALUE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
//}
|
||||
$table [0]['total'] = array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
|
||||
$i = 1;
|
||||
|
||||
$table=array();
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
$table [$i]['position'] = array('width' => 5, 'value' => $i, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$table [$i]['description'] = array('width' => $name_w, 'value' => htmlspecialchars_decode($p['name']), 'border' => 1, 'align' => 'L', 'font-size' => 7 );
|
||||
$table [$i]['tax_code'] = array('width' => 8, 'value' => $p['tax_code'],'border' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$table [$i]['quantity'] = array('width' => 7, 'value' => $p['quantity'], 'border' => 1, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit'] = array('width' => 5, 'value' => $GLOBALS['app_list_strings']['ecmproducts_unit_dom'][$p['unit']], 'border' => 1, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit_price'] = array('width' => 11, 'value' => format_number($p['price']).' PLN', 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
|
||||
$price_total=($p['price']-($p['price']*$p['discount']/100))*$p['quantity'];
|
||||
$table [$i]['unit_price_total'] = array('width' => 11, 'value' => format_number($price_total).' PLN', 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
//if($calc['draw_discount'])
|
||||
$table [$i]['discount'] = array('width' => 5, 'value' => $p['discount'], 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
//if($calc['draw_vat']){
|
||||
$table [$i]['vat_id'] = array('width' => 5, 'value' => format_number($p['vat_value']), 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$vat_value=$p['vat_value']/100*$p['price']*$p['quantity'];
|
||||
$table [$i]['vat_value'] = array('width' => 10, 'value' => format_number($vat_value).' PLN', 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
|
||||
//}
|
||||
$table [$i]['total'] = array('width' => 12, 'value' => format_number($price_total+$vat_value).' PLN', 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$totals[$p['vat_id']]['price']+=$price_total;
|
||||
$totals[$p['vat_id']]['total']+=$price_total+$vat_value;
|
||||
$totals[$p['vat_id']]['vat']+=$vat_value;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$pdf->DrawTable($table,array(0));
|
||||
//total, vat, subtotal
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
|
||||
//$pdf->SetX($pdf->fw-$pdf->rMargin-$pr*34);
|
||||
$table = array();
|
||||
|
||||
if($calc['vats']) {
|
||||
/*$table [] = array(
|
||||
'subtotal1' => array('width' => 42, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7),
|
||||
'subtotal2' => array('width' => 14, 'value' => $calc['subtotal'].' PLN', 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7), );
|
||||
*/
|
||||
foreach($calc['vats'] as $key => $value){
|
||||
$r=mysql_fetch_array(mysql_query("select id,name,value from ecmvats where id='".$key."'"));
|
||||
$vvn=$r['name'];
|
||||
$table [] = array(
|
||||
'vat1' => array('width' => 10, 'value' => $mod_strings['LBL_PDF_VAT'].' ('.$vvn.')', 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7),
|
||||
'netto_total' => array('width' => 12, 'value' => format_number($totals[$r['id']]['price']).' PLN', 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat_rate' => array('width' => 5, 'value' => format_number($r['value']), 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat_total' => array('width' => 13, 'value' => format_number($totals[$r['id']]['vat']).' PLN', 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat2' => array('width' => 14, 'value' => format_number($totals[$r['id']]['total']).' PLN', 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7), );
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($calc['discount'])) {
|
||||
$table [] = array(
|
||||
'total21' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total22' => array('width' => 34, 'value' => $calc['total2'].' PLN', 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7), );
|
||||
$table [] = array(
|
||||
'discount1' => array('width' => 86, 'value' => $mod_strings['LBL_PDF_DISCOUNT'].' '.$calc['discount']['procent'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'discount2' => array('width' => 14, 'value' => $calc['discount']['value'].' PLN', 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7), );
|
||||
}
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 40, 'value' => $mod_strings['LBL_PDF_END_TOTAL'], 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b', 'background' => array(226,226,226)),
|
||||
'total2' => array('width' => 14, 'value' => $calc['total'].' PLN', 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7, 'font-style' => 'b', 'background' => array(226,226,226)),);
|
||||
$pdf->SetX(103);
|
||||
$pdf->DrawTable($table);
|
||||
$pdf->Ln(1);
|
||||
|
||||
//$table=array();
|
||||
|
||||
//$pdf->DrawTable($table);
|
||||
31
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/invoice_pl2/footer.php
Executable file
31
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/invoice_pl2/footer.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetY($this->fh-15);
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->SetFillColor(255,255,255);
|
||||
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Cell(0, 10, $this->PageNo().'/{nb}');
|
||||
|
||||
$this->Ln(5);
|
||||
$this->AliasNbPages();
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->getBreakLine(),$this->fw-$this->rMargin,$this->fh-$this->bMargin+1);
|
||||
|
||||
|
||||
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
|
||||
// $this->bMargin = 3;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin);
|
||||
return;
|
||||
} else {
|
||||
// $this->bMargin = 19;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin+$this->tMarign+5);
|
||||
}
|
||||
|
||||
$this->SetFont('arialpl','','8');
|
||||
$this->SetXY($this->lMargin+10,$this->fh-$this->bMargin+3);
|
||||
$this->MultiCell($this->fw-$this->lMargin-$this->rMargin-20,4,$this->edt->footer_text,0,'C');
|
||||
?>
|
||||
17
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/invoice_pl2/header.php
Executable file
17
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/invoice_pl2/header.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//logo
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
|
||||
if(file_exists($this->edt->logo_path))
|
||||
$this->Image($this->edt->logo_path,$this->rMargin+132,$this->tMargin,0,18.3);
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->lMargin,$this->tMargin+3);
|
||||
$this->MultiCell(100,3.15,$this->edt->header_text,0,'L');
|
||||
|
||||
$this->SetY(32);
|
||||
?>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?
|
||||
|
||||
|
||||
//payment conditions
|
||||
if(!empty($this->ecmpaymentcondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmpaymentcondition_text,0,'L');
|
||||
}
|
||||
|
||||
|
||||
if($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl','b','12');
|
||||
$pdf->Ln(3);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE']." ".format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))).' '.$this->currency_symbol);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
|
||||
//footer text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
|
||||
|
||||
|
||||
?>
|
||||
237
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/invoice_pl2/subheader.php
Executable file
237
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/invoice_pl2/subheader.php
Executable file
@@ -0,0 +1,237 @@
|
||||
<?
|
||||
/*
|
||||
$pdf->Ln(10);
|
||||
|
||||
//$this->SetY($this->tMargin);
|
||||
|
||||
//from address
|
||||
|
||||
$this->template->setAccount();
|
||||
|
||||
$address = $this->template->account->name;
|
||||
|
||||
if($this->template->account->billing_address_street) $address .= " - ".$this->template->account->billing_address_street;
|
||||
|
||||
if($this->template->account->billing_address_postalcode) $address .= " - ".$this->template->account->billing_address_postalcode;
|
||||
|
||||
if($this->template->account->billing_address_city) $address .= " ".$this->template->account->billing_address_city;
|
||||
|
||||
$pdf->SetFont('arialpl', 'u', 8);
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->MultiCell(0,5,$address,0,'L');
|
||||
*/
|
||||
|
||||
|
||||
$pdf->Ln(2);
|
||||
|
||||
|
||||
//to address
|
||||
|
||||
$address = $this->parent_name;
|
||||
if($this->parent_contact_name) {
|
||||
$address .= "\n".$this->parent_contact_name;
|
||||
if($this->parent_contact_title) $address .= "\n".$this->parent_contact_title;
|
||||
}
|
||||
|
||||
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
|
||||
|
||||
if($this->parent_address_postalcode) $address .= "\n\n".$this->parent_address_postalcode;
|
||||
|
||||
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
|
||||
|
||||
if($this->to_vatid) $address .= "\n\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
|
||||
|
||||
$pdf->SetFont('arialpl', '', 10);
|
||||
|
||||
$pdf->Ln(2);
|
||||
$current = $pdf->GetY();
|
||||
$pdf->MultiCell(0,4,$address,0,'L');
|
||||
$current2 = $pdf->GetY();
|
||||
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-30,$current);
|
||||
$table = array();
|
||||
$table [0]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [1]['data'] = array('width' => 30, 'value' => $this->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [2]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [3]['data'] = array('width' => 30, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [4]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [5]['data'] = array('width' => 30, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
$pdf->SetY($current2);
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','24');
|
||||
|
||||
if($this->type == "normal")
|
||||
$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME'],0,'L');
|
||||
else if($this->type == "correct") {
|
||||
$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT'],0,'L');
|
||||
$this->loadEcmInvoiceOut();
|
||||
$this->ecminvoiceout->format_all_fields();
|
||||
$pdf->Ln(5);
|
||||
$pdf->SetFont('arialpl','','18');
|
||||
$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT_TO'].' '.$this->ecminvoiceout->document_no);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->loadParser();
|
||||
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->header_text,0,'J');
|
||||
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
if($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl','b','10');
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_BEFORE_CORRECT']);
|
||||
$pdf->Ln(3);
|
||||
$this->ecminvoiceout->DrawPositions($pdf);
|
||||
$pdf->SetFont('arialpl','b','10');
|
||||
$pdf->Ln(4);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_AFTER_CORRECT']);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$pdf->SetFont('arialpl','','7');
|
||||
global $mod_strings;
|
||||
|
||||
|
||||
$currency = new Currency();
|
||||
$currency->retrieve($this->currency_id);
|
||||
$this->currency_symbol=$currency->iso4217;
|
||||
|
||||
if(!isset($this->position_list) || !is_array($this->position_list))
|
||||
$this->position_list = $this->getPositionList(true);
|
||||
$calc = $this->calculate($this->position_list,true);
|
||||
//$this->position_list = $this->formatPositions($this->position_list);
|
||||
|
||||
$calc['total'] .= ' '.$this->currency_symbol;
|
||||
$calc['subtotal'] .= ' '.$this->currency_symbol;
|
||||
if($calc['discount']) {
|
||||
$calc['total2'] .= ' '.$this->currency_symbol;
|
||||
$calc['discount']['value'] .= ' '.$this->currency_symbol;
|
||||
}
|
||||
|
||||
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
|
||||
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
|
||||
|
||||
$name_w = 17;
|
||||
//if($calc['draw_discount']) $name_w -= 8;
|
||||
//if($calc['draw_vat']) $name_w -= 8;
|
||||
$table = array();
|
||||
$table [0]['position'] = array('width' => 4, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 8);
|
||||
$table [0]['description'] = array('width' => $name_w, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['tax_code'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_TAX_CODE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['quantity'] = array('width' => 7, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['unit'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 8);
|
||||
$table [0]['unit_price'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['unit_price_total'] = array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL_PRICE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//if($calc['draw_discount'])
|
||||
$table [0]['discount'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_DISCOUNT'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//if($calc['draw_vat']) {
|
||||
$table [0]['vat_id'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_VAT'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['vat_value'] = array('width' => 13, 'value' => $mod_strings['LBL_PDF_LIST_VAT_VALUE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//}
|
||||
$table [0]['total'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
|
||||
$i = 1;
|
||||
$lv=return_app_list_strings_language($this->ecmlanguage);
|
||||
|
||||
$table=array();
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
$table [$i]['position'] = array('width' => 4, 'value' => $i, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$table [$i]['description'] = array('width' => $name_w, 'value' => htmlspecialchars_decode($p['name']), 'border' => 1, 'align' => 'L', 'font-size' => 7 );
|
||||
$table [$i]['tax_code'] = array('width' => 8, 'value' => $p['tax_code'],'border' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$table [$i]['quantity'] = array('width' => 7, 'value' => $p['quantity'], 'border' => 1, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit'] = array('width' => 5, 'value' => $lv['ecmproducts_unit_dom'][$p['unit_id']], 'border' => 1, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit_price'] = array('width' => 10, 'value' => format_number($p['price']).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$price_total=($p['price']-($p['price']*$p['discount']/100))*$p['quantity'];
|
||||
$table [$i]['unit_price_total'] = array('width' => 12, 'value' => format_number($price_total).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
//if($calc['draw_discount'])
|
||||
$table [$i]['discount'] = array('width' => 5, 'value' => $p['discount'], 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
//if($calc['draw_vat']){
|
||||
$table [$i]['vat_id'] = array('width' => 5, 'value' => format_number($p['vat_value']), 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$vat_value=$p['vat_value']/100*$p['price']*$p['quantity'];
|
||||
$table [$i]['vat_value'] = array('width' => 13, 'value' => format_number($vat_value).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
|
||||
//}
|
||||
$table [$i]['total'] = array('width' => 14, 'value' => format_number($price_total+$vat_value).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$totals[$p['vat_id']]['price']+=$price_total;
|
||||
$totals[$p['vat_id']]['total']+=$price_total+$vat_value;
|
||||
$totals[$p['vat_id']]['vat']+=$vat_value;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$pdf->DrawTable($table,array(0));
|
||||
//total, vat, subtotal
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
|
||||
//$pdf->SetX($pdf->fw-$pdf->rMargin-$pr*34);
|
||||
$table = array();
|
||||
|
||||
if($calc['vats']) {
|
||||
/*$table [] = array(
|
||||
'subtotal1' => array('width' => 42, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7),
|
||||
'subtotal2' => array('width' => 14, 'value' => $calc['subtotal'].' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7), );
|
||||
*/
|
||||
foreach($calc['vats'] as $key => $value){
|
||||
$r=mysql_fetch_array(mysql_query("select id,name,value from ecmvats where id='".$key."'"));
|
||||
$vvn=$r['name'];
|
||||
$table [] = array(
|
||||
'vat1' => array('width' => 10, 'value' => $mod_strings['LBL_PDF_VAT'].' ('.$vvn.')', 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7),
|
||||
'netto_total' => array('width' => 12, 'value' => format_number($totals[$r['id']]['price']).' '.$this->currency_symbol, 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat_rate' => array('width' => 5, 'value' => format_number($r['value']), 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat_total' => array('width' => 13, 'value' => format_number($totals[$r['id']]['vat']).' '.$this->currency_symbol, 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat2' => array('width' => 14, 'value' => format_number($totals[$r['id']]['total']).' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7), );
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($calc['discount'])) {
|
||||
$table [] = array(
|
||||
'total21' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total22' => array('width' => 34, 'value' => $calc['total2'].' '.$this->currency_symbol, 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7), );
|
||||
$table [] = array(
|
||||
'discount1' => array('width' => 86, 'value' => $mod_strings['LBL_PDF_DISCOUNT'].' '.$calc['discount']['procent'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'discount2' => array('width' => 14, 'value' => $calc['discount']['value'].' '.$this->currency_symbol, 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7), );
|
||||
}
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 40, 'value' => $mod_strings['LBL_PDF_END_TOTAL'], 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total2' => array('width' => 14, 'value' => $calc['total'], 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7, 'font-style' => 'b'), );
|
||||
$pdf->SetX(103);
|
||||
$pdf->DrawTable($table);
|
||||
$pdf->Ln(1);
|
||||
|
||||
//$table=array();
|
||||
|
||||
//$pdf->DrawTable($table);
|
||||
?>
|
||||
31
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/saascrm/footer.php
Executable file
31
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/saascrm/footer.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetY($this->fh-15);
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->SetFillColor(255,255,255);
|
||||
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Cell(0, 10, $this->PageNo().'/{nb}');
|
||||
|
||||
$this->Ln(5);
|
||||
$this->AliasNbPages();
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->getBreakLine(),$this->fw-$this->rMargin,$this->fh-$this->bMargin+1);
|
||||
|
||||
|
||||
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
|
||||
// $this->bMargin = 3;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin);
|
||||
return;
|
||||
} else {
|
||||
// $this->bMargin = 19;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin+$this->tMarign+5);
|
||||
}
|
||||
|
||||
$this->SetFont('arialpl','','8');
|
||||
$this->SetXY($this->lMargin+10,$this->fh-$this->bMargin+3);
|
||||
$this->MultiCell($this->fw-$this->lMargin-$this->rMargin-20,4,$this->edt->footer_text,0,'C');
|
||||
?>
|
||||
32
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/saascrm/header.php
Executable file
32
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/saascrm/header.php
Executable file
@@ -0,0 +1,32 @@
|
||||
<?
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->fw-100-$this->rMargin,$this->tMargin);
|
||||
$this->MultiCell(100,3.15,$this->edt->header_text,0,'R');
|
||||
//logo
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
|
||||
if(file_exists($this->edt->logo_path))
|
||||
$this->Image($this->edt->logo_path,$this->lMargin,$this->tMargin,0,22.3);
|
||||
|
||||
/*
|
||||
//line
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->tMargin-1,$this->fw-$this->rMargin,$this->tMargin-1);
|
||||
*/
|
||||
//if($this->GetY() < $this->tMargin) $this->SetY($this->tMargin); else
|
||||
|
||||
$this->Ln(6);
|
||||
if($this->page == 1)
|
||||
if($this->edt->address) {
|
||||
$this->Ln(9);
|
||||
$this->SetFont('arialpl', 'u', 8);
|
||||
$this->SetX($this->lMargin);
|
||||
$this->MultiCell(0,3.15,$this->edt->address,0,'L');
|
||||
$this->Ln(5);
|
||||
}
|
||||
?>
|
||||
38
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/saascrm/subfooter.php
Executable file
38
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/saascrm/subfooter.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?
|
||||
|
||||
|
||||
//payment conditions
|
||||
if(!empty($this->ecmpaymentcondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmpaymentcondition_text,0,'L');
|
||||
}
|
||||
|
||||
|
||||
if($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl','b','12');
|
||||
$pdf->Ln(3);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE']." ".format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))).' '.$this->currency_symbol);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
|
||||
//footer text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
|
||||
|
||||
|
||||
?>
|
||||
236
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/saascrm/subheader.php
Executable file
236
modules/EcmDocumentTemplates/templates/EcmInvoiceOuts/saascrm/subheader.php
Executable file
@@ -0,0 +1,236 @@
|
||||
<?
|
||||
/*
|
||||
$pdf->Ln(10);
|
||||
|
||||
//$this->SetY($this->tMargin);
|
||||
|
||||
//from address
|
||||
|
||||
$this->template->setAccount();
|
||||
|
||||
$address = $this->template->account->name;
|
||||
|
||||
if($this->template->account->billing_address_street) $address .= " - ".$this->template->account->billing_address_street;
|
||||
|
||||
if($this->template->account->billing_address_postalcode) $address .= " - ".$this->template->account->billing_address_postalcode;
|
||||
|
||||
if($this->template->account->billing_address_city) $address .= " ".$this->template->account->billing_address_city;
|
||||
|
||||
$pdf->SetFont('arialpl', 'u', 8);
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->MultiCell(0,5,$address,0,'L');
|
||||
*/
|
||||
|
||||
|
||||
$pdf->Ln(2);
|
||||
|
||||
|
||||
//to address
|
||||
|
||||
$address = $this->parent_name;
|
||||
if($this->parent_contact_name) {
|
||||
$address .= "\n".$this->parent_contact_name;
|
||||
if($this->parent_contact_title) $address .= "\n".$this->parent_contact_title;
|
||||
}
|
||||
|
||||
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
|
||||
|
||||
if($this->parent_address_postalcode) $address .= "\n\n".$this->parent_address_postalcode;
|
||||
|
||||
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
|
||||
|
||||
if($this->to_vatid) $address .= "\n\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
|
||||
|
||||
$pdf->SetFont('arialpl', '', 10);
|
||||
|
||||
$pdf->Ln(2);
|
||||
$current = $pdf->GetY();
|
||||
$pdf->MultiCell(0,4,$address,0,'L');
|
||||
$current2 = $pdf->GetY();
|
||||
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-30,$current);
|
||||
$table = array();
|
||||
$table [0]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [1]['data'] = array('width' => 30, 'value' => $this->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [2]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [3]['data'] = array('width' => 30, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [4]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [5]['data'] = array('width' => 30, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
$pdf->SetY($current2);
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','24');
|
||||
|
||||
if($this->type == "normal")
|
||||
$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME'],0,'L');
|
||||
else if($this->type == "correct") {
|
||||
$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT'],0,'L');
|
||||
$this->loadEcmInvoiceOut();
|
||||
$this->ecminvoiceout->format_all_fields();
|
||||
$pdf->Ln(5);
|
||||
$pdf->SetFont('arialpl','','18');
|
||||
$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT_TO'].' '.$this->ecminvoiceout->document_no);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->loadParser();
|
||||
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->header_text,0,'J');
|
||||
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
if($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl','b','10');
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_BEFORE_CORRECT']);
|
||||
$pdf->Ln(3);
|
||||
$this->ecminvoiceout->DrawPositions($pdf);
|
||||
$pdf->SetFont('arialpl','b','10');
|
||||
$pdf->Ln(4);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_AFTER_CORRECT']);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$pdf->SetFont('arialpl','','7');
|
||||
global $mod_strings;
|
||||
|
||||
|
||||
|
||||
$currency = new Currency();
|
||||
$currency->retrieve($this->currency_id);
|
||||
$this->currency_symbol=$currency->iso4217;
|
||||
|
||||
if(!isset($this->position_list) || !is_array($this->position_list))
|
||||
$this->position_list = $this->getPositionList(true);
|
||||
$calc = $this->calculate($this->position_list,true);
|
||||
//$this->position_list = $this->formatPositions($this->position_list);
|
||||
|
||||
$calc['total'] .= ' '.$this->currency_symbol;
|
||||
$calc['subtotal'] .= ' '.$this->currency_symbol;
|
||||
if($calc['discount']) {
|
||||
$calc['total2'] .= ' '.$this->currency_symbol;
|
||||
$calc['discount']['value'] .= ' '.$this->currency_symbol;
|
||||
}
|
||||
|
||||
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
|
||||
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
|
||||
|
||||
$name_w = 17;
|
||||
//if($calc['draw_discount']) $name_w -= 8;
|
||||
//if($calc['draw_vat']) $name_w -= 8;
|
||||
$table = array();
|
||||
$table [0]['position'] = array('width' => 4, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 8);
|
||||
$table [0]['description'] = array('width' => $name_w, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['tax_code'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_TAX_CODE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['quantity'] = array('width' => 7, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['unit'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 8);
|
||||
$table [0]['unit_price'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['unit_price_total'] = array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL_PRICE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//if($calc['draw_discount'])
|
||||
$table [0]['discount'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_DISCOUNT'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//if($calc['draw_vat']) {
|
||||
$table [0]['vat_id'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_VAT'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['vat_value'] = array('width' => 13, 'value' => $mod_strings['LBL_PDF_LIST_VAT_VALUE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//}
|
||||
$table [0]['total'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
|
||||
$i = 1;
|
||||
$lv=return_app_list_strings_language($this->ecmlanguage);
|
||||
|
||||
$table=array();
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
$table [$i]['position'] = array('width' => 4, 'value' => $i, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$table [$i]['description'] = array('width' => $name_w, 'value' => htmlspecialchars_decode($p['name']), 'border' => 1, 'align' => 'L', 'font-size' => 7 );
|
||||
$table [$i]['tax_code'] = array('width' => 8, 'value' => $p['tax_code'],'border' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$table [$i]['quantity'] = array('width' => 7, 'value' => $p['quantity'], 'border' => 1, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit'] = array('width' => 5, 'value' => $lv['ecmproducts_unit_dom'][$p['unit_id']], 'border' => 1, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit_price'] = array('width' => 10, 'value' => format_number($p['price']).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$price_total=($p['price']-($p['price']*$p['discount']/100))*$p['quantity'];
|
||||
$table [$i]['unit_price_total'] = array('width' => 12, 'value' => format_number($price_total).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
//if($calc['draw_discount'])
|
||||
$table [$i]['discount'] = array('width' => 5, 'value' => $p['discount'], 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
//if($calc['draw_vat']){
|
||||
$table [$i]['vat_id'] = array('width' => 5, 'value' => format_number($p['vat_value']), 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$vat_value=$p['vat_value']/100*$p['price']*$p['quantity'];
|
||||
$table [$i]['vat_value'] = array('width' => 13, 'value' => format_number($vat_value).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
|
||||
//}
|
||||
$table [$i]['total'] = array('width' => 14, 'value' => format_number($price_total+$vat_value).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$totals[$p['vat_id']]['price']+=$price_total;
|
||||
$totals[$p['vat_id']]['total']+=$price_total+$vat_value;
|
||||
$totals[$p['vat_id']]['vat']+=$vat_value;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$pdf->DrawTable($table,array(0));
|
||||
//total, vat, subtotal
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
|
||||
//$pdf->SetX($pdf->fw-$pdf->rMargin-$pr*34);
|
||||
$table = array();
|
||||
|
||||
if($calc['vats']) {
|
||||
/*$table [] = array(
|
||||
'subtotal1' => array('width' => 42, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7),
|
||||
'subtotal2' => array('width' => 14, 'value' => $calc['subtotal'].' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7), );
|
||||
*/
|
||||
foreach($calc['vats'] as $key => $value){
|
||||
$r=mysql_fetch_array(mysql_query("select id,name,value from ecmvats where id='".$key."'"));
|
||||
$vvn=$r['name'];
|
||||
$table [] = array(
|
||||
'vat1' => array('width' => 10, 'value' => $mod_strings['LBL_PDF_VAT'].' ('.$vvn.')', 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7),
|
||||
'netto_total' => array('width' => 12, 'value' => format_number($totals[$r['id']]['price']).' '.$this->currency_symbol, 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat_rate' => array('width' => 5, 'value' => format_number($r['value']), 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat_total' => array('width' => 13, 'value' => format_number($totals[$r['id']]['vat']).' '.$this->currency_symbol, 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat2' => array('width' => 14, 'value' => format_number($totals[$r['id']]['total']).' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7), );
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($calc['discount'])) {
|
||||
$table [] = array(
|
||||
'total21' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total22' => array('width' => 34, 'value' => $calc['total2'].' '.$this->currency_symbol, 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7), );
|
||||
$table [] = array(
|
||||
'discount1' => array('width' => 86, 'value' => $mod_strings['LBL_PDF_DISCOUNT'].' '.$calc['discount']['procent'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'discount2' => array('width' => 14, 'value' => $calc['discount']['value'].' '.$this->currency_symbol, 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7), );
|
||||
}
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 40, 'value' => $mod_strings['LBL_PDF_END_TOTAL'], 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total2' => array('width' => 14, 'value' => $calc['total'], 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7, 'font-style' => 'b'), );
|
||||
$pdf->SetX(103);
|
||||
$pdf->DrawTable($table);
|
||||
$pdf->Ln(1);
|
||||
|
||||
//$table=array();
|
||||
|
||||
//$pdf->DrawTable($table);
|
||||
?>
|
||||
22
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/_footer.php
Executable file
22
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/_footer.php
Executable file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
$this->SetFont('arialpl', '', 7.5);
|
||||
|
||||
$this->SetXY(13,$this->fh-16);
|
||||
$this->Cell(49,0,"Prezes Zarządu - J.Lasowy");
|
||||
$this->Cell(40,0,"NIP: 879-016-88-72");
|
||||
$this->Cell(56,0,"Sąd Rejonowy w Toruniu");
|
||||
$this->Cell(30,0,"Konto: Alior Bank S.A. Oddział w Toruniu");
|
||||
|
||||
$this->SetXY(13,$this->fh-12.5);
|
||||
$this->Cell(49,0,"Wiceprezes - M.Lasowy");
|
||||
$this->Cell(40,0,"REGON: 870525737");
|
||||
$this->Cell(56,0,"VII Wydział Gospodarczy KRS");
|
||||
$this->Cell(30,0,"14 2490 0005 0000 4530 1266 3471");
|
||||
|
||||
$this->SetXY(13,$this->fh-9);
|
||||
$this->Cell(49,0,"");
|
||||
$this->Cell(40,0,"Kapitał zakładowy 50 000 PLN");
|
||||
$this->Cell(56,0,"KRS 0000160548");
|
||||
?>
|
||||
19
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/_header.php
Executable file
19
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/_header.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
error_reporting(0);
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->lMargin,$this->tMargin+2);
|
||||
//$this->MultiCell(100,3.15,$this->edt->header_text.'
|
||||
//'.translate('LBL_PDF_NIP',$module_t).': '.$nip,0,'L');
|
||||
//$this->MultiCell(100,4,"Wystawca:\n".$this->edt->header_text,0,'L');
|
||||
|
||||
//logo
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '' && file_exists($this->edt->logo_path)){
|
||||
$this->Image($this->edt->logo_path,$this->lMargin,$this->tMargin+5,0,12.3);
|
||||
}
|
||||
|
||||
?>
|
||||
110
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/_subfooter.php
Executable file
110
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/_subfooter.php
Executable file
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
$pdf->Ln(20);
|
||||
//if($pdf->GetY()>240)$pdf->AddPage();
|
||||
|
||||
$total=0;
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
include_once("modules/EcmSales/EcmSale.php");
|
||||
$sale=new EcmSale();
|
||||
$sale->retrieve($this->ecmsale_id);
|
||||
$w=$GLOBALS['db']->query("select inv_value,currency_value from ecmprepaymentinvoices where ecmsale_id='".$this->ecmsale_id."' and date_entered<'".$this->date_entered."'");
|
||||
while($r=$GLOBALS['db']->fetchByAssoc($w)){
|
||||
if(!$r['currency_value'])$r['currency_value']=1;
|
||||
$total+=$r['inv_value']*$r['currency_value'];
|
||||
}
|
||||
$total=format_number($sale->getTotal()-$total);
|
||||
|
||||
|
||||
$pdf->Cell(30,4,"Do zapłaty",0,0,'L',1);
|
||||
$pdf->SetFont('arialpl','B','8');
|
||||
$pdf->Cell(30,4,number_format($this->inv_value*$this->currency_value,2,",","."),0,0,'L',1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->Cell(30,4,"Słownie",0,0,'L',1);
|
||||
$pdf->SetFont('arialpl','B','8');
|
||||
|
||||
include_once("modules/EcmInvoiceOuts/EcmInvoiceOut.php");
|
||||
$sl=EcmInvoiceOut::slowniePL(number_format($this->inv_value*$this->currency_value,2,",",""));
|
||||
$pdf->Cell(150,4,$sl." PLN",0,0,'L',1);
|
||||
|
||||
$pdf->Ln(10);
|
||||
if(strlen($this->currency_id)>10){
|
||||
$rc=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iso4217 from currencies where id='".$this->currency_id."'"));
|
||||
$this->currency_id=$rc['iso4217'];
|
||||
}
|
||||
$pdf->Cell(85,1,"Ceny wyliczono wg kursu sprzedaży ".$this->currency_id." z dnia wystawienia zamówienia nr ".$sale->document_no." z dnia ".$sale->register_date." kurs ".$this->currency_id." = ".$this->currency_value,0,0,'L',1);
|
||||
|
||||
//get products
|
||||
$pdf->SetFont('arialpl','','7');
|
||||
$pdf->Ln(10);
|
||||
//$pdf->Cell(85,1,"Dane dotyczące zamówienia, lub umowy",0,0,'L',1);
|
||||
$pdf->Cell(85,1,"Dane dotyczące zamówienia, lub umowy",0,0,'L',1);
|
||||
$pdf->Ln(5);
|
||||
$inv_prod = explode("|", $this->products_on_pdf);
|
||||
$query = "SELECT * FROM `ecmsaleitems` WHERE id IN ('".implode("','", $inv_prod)."') order by position asc";
|
||||
$prod = $GLOBALS['db']->query($query);
|
||||
$table = array();
|
||||
$table [0][] = array('width' => 4, 'value' => "Lp.", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 32, 'value' => "Nazwa", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 7, 'value' => "Ilość", 'border' => 1, 'overflow' => 1,'font-style' => 'b', 'align' => 'L');
|
||||
$table [0][] = array('width' => 5, 'value' => "J.M.", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 12, 'value' => "Cena Netto", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 12, 'value' => "Wartość Netto", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 8, 'value' => "VAT", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 11, 'value' => "Wartość Vat", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 11, 'value' => "Wartośc Brutto", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
|
||||
$i = 1;
|
||||
$total = 0;
|
||||
while ($p = $GLOBALS['db']->fetchByAssoc($prod)) {
|
||||
$table [$i][] = array('width' => 4, 'value' => $i, 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [$i][] = array('width' => 32, 'value' => $p['name'], 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [$i][] = array('width' => 7, 'value' => format_number($p['quantity'],2), 'border' => 1, 'overflow' => 1,'font-style' => '', 'align' => 'L');
|
||||
$table [$i][] = array('width' => 5, 'value' => $p['dd_unit_name'], 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [$i][] = array('width' => 12, 'value' => format_number($p['price'],2), 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [$i][] = array('width' => 12, 'value' => format_number($p['quantity']*$p['price'],2), 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [$i][] = array('width' => 8, 'value' => $p['ecmvat_name'], 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [$i][] = array('width' => 11, 'value' => format_number($p['price']*$p['ecmvat_value'],2), 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [$i][] = array('width' => 11, 'value' => format_number($p['quantity']*($p['price']+($p['price']*$p['ecmvat_value'])),2), 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$total+=$p['quantity']*($p['price']+($p['price']*$p['ecmvat_value']));
|
||||
$i++;
|
||||
}
|
||||
$pdf->DrawTable($table, array(0));
|
||||
|
||||
$table = array();
|
||||
$table [0][] = array('width' => 4, 'value' => '', 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 32, 'value' => '', 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 7, 'value' => '', 'border' => 1, 'overflow' => 1,'font-style' => '', 'align' => 'L');
|
||||
$table [0][] = array('width' => 5, 'value' => '', 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 12, 'value' => '', 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 12, 'value' => '', 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 8, 'value' => '', 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 11, 'value' => Razem, 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 11, 'value' => format_number($total,2), 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$pdf->DrawTable($table, array(0));
|
||||
|
||||
$pdf->Ln(20);
|
||||
$pdf->SetFont('arialpl','','7');
|
||||
$pdf->Cell(85,1,"...............................................................",0,0,'L',1);
|
||||
$pdf->Cell(85,1,"...............................................................",0,0,'R',1);
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(43,1,"Podpis wystawiajacego",0,0,'C',1);
|
||||
$pdf->SetX(155);
|
||||
$pdf->Cell(35,1,"Podpis odbiorcy",0,0,'C',1);$pdf->Ln(4);
|
||||
$pdf->Cell(43,1,$this->setUser()->full_name,0,0,'C',1);
|
||||
|
||||
//footer text
|
||||
$pdf->Ln(18);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
|
||||
|
||||
//header text
|
||||
$pdf->Ln(6);
|
||||
$pdf->SetFont('arialpl','B','8');
|
||||
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
|
||||
|
||||
|
||||
|
||||
?>
|
||||
219
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/_subheader.php
Executable file
219
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/_subheader.php
Executable file
@@ -0,0 +1,219 @@
|
||||
<?
|
||||
|
||||
global $app_list_strings;
|
||||
//echo __LINE__;exit;
|
||||
|
||||
$address = str_replace("<","<",str_replace(">",">",$this->parent_name));
|
||||
if($this->parent_contact_name) {
|
||||
$address .= "\n".$this->parent_contact_name;
|
||||
if($this->parent_contact_title) {
|
||||
$address .= "\n".$this->parent_contact_title;
|
||||
}
|
||||
$personplus=5;
|
||||
}
|
||||
else $personplus=0;
|
||||
|
||||
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
|
||||
if($this->parent_address_postalcode) $address .= "\n".$this->parent_address_postalcode;
|
||||
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
|
||||
//if($this->to_vatid) $address .= "\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
|
||||
if($this->to_nip) $address .= "\nNip: ".$this->to_nip;
|
||||
elseif(!$this->to_nip && $this->to_vatid) $address .= "\nNip: ".$this->to_vatid;
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iln,to_nip from accounts where id='".$this->parent_id."'"));
|
||||
if($r['iln'])$address .= "\nILN: ".$r['iln'];
|
||||
|
||||
//to address
|
||||
$old_x=$pdf->GetX();
|
||||
$old_y=$pdf->GetY();
|
||||
|
||||
$pdf->SetXY(25,43);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35,1,"WYSTAWCA:",0,0,'L',1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(25);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select vatid from accounts where id='".$pdf->edt->account_id."'"));
|
||||
if($r['vatid'])$pdf->edt->header_text .= "\nNip: ".$r['vatid'];
|
||||
if($r['iln'])$pdf->edt->header_text .= "\nILN: ".$r['iln'];
|
||||
|
||||
//$this->loadParser();
|
||||
//$pdf->header_text = $pdf->template->mfp->parseText($pdf->header_text);
|
||||
$pdf->MultiCell(60,4,$pdf->edt->header_text,0,'L');
|
||||
|
||||
$pdf->SetXY(81,43);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35,1,"ODBIORCA:",0,0,'L',1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(81);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$pdf->MultiCell(60,4,$address,0,'L');
|
||||
|
||||
$address="";
|
||||
$address = str_replace("<","<",str_replace(">",">",$r['parent_name']));
|
||||
if($r['parent_address_street']) $address .= "\n".$r['parent_address_street'];
|
||||
if($r['parent_address_postalcode']) $address .= "\n".$r['parent_address_postalcode'];
|
||||
if($r['parent_address_city']) $address .= " ".$r['parent_address_city'];
|
||||
if($r['to_nip']) $address .= "\nNip: ".$r['to_nip'];
|
||||
elseif(!$r['to_nip'] && $r['to_vatid']) $address .= "\nNip: ".$r['to_vatid'];
|
||||
$rr=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iln from accounts where id='".$r['parent_id']."'"));
|
||||
if($rr['iln'])$address .= "\nILN: ".$rr['iln'];
|
||||
|
||||
$ynew=$pdf->GetY()+12;
|
||||
|
||||
|
||||
|
||||
if($this->ecmpaymentcondition_id){
|
||||
require_once("modules/EcmPaymentConditions/EcmPaymentCondition.php");
|
||||
$pc=new EcmPaymentCondition();
|
||||
$pc->retrieve($this->ecmpaymentcondition_id);
|
||||
}
|
||||
|
||||
$pdf->SetXY(160,$old_y+10+$personplus);
|
||||
|
||||
$table = array();
|
||||
|
||||
$table [0]['date_reg'] = array('width' => 20, 'value' => "Data wystawienia", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [0]['date_reg_value'] = array('width' => 36, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
$table [1]['date_reg1'] = array('width' => 20, 'value' => "Data przedpłaty", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [1]['date_reg1_value'] = array('width' => 36, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
|
||||
|
||||
if($this->ecmpaymentcondition_id){
|
||||
$table [2]['payment_method'] = array('width' => 20, 'value' => "Metoda płatności", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [2]['payment_method_value'] = array('width' => 25, 'value' => $app_list_strings['ecmpaymentconditions_payment_method_dom'][$pc->payment_method], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
}
|
||||
|
||||
$pdf->SetXY(143,$pdf->tMargin);
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
|
||||
$pdf->Ln(5);
|
||||
|
||||
$pdf->SetFont('arialpl','','18');
|
||||
$pdf->SetXY(60,$pdf->tMargin+10);
|
||||
|
||||
$pdf->MultiCell(80,7,"Faktura VAT"." ".$this->document_no,0,'C');
|
||||
$pdf->SetFont('arialpl', 'B', 7);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(60);
|
||||
|
||||
$pdf->SetY($ynew);
|
||||
|
||||
$table = array();
|
||||
if(!$this->currency_value)$this->currency_value=1;
|
||||
$table [0][] = array('width' => 4, 'value' => "Lp.", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 32, 'value' => "Nazwa", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 7, 'value' => "Ilość", 'border' => 1, 'overflow' => 1,'font-style' => 'b', 'align' => 'L');
|
||||
$table [0][] = array('width' => 5, 'value' => "J.M.", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 12, 'value' => "Cena Netto", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 12, 'value' => "Wartość Netto", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 8, 'value' => "VAT", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 11, 'value' => "Wartość Vat", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0][] = array('width' => 11, 'value' => "Wartośc Brutto", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [1][] = array('width' => 4, 'value' => "1", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [1][] = array('width' => 32, 'value' => $this->description, 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [1][] = array('width' => 7, 'value' => "1", 'border' => 1, 'overflow' => 1,'font-style' => '', 'align' => 'L');
|
||||
$table [1][] = array('width' => 5, 'value' => "SZT.", 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [1][] = array('width' => 12, 'value' => number_format(($this->inv_value/(1+$this->ecmvat_value/100))*$this->currency_value,2,",",".").$this->currency_id, 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [1][] = array('width' => 12, 'value' => number_format(($this->inv_value/(1+$this->ecmvat_value/100))*$this->currency_value,2,",",".").$this->currency_id, 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [1][] = array('width' => 8, 'value' => $this->ecmvat_name, 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [1][] = array('width' => 11, 'value' => number_format(($this->inv_value-($this->inv_value/(1+$this->ecmvat_value/100)))*$this->currency_value,2,",",".")." ".$this->currency_id, 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$table [1][] = array('width' => 11, 'value' => $this->inv_value, 'border' => 1,'font-style' => '', 'overflow' => 1, 'align' => 'L');
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
|
||||
$pdf->SetFont('arialpl','','7');
|
||||
global $mod_strings;
|
||||
|
||||
|
||||
$currency = new Currency();
|
||||
$currency->retrieve($this->currency_id);
|
||||
$this->currency_symbol=$currency->iso4217;
|
||||
|
||||
|
||||
|
||||
$lv=return_app_list_strings_language($this->ecmlanguage);
|
||||
if($this->ecmsale_id){
|
||||
include_once("modules/EcmSales/EcmSale.php");
|
||||
$sale=new EcmSale();
|
||||
$sale->retrieve($this->ecmsale_id);
|
||||
$this->position_list=$sale->getPositionList(true);
|
||||
$calc = $sale->calculate($this->position_list,true);
|
||||
}
|
||||
$pdf->Ln(5);
|
||||
$name_w = 43;
|
||||
|
||||
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
|
||||
|
||||
|
||||
$y=$pdf->GetY();
|
||||
|
||||
$rzal=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select date_entered from ecmprepaymentinvoices where id='".$this->id."'"));
|
||||
$wi=$GLOBALS['db']->query("select document_no,register_date,inv_value,date_entered,currency_value from ecmprepaymentinvoices where deleted='0' and ecmsale_id='".$this->ecmsale_id."' and date_entered<'".$rzal['date_entered']."'");
|
||||
|
||||
if (mysql_num_rows($wi) > 0) {
|
||||
$table = array();
|
||||
|
||||
$table [0]['position'] = array('width' => 4, 'value' => "Lp.", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0]['number'] = array('width' => 13, 'value' => "Numer faktury", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0]['date'] = array('width' => 11, 'value' => "Data", 'border' => 1, 'overflow' => 1,'font-style' => 'b', 'align' => 'L');
|
||||
$table [0]['value'] = array('width' => 17, 'value' => "Wartość brutto", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'R');
|
||||
$pdf->MultiCell(80,7,"Poprzednie zaliczki:",0,'L');
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
$table=array();
|
||||
$i = 1;
|
||||
$lv=return_app_list_strings_language($this->ecmlanguage);
|
||||
$rzal=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select date_entered from ecmprepaymentinvoices where id='".$this->id."'"));
|
||||
$wi=$GLOBALS['db']->query("select document_no,register_date,inv_value,date_entered,currency_value from ecmprepaymentinvoices where deleted='0' and ecmsale_id='".$this->ecmsale_id."' and date_entered<'".$rzal['date_entered']."'");
|
||||
while($ri=$GLOBALS['db']->fetchByAssoc($wi)){
|
||||
$m++;
|
||||
if(!$ri['currency_value'])$ri['currency_value']=1;
|
||||
$sum+=$ri['inv_value']*$ri['currency_value'];
|
||||
$table [$m]['position'] = array('width' => 4, 'value' => $m, 'border' => 1, 'align' => 'L', );
|
||||
$table [$m]['number'] = array('width' => 13, 'value' => $ri['document_no'], 'border' => 1, 'align' => 'L', );
|
||||
$table [$m]['date'] = array('width' => 11, 'value' => $ri['register_date'], 'border' => 1, 'align' => 'L', );
|
||||
$table [$m]['value'] = array('width' => 17, 'value' => number_format($ri['inv_value'],2,",",".")." PLN", 'border' => 1, 'align' => 'C', );
|
||||
}
|
||||
$table [$m+1]['position'] = array('width' => 4, 'value' => "", 'border' => 1, 'align' => 'L', );
|
||||
$table [$m+1]['number'] = array('width' => 13, 'value' => "", 'border' => 1, 'align' => 'L', );
|
||||
$table [$m+1]['date'] = array('width' => 11, 'value' => "Razem", 'border' => 1, 'align' => 'L', );
|
||||
$table [$m+1]['value'] = array('width' => 17, 'value' => number_format($sum,2,",",".")." PLN", 'border' => 1, 'align' => 'C', );
|
||||
$pdf->DrawTable($table);
|
||||
}
|
||||
$pdf->SetXY(114,$y);
|
||||
$table = array();
|
||||
|
||||
$table [0]['rate'] = array('width' => 8, 'value' => "Stawka", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0]['netto'] = array('width' => 16, 'value' => "Wartość netto", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'L');
|
||||
$table [0]['vat'] = array('width' => 10, 'value' => "Vat", 'border' => 1, 'overflow' => 1,'font-style' => 'b', 'align' => 'L');
|
||||
$table [0]['brutto'] = array('width' => 16, 'value' => "Wartość brutto", 'border' => 1,'font-style' => 'b', 'overflow' => 1, 'align' => 'R');
|
||||
$pdf->MultiCell(80,7,"Rozliczenie zaliczki wg stawek:",0,'L');
|
||||
$pdf->SetX(114);
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
$this->currency_value=1;
|
||||
$table=array();
|
||||
$i=1;
|
||||
$table [$i]['rate'] = array('width' => 8, 'value' => $this->ecmvat_name, 'border' => 1, 'align' => 'L', );
|
||||
$table [$i]['netto'] = array('width' => 16, 'value' => number_format(($this->inv_value/(1+$this->ecmvat_value/100))*$this->currency_value,2,",",".").$this->currency_id, 'border' => 1, 'align' => 'L', );
|
||||
$table [$i]['vat'] = array('width' => 10, 'value' => number_format(($this->inv_value-($this->inv_value/(1+$this->ecmvat_value/100)))*$this->currency_value,2,",",".")." ".$this->currency_id, 'border' => 1, 'align' => 'L', );
|
||||
$table [$i]['brutto'] = array('width' => 16, 'value' => number_format(($this->inv_value)*$this->currency_value,2,",",".")." PLN", 'border' => 1, 'align' => 'R', );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//$table=array();
|
||||
$pdf->SetX(114);
|
||||
$pdf->DrawTable($table);
|
||||
|
||||
?>
|
||||
87
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/e5/footer.php
Executable file
87
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/e5/footer.php
Executable file
@@ -0,0 +1,87 @@
|
||||
<?
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetY($this->fh-15);
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->SetFillColor(255,255,255);
|
||||
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Cell(0, 10, $this->PageNo().'/{nb}');
|
||||
|
||||
$this->Ln(5);
|
||||
$this->AliasNbPages();
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->getBreakLine()-6,$this->fw-$this->rMargin,$this->fh-$this->bMargin-6+1);
|
||||
|
||||
|
||||
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
|
||||
// $this->bMargin = 3;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin);
|
||||
return;
|
||||
} else {
|
||||
// $this->bMargin = 19;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin+$this->tMarign+5);
|
||||
}
|
||||
|
||||
$this->SetXY($this->lMargin,$this->fh-$this->bMargin+3-6);
|
||||
$r=mysql_fetch_array(mysql_query("select document_no from ecminvoiceouts where id='".$_REQUEST['record']."'"));
|
||||
if($r['document_no']=="FV 874/10"){
|
||||
$this->Cell(170,4,"Towar z możliwością zwrotu w przeciągu 90 dni. Zwrotowi podlega towar nie zniszczony, nie używany,",0,0,"C");
|
||||
$this->Ln();
|
||||
$this->Cell(170,4,"bez cenówek, bez bind, bez kodów zabezpieczających, w nie uszkodzonych opakowaniach.",0,0,"C");
|
||||
$this->Ln(6);
|
||||
}
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,$this->edt->footer_account);
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'KRS: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->footer_krs,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,$this->edt->footer_address);
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'NIP: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->footer_nip,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,$this->edt->footer_phone);
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'REGON: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->footer_regon,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,$this->edt->footer_fax);
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'Bank: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->footer_bankname,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,'www.e5.pl');
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'Numer konta: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->account_number,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,'');
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'Numer GIOŚ: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,"E0006254W",0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont("arialpl","B",8);
|
||||
$this->SetXY(40,$this->GetY()+7);
|
||||
$this->Cell(45,4,$r['document_no'],0,0,'L');
|
||||
?>
|
||||
44
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/e5/header.php
Executable file
44
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/e5/header.php
Executable file
@@ -0,0 +1,44 @@
|
||||
<?
|
||||
set_time_limit(99999);
|
||||
error_reporting(0);
|
||||
$mod_strings = return_module_language($this->ecmlanguage, 'EcmSales', true);
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '' && file_exists($this->edt->logo_path)){
|
||||
$this->Image($this->edt->logo_path,15,5,0,23);
|
||||
}
|
||||
|
||||
$this->SetFont('arialpl', '', 10);
|
||||
// get document
|
||||
$doc = new EcmDocumentTemplate();
|
||||
$doc->retrieve('97700b0d-fbe9-e366-4016-4b260f058a47');
|
||||
$footer_address = explode(",", $doc->footer_address);
|
||||
// owner title
|
||||
if($_REQUEST['type']=='proforma'){
|
||||
$owner_title=$mod_strings['LBL_PDF_TITLE_PROFORMA'];
|
||||
} else { $owner_title=$mod_strings['LBL_PDF_TITLE_ZS'];}
|
||||
|
||||
$this->SetXY(15+30,5);
|
||||
$this->SetFont ( 'arialpl', 'B', '10' );
|
||||
$this->Cell ( 110, 4, $owner_title);
|
||||
$this->Ln ();
|
||||
$this->SetXY(15+30,10);
|
||||
$this->SetFont ( 'arialpl', '', '10' );
|
||||
$this->Cell ( 110, 4, $doc->name);
|
||||
|
||||
$this->Ln ();
|
||||
$this->SetXY(15+30,14);
|
||||
$this->Cell ( 110, 4,$footer_address[0]);
|
||||
$this->Ln ();
|
||||
$this->SetXY(15+30,18);
|
||||
$this->Cell ( 110, 4,$footer_address[1] );
|
||||
$this->Ln ();
|
||||
$this->SetXY(15+30,22);
|
||||
$this->Cell ( 20, 4, 'NIP: '.$doc->footer_nip );
|
||||
$this->Ln ();
|
||||
|
||||
$this->Line(10,30,200,30);
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,88 @@
|
||||
<?
|
||||
|
||||
//payment conditions
|
||||
/*if(!empty($this->ecmpaymentcondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmpaymentcondition_text,0,'L');
|
||||
$pdf->Ln();
|
||||
}*/
|
||||
/*
|
||||
if($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl','b','12');
|
||||
$pdf->Ln(3);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE']." ".format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))).' '.$this->currency_symbol);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
*/
|
||||
$pdf->Ln(10);
|
||||
if($pdf->GetY()>240)$pdf->AddPage();
|
||||
if($this->type=="correct"){
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
|
||||
$w=$GLOBALS['db']->query("select price,ecmvat_value,quantity,ecminvoiceoutitem_id from ecminvoiceoutitems where ecminvoiceout_id='".$this->id."'");
|
||||
while($r=$GLOBALS['db']->fetchByAssoc($w)){
|
||||
$total+=$r['price']*$r['quantity']+round($r['price']*$r['quantity']*$r['ecmvat_value']/100,2);
|
||||
$rr=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select price,quantity,ecmvat_value from ecminvoiceoutitems where id='".$r['ecminvoiceoutitem_id']."'"));
|
||||
$total-=$rr['price']*$rr['quantity']+round($rr['price']*$rr['quantity']*$rr['ecmvat_value']/100,2);
|
||||
}
|
||||
|
||||
if($total>0)$string=$mod_strings['LBL_PDF_TO_PAID'];
|
||||
else $string=$mod_strings['LBL_PDF_TO_PAID_BACK'];
|
||||
$pdf->Cell(30,4,$string,0,0,'L',1);
|
||||
$pdf->SetFont('arialpl','B','8');
|
||||
$pdf->Cell(30,4,format_number(abs($total)).' '.$this->currency_symbol,0,0,'L',1);
|
||||
}
|
||||
else {
|
||||
$total=0;
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$w=$GLOBALS['db']->query("select price,ecmvat_value,quantity,ecminvoiceoutitem_id from ecminvoiceoutitems where ecminvoiceout_id='".$this->id."'");
|
||||
while($r=$GLOBALS['db']->fetchByAssoc($w)){
|
||||
$total+=$r['price']*$r['quantity']+round($r['price']*$r['quantity']*$r['ecmvat_value']/100,2);
|
||||
}
|
||||
$total-=floatval(str_replace(",",".",str_replace(".","",$this->discount)));
|
||||
$total=format_number($total);
|
||||
$pdf->Cell(30,4,$mod_strings['LBL_PDF_TO_PAID'],0,0,'L',1);
|
||||
$pdf->SetFont('arialpl','B','8');
|
||||
$pdf->Cell(30,4,$total,0,0,'L',1);
|
||||
}
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->Cell(30,4,$mod_strings['LBL_PDF_TOTAL_BY_WORD'],0,0,'L',1);
|
||||
$pdf->SetFont('arialpl','B','8');
|
||||
if($this->type=="correct"){
|
||||
$tot=format_number(abs((float)$total));
|
||||
$tot=str_replace(".","",$tot);
|
||||
//$tot=str_replace(",",".",$tot);
|
||||
$sl=$this->slowniePL($tot);
|
||||
}
|
||||
else {
|
||||
$tot=str_replace(".","",str_replace("PLN","",$total));
|
||||
$sl=$this->slowniePL($tot);
|
||||
}
|
||||
if($this->document_no=="FV 1421/10")$sl="one thousand one hundred six EUR 41/100";
|
||||
$pdf->Cell(150,4,$sl,0,0,'L',1);
|
||||
|
||||
$pdf->Ln(20);
|
||||
$pdf->SetFont('arialpl','','7');
|
||||
$pdf->Cell(85,1,"...............................................................",0,0,'L',1);
|
||||
$pdf->Cell(85,1,"...............................................................",0,0,'R',1);
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(43,1,$mod_strings['LBL_PDF_OWNER_SIGNATURE'],0,0,'C',1);
|
||||
$pdf->SetX(155);
|
||||
$pdf->Cell(35,1,$mod_strings['LBL_PDF_RECEIVER_SIGNATURE'],0,0,'C',1);$pdf->Ln(4);
|
||||
$pdf->Cell(43,1,$this->setUser()->full_name,0,0,'C',1);
|
||||
|
||||
//footer text
|
||||
$pdf->Ln(18);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
|
||||
|
||||
//header text
|
||||
$pdf->Ln(6);
|
||||
$pdf->SetFont('arialpl','B','8');
|
||||
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
|
||||
|
||||
|
||||
|
||||
?>
|
||||
394
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/e5/subheader.php
Executable file
394
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/e5/subheader.php
Executable file
@@ -0,0 +1,394 @@
|
||||
<?
|
||||
global $app_list_strings;
|
||||
echo __LINE__;exit;
|
||||
|
||||
$address = str_replace("<","<",str_replace(">",">",$this->parent_name));
|
||||
if($this->parent_contact_name) {
|
||||
$address .= "\n".$this->parent_contact_name;
|
||||
if($this->parent_contact_title) {
|
||||
$address .= "\n".$this->parent_contact_title;
|
||||
}
|
||||
$personplus=5;
|
||||
}
|
||||
else $personplus=0;
|
||||
|
||||
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
|
||||
if($this->parent_address_postalcode) $address .= "\n".$this->parent_address_postalcode;
|
||||
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
|
||||
//if($this->to_vatid) $address .= "\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
|
||||
if($this->to_nip) $address .= "\n".$mod_strings['LBL_PDF_NIP'].": ".$this->to_nip;
|
||||
elseif(!$this->to_nip && $this->to_vatid) $address .= "\n".$mod_strings['LBL_PDF_NIP'].": ".$this->to_vatid;
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iln,to_nip from accounts where id='".$this->parent_id."'"));
|
||||
if($r['iln'])$address .= "\nILN: ".$r['iln'];
|
||||
|
||||
//to address
|
||||
$old_x=$pdf->GetX();
|
||||
$old_y=$pdf->GetY();
|
||||
|
||||
$pdf->SetXY(25,53);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35,1,"WYSTAWCA:",0,0,'L',1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(25);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select vatid from accounts where id='".$pdf->edt->account_id."'"));
|
||||
if($r['vatid'])$pdf->edt->header_text .= "\nNip: ".$r['vatid'];
|
||||
if($r['iln'])$pdf->edt->header_text .= "\nILN: ".$r['iln'];
|
||||
$pdf->MultiCell(60,4,$pdf->edt->header_text,0,'L');
|
||||
|
||||
$pdf->SetXY(81,53);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35,1,"ODBIORCA:",0,0,'L',1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(81);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$pdf->MultiCell(60,4,$address,0,'L');
|
||||
|
||||
if($this->type=="correct"){
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select wz_id from ecminvoiceouts where id='".$this->ecminvoiceout_id."'"));
|
||||
$wz_id=$r['wz_id'];
|
||||
}
|
||||
else $wz_id=$this->wz_id;
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select * from ecmstockdocouts where id='".$wz_id."'"));
|
||||
if($r['parent_id']==$this->parent_id){
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select name as parent_name,shipping_address_street as parent_address_street,shipping_address_city as parent_address_city,shipping_address_postalcode as parent_address_postalcode,shipping_address_country as parent_address_country from accounts where id='".$this->parent_id."'"));
|
||||
}
|
||||
$address="";
|
||||
$address = str_replace("<","<",str_replace(">",">",$r['parent_name']));
|
||||
if($r['parent_address_street']) $address .= "\n".$r['parent_address_street'];
|
||||
if($r['parent_address_postalcode']) $address .= "\n".$r['parent_address_postalcode'];
|
||||
if($r['parent_address_city']) $address .= " ".$r['parent_address_city'];
|
||||
if($r['to_nip']) $address .= "\n".$mod_strings['LBL_PDF_NIP'].": ".$r['to_nip'];
|
||||
elseif(!$r['to_nip'] && $r['to_vatid']) $address .= "\n".$mod_strings['LBL_PDF_NIP'].": ".$r['to_vatid'];
|
||||
$rr=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iln from accounts where id='".$r['parent_id']."'"));
|
||||
if($rr['iln'])$address .= "\nILN: ".$rr['iln'];
|
||||
|
||||
|
||||
$pdf->SetXY(143,53);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35,1,"DOSTAWA:",0,0,'L',1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(143);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$pdf->MultiCell(60,4,$address,0,'L');
|
||||
$ynew=$pdf->GetY()+12;
|
||||
|
||||
|
||||
|
||||
if($this->ecmpaymentcondition_id){
|
||||
require_once("modules/EcmPaymentConditions/EcmPaymentCondition.php");
|
||||
$pc=new EcmPaymentCondition();
|
||||
$pc->retrieve($this->ecmpaymentcondition_id);
|
||||
}
|
||||
|
||||
$pdf->SetXY(160,$old_y+10+$personplus);
|
||||
|
||||
$table = array();
|
||||
|
||||
|
||||
$table [0]['place_of_register'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_PLACE_OF_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [0]['place_of_register_value'] = array('width' => 25, 'value' => $this->template->place_of_register, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$table [1]['date_reg'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [1]['date_reg_value'] = array('width' => 36, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$table [2]['date_sell'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_SELL_DATE'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [2]['date_sell_value'] = array('width' => 36, 'value' => $this->sell_date, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
|
||||
|
||||
if($this->ecmpaymentcondition_id){
|
||||
$table [4]['payment_termin'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_PAYMENT_TERMIN'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select paid from ecminvoiceouts where id='".$_REQUEST['record']."'"));
|
||||
if($r['paid']==1)$paid="zaplacono";
|
||||
else $paid=$pc->days." ".$mod_strings['LBL_PDF_DAYS'];
|
||||
if($this->document_no=="FV 1421/10")$table [4]['payment_termin_value'] = array('width' => 36, 'value' => "prepayment", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
else $table [4]['payment_termin_value'] = array('width' => 36, 'value' => $paid, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
}
|
||||
|
||||
if($this->ecmpaymentcondition_id){
|
||||
$table [5]['payment_method'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_PAYMENT_METHOD'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
if($this->document_no=="FV 1421/10")$table [5]['payment_method_value'] = array('width' => 25, 'value' => "money transfer", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
else $table [5]['payment_method_value'] = array('width' => 25, 'value' => $app_list_strings['ecmpaymentconditions_payment_method_dom'][$pc->payment_method], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
}
|
||||
if($this->supplier_code) {
|
||||
$table [6]['cr'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_SUPPLIER_CODE'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [6]['cr_value'] = array('width' => 25, 'value' => $this->supplier_code, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
}
|
||||
|
||||
if($this->type == "normal") {
|
||||
if(file_exists("modules/EcmStockDocOuts/EcmStockDocOut.php")){
|
||||
require_once("modules/EcmStockDocOuts/EcmStockDocOut.php");
|
||||
$wz=new EcmStockDocOut();
|
||||
$wz->retrieve($this->wz_id);
|
||||
}
|
||||
$table [7]['wz'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_TO_WZ'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [7]['wz_value'] = array('width' => 25, 'value' => $wz->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
}
|
||||
else{
|
||||
$this->loadEcmInvoiceOut();
|
||||
$this->ecminvoiceout->format_all_fields();
|
||||
$table [7]['wz'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT_TO'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [7]['wz_value'] = array('width' => 25, 'value' => $this->ecminvoiceout->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
}
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select so_id from ecminvoiceouts where id='".$this->id."'"));
|
||||
$this->so_id=$r['so_id'];
|
||||
if(!$this->so_id)$this->so_id=$_SESSION['invoice_so_id'];
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select wz_id from ecminvoiceouts where id='".$this->id."'"));
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select so_id from ecmstockdocouts where id='".$r['wz_id']."'"));
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select order_no from ecmsales where id='".$r['so_id']."'"));
|
||||
if($r['order_no'] && $this->type!="correct"){
|
||||
$table [8]['order_no'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_ORDER_NO'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [8]['order_no_value'] = array('width' => 25, 'value' => $r['order_no'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
}
|
||||
if($this->type != "normal") {
|
||||
if(!$this->so_id)$this->so_id=$_SESSION['invoice_so_id'];
|
||||
$r_so=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select * from ecmsales where id='".$this->so_id."'"));
|
||||
$table [9]['cr'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_CORRECT_REASON'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [9]['cr_value'] = array('width' => 25, 'value' => $this->order_no, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
}
|
||||
|
||||
$pdf->SetXY(143,$pdf->tMargin);
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
|
||||
$pdf->Ln(9);
|
||||
|
||||
$pdf->SetFont('arialpl','','18');
|
||||
$pdf->SetXY(60,$pdf->tMargin+10);
|
||||
if($this->type == "normal"){
|
||||
$pdf->MultiCell(80,7,$mod_strings['LBL_PDF_DOCUMENT_NAME']." ".$this->document_no,0,'C');
|
||||
$pdf->SetFont('arialpl', 'B', 7);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(60);
|
||||
$pdf->Cell(80,1,$mod_strings['LBL_PDF_ORIGINAL_COPY'],0,0,'C',1);
|
||||
}
|
||||
else if($this->type == "correct") {
|
||||
$pdf->MultiCell(80,7,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT']." ".$this->document_no,0,'C');
|
||||
$pdf->SetFont('arialpl', 'B', 7);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(60);
|
||||
$pdf->Cell(80,1,$mod_strings['LBL_PDF_ORIGINAL_COPY'],0,0,'C',1);
|
||||
}
|
||||
|
||||
$this->loadParser();
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
$pdf->SetY($ynew);
|
||||
|
||||
/*if($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl','b','10');
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_BEFORE_CORRECT']);
|
||||
$pdf->Ln(3);
|
||||
$this->ecminvoiceout->DrawPositions($pdf);
|
||||
$pdf->SetFont('arialpl','b','10');
|
||||
$pdf->Ln(4);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_AFTER_CORRECT']);
|
||||
$pdf->Ln(3);
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$pdf->SetFont('arialpl','','7');
|
||||
global $mod_strings;
|
||||
|
||||
|
||||
$currency = new Currency();
|
||||
$currency->retrieve($this->currency_id);
|
||||
$this->currency_symbol=$currency->iso4217;
|
||||
|
||||
if(!isset($this->position_list) || !is_array($this->position_list))
|
||||
$this->position_list = $this->getPositionList(true);
|
||||
$calc = $this->calculate($this->position_list,true);
|
||||
//$this->position_list = $this->formatPositions($this->position_list);
|
||||
|
||||
$calc['total'] .= ' '.$this->currency_symbol;
|
||||
$calc['subtotal'] .= ' '.$this->currency_symbol;
|
||||
if($calc['discount']) {
|
||||
$calc['total2'] .= ' '.$this->currency_symbol;
|
||||
$calc['discount']['value'] .= ' '.$this->currency_symbol;
|
||||
}
|
||||
|
||||
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
|
||||
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
|
||||
|
||||
|
||||
|
||||
$pdf->Ln(7);
|
||||
$name_w = 20;
|
||||
//if($calc['draw_discount']) $name_w -= 8;
|
||||
//if($calc['draw_vat']) $name_w -= 8;
|
||||
$table = array();
|
||||
$table [0]['position'] = array('width' => 4, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 8);
|
||||
$table [0]['description'] = array('width' => $name_w, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//$table [0]['tax_code'] = array('width' => 7, 'value' => $mod_strings['LBL_PDF_LIST_TAX_CODE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['recipient_code'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_TAX_CODE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['quantity'] = array('width' => 7, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['unit'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 8);
|
||||
$table [0]['unit_price'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
|
||||
$table [0]['unit_price_total'] = array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL_PRICE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//if($calc['draw_discount'])
|
||||
//$table [0]['discount'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_DISCOUNT'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//if($calc['draw_vat']) {
|
||||
if($this->currency_symbol!="USD"){
|
||||
$table [0]['vat_id'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_VAT'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['vat_value'] = array('width' => 13, 'value' => $mod_strings['LBL_PDF_LIST_VAT_VALUE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//}
|
||||
}
|
||||
|
||||
if($this->currency_symbol=="USD"){
|
||||
$table [0]['nw'] = array('width' => 9, 'value' => "Netto weight",'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['bw'] = array('width' => 9, 'value' => "Brutto weight",'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
}
|
||||
|
||||
$table [0]['total'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
if($this->type!="normal")$pdf->SetY(76);
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
|
||||
$i = 1;
|
||||
|
||||
$table=array();
|
||||
|
||||
$lv=return_app_list_strings_language($this->ecmlanguage);
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
if($this->type=="correct"){
|
||||
$rrrr=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select quantity,price from ecminvoiceoutitems where id='".$p['iid']."'"));
|
||||
$rrr=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select quantity,price from ecminvoiceoutitems where id='".$p['item_id']."'"));
|
||||
if((float)$rrrr['quantity']==(float)$rrr['quantity'] && (float)$rrrr['price']==(float)$rrr['price'])continue;
|
||||
}
|
||||
|
||||
$j++;
|
||||
|
||||
|
||||
$table [$i]['position'] = array('width' => 4, 'value' => $j, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$table [$i]['description'] = array('width' => $name_w, 'value' => htmlspecialchars_decode($p['code'].' '.$p['name']), 'border' => 1, 'align' => 'L', 'font-size' => 7 );
|
||||
$table [$i]['recipient_code'] = array('width' => 10, 'value' => $p['recipient_code'],'border' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$table [$i]['quantity'] = array('width' => 7, 'value' => $p['quantity'], 'border' => 1, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit'] = array('width' => 5, 'value' => $lv['ecmproducts_unit_dom'][$p['unit_id']], 'border' => 1, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit_price'] = array('width' => 10, 'value' => format_number($p['price']).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$price_total=($p['price'])*$p['quantity'];
|
||||
$table [$i]['unit_price_total'] = array('width' => 12, 'value' => format_number($price_total).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
if($this->currency_symbol!="USD"){
|
||||
$table [$i]['vat_id'] = array('width' => 5, 'value' => format_number($p['vat_value']), 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$vat_value=round($price_total*($p['vat_value']/100),2);
|
||||
$table [$i]['vat_value'] = array('width' => 13, 'value' => format_number($vat_value).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
}
|
||||
if($this->currency_symbol=="USD"){
|
||||
$table [$i]['nw'] = array('width' => 9, 'value' => format_number(floatval(str_replace(",",".",$p['netto_weight']))),'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$table [$i]['bw'] = array('width' => 9, 'value' => format_number(floatval(str_replace(",",".",$p['brutto_weight']))),'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$nw+=floatval(str_replace(",",".",$p['netto_weight']));
|
||||
$bw+=floatval(str_replace(",",".",$p['brutto_weight']));
|
||||
}
|
||||
$table [$i]['total'] = array('width' => 14, 'value' => format_number($price_total+$vat_value).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
|
||||
|
||||
|
||||
$totals[$p['vat_id']]['price']+=$price_total;
|
||||
$totals[$p['vat_id']]['total']+=$price_total+$vat_value;
|
||||
$totals[$p['vat_id']]['vat']+=$vat_value;
|
||||
$sum_total+=$price_total+$vat_value;
|
||||
$sum_netto+=$price_total;
|
||||
|
||||
if($this->type=="correct"){
|
||||
$i++;
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select * from ecminvoiceoutitems where id='".$p['item_id']."'"));
|
||||
if($p['id']==$p['item_id'])$ssss="t";
|
||||
$table [$i]['position'] = array('width' => 4, 'value' => '', 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$table [$i]['description'] = array('width' => $name_w, 'value' => "bylo".$ssss, 'border' => 1, 'align' => 'L', 'font-size' => 7 );
|
||||
$table [$i]['recipient_code'] = array('width' => 10, 'value' => "",'border' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$table [$i]['quantity'] = array('width' => 7, 'value' => (int)$r['quantity'], 'border' => 1, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit'] = array('width' => 5, 'value' => $lv['ecmproducts_unit_dom'][$r['dd_unit_id']], 'border' => 1, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit_price'] = array('width' => 10, 'value' => format_number($r['price']).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$price_total=($r['price']-($r['price']*$r['discount']/100))*$r['quantity'];
|
||||
$table [$i]['unit_price_total'] = array('width' => 12, 'value' => format_number($price_total).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$table [$i]['vat_id'] = array('width' => 5, 'value' => format_number($r['ecmvat_value']), 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$vat_value=round($price_total*($r['ecmvat_value']/100),2);
|
||||
$table [$i]['vat_value'] = array('width' => 13, 'value' => format_number($vat_value).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$table [$i]['total'] = array('width' => 14, 'value' => format_number($price_total+$vat_value).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
|
||||
$totals[$p['vat_id']]['price']-=$price_total;
|
||||
$totals[$p['vat_id']]['total']-=($price_total+$vat_value);
|
||||
$totals[$p['vat_id']]['vat']-=$vat_value;
|
||||
$sum_total-=($price_total+$vat_value);
|
||||
$sum_netto-=$price_total;
|
||||
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$pdf->DrawTable($table,array(0));
|
||||
//total, vat, subtotal
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
|
||||
//$pdf->SetX($pdf->fw-$pdf->rMargin-$pr*34);
|
||||
$table = array();
|
||||
|
||||
if($calc['vats']) {
|
||||
/*$table [] = array(
|
||||
'subtotal1' => array('width' => 42, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7),
|
||||
'subtotal2' => array('width' => 14, 'value' => $calc['subtotal'].' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7), );
|
||||
*/
|
||||
$table [] = array(
|
||||
'vat_rate' => array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_VAT'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7),
|
||||
'netto_total' => array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL_PRICE'], 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7),
|
||||
'vat_total' => array('width' => 13, 'value' => $mod_strings['LBL_PDF_LIST_VAT_VALUE'], 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7),
|
||||
'vat2' => array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7), );
|
||||
|
||||
foreach($calc['vats'] as $key => $value){
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select id,name,value from ecmvats where id='".$key."'"));
|
||||
$vvn=$r['name'];
|
||||
$table [] = array(
|
||||
'vat_rate' => array('width' => 10, 'value' => format_number($r['value']), 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'netto_total' => array('width' => 12, 'value' => format_number($totals[$r['id']]['price']).' '.$this->currency_symbol, 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat_total' => array('width' => 13, 'value' => format_number($totals[$r['id']]['vat']).' '.$this->currency_symbol, 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat2' => array('width' => 14, 'value' => format_number($totals[$r['id']]['total']).' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7), );
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($calc['discount'])) {
|
||||
$disc=floatval(str_replace(",",".",str_replace(".","",$this->discount)));
|
||||
$table [] = array(
|
||||
'total21' => array('width' => 35, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total22' => array('width' => 14, 'value' => $calc['total2'], 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7), );
|
||||
$table [] = array(
|
||||
'discount1' => array('width' => 35, 'value' => $mod_strings['LBL_PDF_DISCOUNT'], 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'discount2' => array('width' => 14, 'value' => format_number($disc).' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7), );
|
||||
}
|
||||
if($this->currency_symbol=="USD"){
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 10, 'value' => $mod_strings['LBL_PDF_END_TOTAL'], 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total2' => array('width' => 12, 'value' => format_number($sum_netto-floatval(str_replace(",",".",str_replace(".","",str_replace("PLN","",$calc['discount']['value']))))).' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total3' => array('width' => 9, 'value' => format_number($nw), 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total4' => array('width' => 9, 'value' => format_number($bw), 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total5' => array('width' => 14, 'value' => format_number($sum_total-floatval(str_replace(",",".",str_replace(".","",str_replace("PLN","",$calc['discount']['value']))))).' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7, 'font-style' => 'b'), );
|
||||
}
|
||||
else{
|
||||
$brutto=$sum_total-$disc;
|
||||
$netto=$sum_netto;
|
||||
$vvat=$brutto-$netto;
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 10, 'value' => $mod_strings['LBL_PDF_END_TOTAL'], 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total2' => array('width' => 12, 'value' => format_number($netto).' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total3' => array('width' => 13, 'value' => format_number($vvat).' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total4' => array('width' => 14, 'value' => format_number($brutto).' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7, 'font-style' => 'b'), );
|
||||
|
||||
}
|
||||
if($pdf->GetY()+30>$pdf->fh-$pdf->bMargin)$pdf->AddPage();
|
||||
if($this->currency_symbol=="USD")$pdf->SetX(103);
|
||||
else $pdf->SetX(112);
|
||||
$pdf->DrawTable($table);
|
||||
$pdf->Ln(1);
|
||||
|
||||
//$table=array();
|
||||
|
||||
//$pdf->DrawTable($table);
|
||||
?>
|
||||
52
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/footer.php
Executable file
52
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/footer.php
Executable file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/*
|
||||
//if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
if ($this->page > 1) {
|
||||
$y = $this->fh - 20;
|
||||
$this->Line(10, $y, 200, $y);
|
||||
|
||||
$this->SetFont('arialpl', '', 10);
|
||||
|
||||
$this->SetXY(10, $this->fh - 16);
|
||||
$this->Cell(10, 0, $mod_strings['LBL_PDF_FOOTER_DOCUMENT_NAME'].' '.$this->focus->document_no);
|
||||
|
||||
$this->SetXY($this->fw-25,$this->fh-16);
|
||||
$this->Cell(10, 0, $mod_strings['LBL_PDF_SITE'].' '.$this->PageNo().'/{nb}');
|
||||
} else {
|
||||
$y = $this->fh - 20;
|
||||
$this->Line(10, $y, 200, $y);
|
||||
$this->SetFont('arialpl', '', 7.5);
|
||||
|
||||
$this->SetXY(10, $this->fh - 16);
|
||||
$this->Cell(49, 0, "Prezes Zarządu - J.Lasowy");
|
||||
$this->Cell(40, 0, "NIP: 879-016-88-72");
|
||||
$this->Cell(50, 0, "Sąd Rejonowy w Toruniu");
|
||||
|
||||
if($this->focus->currency_symbol == 'EUR')
|
||||
$this->Cell(30, 0, "Bank: City Handlowy");
|
||||
else
|
||||
$this->Cell(30, 0, "Konto: Alior Bank S.A. Oddział w Toruniu");
|
||||
|
||||
$this->SetXY(10, $this->fh - 12.5);
|
||||
$this->Cell(49, 0, "Wiceprezes - M.Lasowy");
|
||||
$this->Cell(40, 0, "REGON: 870525737");
|
||||
$this->Cell(50, 0, "VII Wydział Gospodarczy KRS");
|
||||
|
||||
if($this->focus->currency_symbol == 'EUR')
|
||||
$this->Cell(30, 0, "IBAN: PL 02 1030 1090 0000 0000 5802 0503");
|
||||
else
|
||||
$this->Cell(30, 0, "14 2490 0005 0000 4530 1266 3471");
|
||||
|
||||
$this->SetXY(10, $this->fh - 9);
|
||||
$this->Cell(49, 0, "");
|
||||
$this->Cell(40, 0, "Kapitał zakładowy 50 000 PLN");
|
||||
$this->Cell(50, 0, "KRS 0000160548");
|
||||
|
||||
if($this->focus->currency_symbol == 'EUR')
|
||||
$this->Cell(30, 0, "SWITF: CITIPLPX");
|
||||
|
||||
$this->SetXY($this->fw-22,$this->fh-7);
|
||||
$this->Cell(10, 0, $mod_strings['LBL_PDF_SITE'].' '.$this->PageNo().'/{nb}');
|
||||
}
|
||||
*/
|
||||
46
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/header.php
Executable file
46
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/header.php
Executable file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
$this->lMargin = 10;
|
||||
$this->rMargin = 25;
|
||||
|
||||
|
||||
set_time_limit(99999);
|
||||
error_reporting(0);
|
||||
$mod_strings = return_module_language($this->ecmlanguage, 'EcmSales', true);
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '' && file_exists($this->edt->logo_path)){
|
||||
$this->Image($this->edt->logo_path,15,5,0,23);
|
||||
}
|
||||
|
||||
$this->SetFont('arialpl', '', 10);
|
||||
// get document
|
||||
$doc = new EcmDocumentTemplate();
|
||||
$doc->retrieve('97700b0d-fbe9-e366-4016-4b260f058a47');
|
||||
$footer_address = explode(",", $doc->footer_address);
|
||||
// owner title
|
||||
|
||||
$this->SetXY(15+30,5);
|
||||
$this->SetFont ( 'arialpl', 'B', '10' );
|
||||
$this->Cell ( 110, 4,$mod_strings['LBL_PDF_TITLE_PROFORMA']);
|
||||
$this->Ln ();
|
||||
$this->SetXY(15+30,10);
|
||||
$this->SetFont ( 'arialpl', '', '10' );
|
||||
$this->Cell ( 110, 4, $doc->name);
|
||||
|
||||
$this->Ln ();
|
||||
$this->SetXY(15+30,14);
|
||||
$this->Cell ( 110, 4,$footer_address[0]);
|
||||
$this->Ln ();
|
||||
$this->SetXY(15+30,18);
|
||||
$this->Cell ( 110, 4,$footer_address[1] );
|
||||
$this->Ln ();
|
||||
$this->SetXY(15+30,22);
|
||||
$this->Cell ( 20, 4, 'NIP: '.$doc->footer_nip );
|
||||
$this->Ln ();
|
||||
|
||||
$this->Line(10,30,200,30);
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetY($this->fh-15);
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->SetFillColor(255,255,255);
|
||||
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Cell(0, 10, $this->PageNo().'/{nb}');
|
||||
|
||||
$this->Ln(5);
|
||||
$this->AliasNbPages();
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->getBreakLine(),$this->fw-$this->rMargin,$this->fh-$this->bMargin+1);
|
||||
|
||||
|
||||
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
|
||||
// $this->bMargin = 3;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin);
|
||||
return;
|
||||
} else {
|
||||
// $this->bMargin = 19;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin+$this->tMarign+5);
|
||||
}
|
||||
|
||||
$this->SetFont('arialpl','','8');
|
||||
$this->SetXY($this->lMargin+10,$this->fh-$this->bMargin+3);
|
||||
$this->MultiCell($this->fw-$this->lMargin-$this->rMargin-20,4,$this->edt->footer_text,0,'C');
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<?
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->fw-100-$this->rMargin,$this->tMargin);
|
||||
$this->MultiCell(100,3.15,$this->edt->header_text,0,'R');
|
||||
//logo
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
|
||||
if(file_exists($this->edt->logo_path))
|
||||
$this->Image($this->edt->logo_path,$this->lMargin,$this->tMargin,0,22.3);
|
||||
|
||||
/*
|
||||
//line
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->tMargin-1,$this->fw-$this->rMargin,$this->tMargin-1);
|
||||
*/
|
||||
//if($this->GetY() < $this->tMargin) $this->SetY($this->tMargin); else
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?
|
||||
|
||||
|
||||
//payment conditions
|
||||
if(!empty($this->ecmpaymentcondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmpaymentcondition_text,0,'L');
|
||||
}
|
||||
|
||||
|
||||
if($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl','b','12');
|
||||
$pdf->Ln(3);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE']." ".format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))).' '.$this->currency_symbol);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
|
||||
//footer text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
|
||||
@@ -0,0 +1,266 @@
|
||||
<?
|
||||
/*
|
||||
$pdf->Ln(10);
|
||||
|
||||
//$this->SetY($this->tMargin);
|
||||
|
||||
//from address
|
||||
$this->template->setAccount();
|
||||
$address = $this->template->account->name;
|
||||
if($this->template->account->billing_address_street) $address .= " - ".$this->template->account->billing_address_street;
|
||||
if($this->template->account->billing_address_postalcode) $address .= " - ".$this->template->account->billing_address_postalcode;
|
||||
|
||||
if($this->template->account->billing_address_city) $address .= " ".$this->template->account->billing_address_city;
|
||||
|
||||
$pdf->SetFont('arialpl', 'u', 8);
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->MultiCell(0,5,$address,0,'L');
|
||||
*/
|
||||
$y_tmp = $pdf->GetY();
|
||||
$pdf->SetLineWidth(0.5);
|
||||
$pdf->SetDrawColor(0,0,0);
|
||||
$pdf->Line(10,100,14,100);
|
||||
$pdf->SetXY($pdf->bMargin, $y_tmp);
|
||||
$pdf->SetLineWidth(0);
|
||||
|
||||
$pdf->Ln(6);
|
||||
if($pdf->page == 1)
|
||||
if($pdf->edt->address) {
|
||||
$pdf->Ln(9);
|
||||
$pdf->SetFont('arialpl', 'u', 8);
|
||||
$pdf->SetXY($pdf->lMargin, 55);
|
||||
$pdf->MultiCell(0,3.15,$pdf->edt->address,0,'L');
|
||||
$pdf->SetXY($pdf->lMargin, 60);
|
||||
}
|
||||
|
||||
//$pdf->Ln(2);
|
||||
|
||||
|
||||
//to address
|
||||
|
||||
$address = $this->parent_name;
|
||||
if($this->parent_contact_name) {
|
||||
$address .= "\n".$this->parent_contact_name;
|
||||
if($this->parent_contact_title) $address .= "\n".$this->parent_contact_title;
|
||||
}
|
||||
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
|
||||
if($this->parent_address_postalcode) $address .= "\n".$this->parent_address_postalcode;
|
||||
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
|
||||
if($this->to_vatid) $address .= "\n\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
|
||||
|
||||
$pdf->SetFont('arialpl', '', 10);
|
||||
|
||||
//$pdf->Ln(2);
|
||||
$current = $pdf->GetY();
|
||||
$pdf->MultiCell(0,4,$address,0,'L');
|
||||
$current2 = $pdf->GetY();
|
||||
|
||||
$pdf->SetLineWidth(0.5);
|
||||
$pdf->SetDrawColor(192,192,192);
|
||||
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-40,85);
|
||||
$pdf->SetFont('arialpl', 'B', 9);
|
||||
$pdf->MultiCell(40,6,$mod_strings['LBL_PDF_NUMBER'],'LTR');
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-40, $pdf->GetY()-1);
|
||||
$pdf->SetFont('arialpl', '', 9);
|
||||
$pdf->MultiCell(40,5,$this->document_no,'LBR');
|
||||
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-40,$pdf->GetY()+0.4);
|
||||
$pdf->SetFont('arialpl', 'B', 9);
|
||||
$pdf->MultiCell(40,6,$mod_strings['LBL_PDF_DATE_REGISTER'],'LTR');
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-40, $pdf->GetY()-1);
|
||||
$pdf->SetFont('arialpl', '', 9);
|
||||
$pdf->MultiCell(40,5,$this->register_date,'LBR');
|
||||
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-40,$pdf->GetY()+0.4);
|
||||
$pdf->SetFont('arialpl', 'B', 9);
|
||||
$pdf->MultiCell(40,6,$mod_strings['LBL_PDF_OWNER'],'LTR');
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-40, $pdf->GetY()-1);
|
||||
$pdf->SetFont('arialpl', '', 9);
|
||||
$pdf->MultiCell(40,5,$this->setUser()->full_name,'LBR');
|
||||
|
||||
/*
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-40,85);
|
||||
$table = array();
|
||||
$table [0]['data'] = array('width' => 40, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [1]['data'] = array('width' => 40, 'value' => $this->document_no, 'border' => 1, 'overflow' => 1, 'align' => 'L');
|
||||
$table [2]['data'] = array('width' => 40, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [3]['data'] = array('width' => 40, 'value' => $this->register_date, 'border' => 1, 'overflow' => 1, 'align' => 'L');
|
||||
$table [4]['data'] = array('width' => 40, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [5]['data'] = array('width' => 40, 'value' => $this->setUser()->full_name, 'border' => 1, 'overflow' => 1, 'align' => 'L');
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3.5);
|
||||
*/
|
||||
//$pdf->SetY($current2);
|
||||
|
||||
//$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','24');
|
||||
$y_tmp = $pdf->GetY();
|
||||
$pdf->SetXY($pdf->lMargin, 106);
|
||||
if($this->type == "normal")
|
||||
$pdf->MultiCell(0,0,$mod_strings['LBL_PDF_DOCUMENT_NAME'],0,'L');
|
||||
else if($this->type == "correct") {
|
||||
$pdf->MultiCell(0,0,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT'],0,'L');
|
||||
$this->loadEcmInvoiceOut();
|
||||
$this->ecminvoiceout->format_all_fields();
|
||||
$pdf->Ln(5);
|
||||
$pdf->SetFont('arialpl','','18');
|
||||
$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT_TO'].' '.$this->ecminvoiceout->document_no);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->loadParser();
|
||||
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->SetY($y_tmp);
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
$pdf->Ln(8);
|
||||
|
||||
|
||||
if(isset($this->header_text) && $this->header_text != '') {
|
||||
$pdf->MultiCell(0,4,$this->header_text,0,'J');
|
||||
$pdf->Ln(10);
|
||||
}
|
||||
|
||||
|
||||
if($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl','b','10');
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_BEFORE_CORRECT']);
|
||||
$pdf->Ln(3);
|
||||
$this->ecminvoiceout->DrawPositions($pdf);
|
||||
$pdf->SetFont('arialpl','b','10');
|
||||
$pdf->Ln(4);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_AFTER_CORRECT']);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$pdf->SetFont('arialpl','','7');
|
||||
global $mod_strings;
|
||||
if(!isset($this->position_list) || !is_array($this->position_list))
|
||||
$this->position_list = $this->getPositionList(true);
|
||||
$calc = $this->calculate($this->position_list,true);
|
||||
//$this->position_list = $this->formatPositions($this->position_list);
|
||||
|
||||
$calc['total'] .= ' '.$this->currency_symbol;
|
||||
$calc['subtotal'] .= ' '.$this->currency_symbol;
|
||||
if($calc['discount']) {
|
||||
$calc['total2'] .= ' '.$this->currency_symbol;
|
||||
$calc['discount']['value'] .= ' '.$this->currency_symbol;
|
||||
}
|
||||
|
||||
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
|
||||
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
|
||||
|
||||
$pdf->SetDrawColor(0,0,0);
|
||||
$pdf->SetLineWidth(0.35);
|
||||
|
||||
$name_w = 21;
|
||||
//if($calc['draw_discount']) $name_w -= 8;
|
||||
//if($calc['draw_vat']) $name_w -= 8;
|
||||
$table = array();
|
||||
$table [0]['position'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
$table [0]['description'] = array('width' => $name_w, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
$table [0]['tax_code'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_TAX_CODE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
$table [0]['quantity'] = array('width' => 7, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
$table [0]['unit'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
$table [0]['unit_price'] = array('width' => 11, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
$table [0]['unit_price_total'] = array('width' => 11, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL_PRICE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
//if($calc['draw_discount'])
|
||||
$table [0]['discount'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_DISCOUNT'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
//if($calc['draw_vat']) {
|
||||
$table [0]['vat_id'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_VAT'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
$table [0]['vat_value'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_VAT_VALUE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
//}
|
||||
$table [0]['total'] = array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7, 'background' => array(226,226,226));
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
|
||||
$i = 1;
|
||||
|
||||
$table=array();
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
$table [$i]['position'] = array('width' => 5, 'value' => $i, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$table [$i]['description'] = array('width' => $name_w, 'value' => htmlspecialchars_decode($p['name']), 'border' => 1, 'align' => 'L', 'font-size' => 7 );
|
||||
$table [$i]['tax_code'] = array('width' => 8, 'value' => $p['tax_code'],'border' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$table [$i]['quantity'] = array('width' => 7, 'value' => $p['quantity'], 'border' => 1, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit'] = array('width' => 5, 'value' => $GLOBALS['app_list_strings']['ecmproducts_unit_dom'][$p['unit']], 'border' => 1, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit_price'] = array('width' => 11, 'value' => format_number($p['price']).' PLN', 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
|
||||
$price_total=($p['price']-($p['price']*$p['discount']/100))*$p['quantity'];
|
||||
$table [$i]['unit_price_total'] = array('width' => 11, 'value' => format_number($price_total).' PLN', 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
//if($calc['draw_discount'])
|
||||
$table [$i]['discount'] = array('width' => 5, 'value' => $p['discount'], 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
//if($calc['draw_vat']){
|
||||
$table [$i]['vat_id'] = array('width' => 5, 'value' => format_number($p['vat_value']), 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$vat_value=$p['vat_value']/100*$p['price']*$p['quantity'];
|
||||
$table [$i]['vat_value'] = array('width' => 10, 'value' => format_number($vat_value).' PLN', 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
|
||||
//}
|
||||
$table [$i]['total'] = array('width' => 12, 'value' => format_number($price_total+$vat_value).' PLN', 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$totals[$p['vat_id']]['price']+=$price_total;
|
||||
$totals[$p['vat_id']]['total']+=$price_total+$vat_value;
|
||||
$totals[$p['vat_id']]['vat']+=$vat_value;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$pdf->DrawTable($table,array(0));
|
||||
//total, vat, subtotal
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
|
||||
//$pdf->SetX($pdf->fw-$pdf->rMargin-$pr*34);
|
||||
$table = array();
|
||||
|
||||
if($calc['vats']) {
|
||||
/*$table [] = array(
|
||||
'subtotal1' => array('width' => 42, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7),
|
||||
'subtotal2' => array('width' => 14, 'value' => $calc['subtotal'].' PLN', 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7), );
|
||||
*/
|
||||
foreach($calc['vats'] as $key => $value){
|
||||
$r=mysql_fetch_array(mysql_query("select id,name,value from ecmvats where id='".$key."'"));
|
||||
$vvn=$r['name'];
|
||||
$table [] = array(
|
||||
'vat1' => array('width' => 10, 'value' => $mod_strings['LBL_PDF_VAT'].' ('.$vvn.')', 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7),
|
||||
'netto_total' => array('width' => 12, 'value' => format_number($totals[$r['id']]['price']).' PLN', 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat_rate' => array('width' => 5, 'value' => format_number($r['value']), 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat_total' => array('width' => 13, 'value' => format_number($totals[$r['id']]['vat']).' PLN', 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat2' => array('width' => 14, 'value' => format_number($totals[$r['id']]['total']).' PLN', 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7), );
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($calc['discount'])) {
|
||||
$table [] = array(
|
||||
'total21' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total22' => array('width' => 34, 'value' => $calc['total2'].' PLN', 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7), );
|
||||
$table [] = array(
|
||||
'discount1' => array('width' => 86, 'value' => $mod_strings['LBL_PDF_DISCOUNT'].' '.$calc['discount']['procent'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'discount2' => array('width' => 14, 'value' => $calc['discount']['value'].' PLN', 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7), );
|
||||
}
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 40, 'value' => $mod_strings['LBL_PDF_END_TOTAL'], 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b', 'background' => array(226,226,226)),
|
||||
'total2' => array('width' => 14, 'value' => $calc['total'].' PLN', 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7, 'font-style' => 'b', 'background' => array(226,226,226)),);
|
||||
$pdf->SetX(103);
|
||||
$pdf->DrawTable($table);
|
||||
$pdf->Ln(1);
|
||||
|
||||
//$table=array();
|
||||
|
||||
//$pdf->DrawTable($table);
|
||||
@@ -0,0 +1,31 @@
|
||||
<?
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetY($this->fh-15);
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->SetFillColor(255,255,255);
|
||||
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Cell(0, 10, $this->PageNo().'/{nb}');
|
||||
|
||||
$this->Ln(5);
|
||||
$this->AliasNbPages();
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->getBreakLine(),$this->fw-$this->rMargin,$this->fh-$this->bMargin+1);
|
||||
|
||||
|
||||
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
|
||||
// $this->bMargin = 3;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin);
|
||||
return;
|
||||
} else {
|
||||
// $this->bMargin = 19;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin+$this->tMarign+5);
|
||||
}
|
||||
|
||||
$this->SetFont('arialpl','','8');
|
||||
$this->SetXY($this->lMargin+10,$this->fh-$this->bMargin+3);
|
||||
$this->MultiCell($this->fw-$this->lMargin-$this->rMargin-20,4,$this->edt->footer_text,0,'C');
|
||||
?>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//logo
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
|
||||
if(file_exists($this->edt->logo_path))
|
||||
$this->Image($this->edt->logo_path,$this->rMargin+132,$this->tMargin,0,18.3);
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->lMargin,$this->tMargin+3);
|
||||
$this->MultiCell(100,3.15,$this->edt->header_text,0,'L');
|
||||
|
||||
$this->SetY(32);
|
||||
?>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?
|
||||
|
||||
|
||||
//payment conditions
|
||||
if(!empty($this->ecmpaymentcondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmpaymentcondition_text,0,'L');
|
||||
}
|
||||
|
||||
|
||||
if($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl','b','12');
|
||||
$pdf->Ln(3);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE']." ".format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))).' '.$this->currency_symbol);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
|
||||
//footer text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,237 @@
|
||||
<?
|
||||
/*
|
||||
$pdf->Ln(10);
|
||||
|
||||
//$this->SetY($this->tMargin);
|
||||
|
||||
//from address
|
||||
|
||||
$this->template->setAccount();
|
||||
|
||||
$address = $this->template->account->name;
|
||||
|
||||
if($this->template->account->billing_address_street) $address .= " - ".$this->template->account->billing_address_street;
|
||||
|
||||
if($this->template->account->billing_address_postalcode) $address .= " - ".$this->template->account->billing_address_postalcode;
|
||||
|
||||
if($this->template->account->billing_address_city) $address .= " ".$this->template->account->billing_address_city;
|
||||
|
||||
$pdf->SetFont('arialpl', 'u', 8);
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->MultiCell(0,5,$address,0,'L');
|
||||
*/
|
||||
|
||||
|
||||
$pdf->Ln(2);
|
||||
|
||||
|
||||
//to address
|
||||
|
||||
$address = $this->parent_name;
|
||||
if($this->parent_contact_name) {
|
||||
$address .= "\n".$this->parent_contact_name;
|
||||
if($this->parent_contact_title) $address .= "\n".$this->parent_contact_title;
|
||||
}
|
||||
|
||||
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
|
||||
|
||||
if($this->parent_address_postalcode) $address .= "\n\n".$this->parent_address_postalcode;
|
||||
|
||||
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
|
||||
|
||||
if($this->to_vatid) $address .= "\n\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
|
||||
|
||||
$pdf->SetFont('arialpl', '', 10);
|
||||
|
||||
$pdf->Ln(2);
|
||||
$current = $pdf->GetY();
|
||||
$pdf->MultiCell(0,4,$address,0,'L');
|
||||
$current2 = $pdf->GetY();
|
||||
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-30,$current);
|
||||
$table = array();
|
||||
$table [0]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [1]['data'] = array('width' => 30, 'value' => $this->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [2]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [3]['data'] = array('width' => 30, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [4]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [5]['data'] = array('width' => 30, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
$pdf->SetY($current2);
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','24');
|
||||
|
||||
if($this->type == "normal")
|
||||
$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME'],0,'L');
|
||||
else if($this->type == "correct") {
|
||||
$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT'],0,'L');
|
||||
$this->loadEcmInvoiceOut();
|
||||
$this->ecminvoiceout->format_all_fields();
|
||||
$pdf->Ln(5);
|
||||
$pdf->SetFont('arialpl','','18');
|
||||
$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT_TO'].' '.$this->ecminvoiceout->document_no);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->loadParser();
|
||||
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->header_text,0,'J');
|
||||
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
if($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl','b','10');
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_BEFORE_CORRECT']);
|
||||
$pdf->Ln(3);
|
||||
$this->ecminvoiceout->DrawPositions($pdf);
|
||||
$pdf->SetFont('arialpl','b','10');
|
||||
$pdf->Ln(4);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_AFTER_CORRECT']);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$pdf->SetFont('arialpl','','7');
|
||||
global $mod_strings;
|
||||
|
||||
|
||||
$currency = new Currency();
|
||||
$currency->retrieve($this->currency_id);
|
||||
$this->currency_symbol=$currency->iso4217;
|
||||
|
||||
if(!isset($this->position_list) || !is_array($this->position_list))
|
||||
$this->position_list = $this->getPositionList(true);
|
||||
$calc = $this->calculate($this->position_list,true);
|
||||
//$this->position_list = $this->formatPositions($this->position_list);
|
||||
|
||||
$calc['total'] .= ' '.$this->currency_symbol;
|
||||
$calc['subtotal'] .= ' '.$this->currency_symbol;
|
||||
if($calc['discount']) {
|
||||
$calc['total2'] .= ' '.$this->currency_symbol;
|
||||
$calc['discount']['value'] .= ' '.$this->currency_symbol;
|
||||
}
|
||||
|
||||
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
|
||||
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
|
||||
|
||||
$name_w = 17;
|
||||
//if($calc['draw_discount']) $name_w -= 8;
|
||||
//if($calc['draw_vat']) $name_w -= 8;
|
||||
$table = array();
|
||||
$table [0]['position'] = array('width' => 4, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 8);
|
||||
$table [0]['description'] = array('width' => $name_w, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['tax_code'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_TAX_CODE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['quantity'] = array('width' => 7, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['unit'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 8);
|
||||
$table [0]['unit_price'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['unit_price_total'] = array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL_PRICE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//if($calc['draw_discount'])
|
||||
$table [0]['discount'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_DISCOUNT'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//if($calc['draw_vat']) {
|
||||
$table [0]['vat_id'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_VAT'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['vat_value'] = array('width' => 13, 'value' => $mod_strings['LBL_PDF_LIST_VAT_VALUE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//}
|
||||
$table [0]['total'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
|
||||
$i = 1;
|
||||
$lv=return_app_list_strings_language($this->ecmlanguage);
|
||||
|
||||
$table=array();
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
$table [$i]['position'] = array('width' => 4, 'value' => $i, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$table [$i]['description'] = array('width' => $name_w, 'value' => htmlspecialchars_decode($p['name']), 'border' => 1, 'align' => 'L', 'font-size' => 7 );
|
||||
$table [$i]['tax_code'] = array('width' => 8, 'value' => $p['tax_code'],'border' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$table [$i]['quantity'] = array('width' => 7, 'value' => $p['quantity'], 'border' => 1, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit'] = array('width' => 5, 'value' => $lv['ecmproducts_unit_dom'][$p['unit_id']], 'border' => 1, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit_price'] = array('width' => 10, 'value' => format_number($p['price']).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$price_total=($p['price']-($p['price']*$p['discount']/100))*$p['quantity'];
|
||||
$table [$i]['unit_price_total'] = array('width' => 12, 'value' => format_number($price_total).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
//if($calc['draw_discount'])
|
||||
$table [$i]['discount'] = array('width' => 5, 'value' => $p['discount'], 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
//if($calc['draw_vat']){
|
||||
$table [$i]['vat_id'] = array('width' => 5, 'value' => format_number($p['vat_value']), 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$vat_value=$p['vat_value']/100*$p['price']*$p['quantity'];
|
||||
$table [$i]['vat_value'] = array('width' => 13, 'value' => format_number($vat_value).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
|
||||
//}
|
||||
$table [$i]['total'] = array('width' => 14, 'value' => format_number($price_total+$vat_value).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$totals[$p['vat_id']]['price']+=$price_total;
|
||||
$totals[$p['vat_id']]['total']+=$price_total+$vat_value;
|
||||
$totals[$p['vat_id']]['vat']+=$vat_value;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$pdf->DrawTable($table,array(0));
|
||||
//total, vat, subtotal
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
|
||||
//$pdf->SetX($pdf->fw-$pdf->rMargin-$pr*34);
|
||||
$table = array();
|
||||
|
||||
if($calc['vats']) {
|
||||
/*$table [] = array(
|
||||
'subtotal1' => array('width' => 42, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7),
|
||||
'subtotal2' => array('width' => 14, 'value' => $calc['subtotal'].' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7), );
|
||||
*/
|
||||
foreach($calc['vats'] as $key => $value){
|
||||
$r=mysql_fetch_array(mysql_query("select id,name,value from ecmvats where id='".$key."'"));
|
||||
$vvn=$r['name'];
|
||||
$table [] = array(
|
||||
'vat1' => array('width' => 10, 'value' => $mod_strings['LBL_PDF_VAT'].' ('.$vvn.')', 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7),
|
||||
'netto_total' => array('width' => 12, 'value' => format_number($totals[$r['id']]['price']).' '.$this->currency_symbol, 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat_rate' => array('width' => 5, 'value' => format_number($r['value']), 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat_total' => array('width' => 13, 'value' => format_number($totals[$r['id']]['vat']).' '.$this->currency_symbol, 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat2' => array('width' => 14, 'value' => format_number($totals[$r['id']]['total']).' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7), );
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($calc['discount'])) {
|
||||
$table [] = array(
|
||||
'total21' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total22' => array('width' => 34, 'value' => $calc['total2'].' '.$this->currency_symbol, 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7), );
|
||||
$table [] = array(
|
||||
'discount1' => array('width' => 86, 'value' => $mod_strings['LBL_PDF_DISCOUNT'].' '.$calc['discount']['procent'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'discount2' => array('width' => 14, 'value' => $calc['discount']['value'].' '.$this->currency_symbol, 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7), );
|
||||
}
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 40, 'value' => $mod_strings['LBL_PDF_END_TOTAL'], 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total2' => array('width' => 14, 'value' => $calc['total'], 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7, 'font-style' => 'b'), );
|
||||
$pdf->SetX(103);
|
||||
$pdf->DrawTable($table);
|
||||
$pdf->Ln(1);
|
||||
|
||||
//$table=array();
|
||||
|
||||
//$pdf->DrawTable($table);
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetY($this->fh-15);
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->SetFillColor(255,255,255);
|
||||
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Cell(0, 10, $this->PageNo().'/{nb}');
|
||||
|
||||
$this->Ln(5);
|
||||
$this->AliasNbPages();
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->getBreakLine(),$this->fw-$this->rMargin,$this->fh-$this->bMargin+1);
|
||||
|
||||
|
||||
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
|
||||
// $this->bMargin = 3;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin);
|
||||
return;
|
||||
} else {
|
||||
// $this->bMargin = 19;
|
||||
// $this->SetAutoPageBreak(true,$this->bMargin+$this->tMarign+5);
|
||||
}
|
||||
|
||||
$this->SetFont('arialpl','','8');
|
||||
$this->SetXY($this->lMargin+10,$this->fh-$this->bMargin+3);
|
||||
$this->MultiCell($this->fw-$this->lMargin-$this->rMargin-20,4,$this->edt->footer_text,0,'C');
|
||||
?>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->fw-100-$this->rMargin,$this->tMargin);
|
||||
$this->MultiCell(100,3.15,$this->edt->header_text,0,'R');
|
||||
//logo
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
|
||||
if(file_exists($this->edt->logo_path))
|
||||
$this->Image($this->edt->logo_path,$this->lMargin,$this->tMargin,0,22.3);
|
||||
|
||||
/*
|
||||
//line
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->tMargin-1,$this->fw-$this->rMargin,$this->tMargin-1);
|
||||
*/
|
||||
//if($this->GetY() < $this->tMargin) $this->SetY($this->tMargin); else
|
||||
|
||||
$this->Ln(6);
|
||||
if($this->page == 1)
|
||||
if($this->edt->address) {
|
||||
$this->Ln(9);
|
||||
$this->SetFont('arialpl', 'u', 8);
|
||||
$this->SetX($this->lMargin);
|
||||
$this->MultiCell(0,3.15,$this->edt->address,0,'L');
|
||||
$this->Ln(5);
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?
|
||||
|
||||
|
||||
//payment conditions
|
||||
if(!empty($this->ecmpaymentcondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmpaymentcondition_text,0,'L');
|
||||
}
|
||||
|
||||
|
||||
if($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl','b','12');
|
||||
$pdf->Ln(3);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_CORRECT_DIFFERENCE']." ".format_number(abs(unformat_number($this->total) + unformat_number($this->ecminvoiceout->total))).' '.$this->currency_symbol);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
|
||||
//footer text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,236 @@
|
||||
<?
|
||||
/*
|
||||
$pdf->Ln(10);
|
||||
|
||||
//$this->SetY($this->tMargin);
|
||||
|
||||
//from address
|
||||
|
||||
$this->template->setAccount();
|
||||
|
||||
$address = $this->template->account->name;
|
||||
|
||||
if($this->template->account->billing_address_street) $address .= " - ".$this->template->account->billing_address_street;
|
||||
|
||||
if($this->template->account->billing_address_postalcode) $address .= " - ".$this->template->account->billing_address_postalcode;
|
||||
|
||||
if($this->template->account->billing_address_city) $address .= " ".$this->template->account->billing_address_city;
|
||||
|
||||
$pdf->SetFont('arialpl', 'u', 8);
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->MultiCell(0,5,$address,0,'L');
|
||||
*/
|
||||
|
||||
|
||||
$pdf->Ln(2);
|
||||
|
||||
|
||||
//to address
|
||||
|
||||
$address = $this->parent_name;
|
||||
if($this->parent_contact_name) {
|
||||
$address .= "\n".$this->parent_contact_name;
|
||||
if($this->parent_contact_title) $address .= "\n".$this->parent_contact_title;
|
||||
}
|
||||
|
||||
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
|
||||
|
||||
if($this->parent_address_postalcode) $address .= "\n\n".$this->parent_address_postalcode;
|
||||
|
||||
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
|
||||
|
||||
if($this->to_vatid) $address .= "\n\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
|
||||
|
||||
$pdf->SetFont('arialpl', '', 10);
|
||||
|
||||
$pdf->Ln(2);
|
||||
$current = $pdf->GetY();
|
||||
$pdf->MultiCell(0,4,$address,0,'L');
|
||||
$current2 = $pdf->GetY();
|
||||
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-30,$current);
|
||||
$table = array();
|
||||
$table [0]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [1]['data'] = array('width' => 30, 'value' => $this->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [2]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [3]['data'] = array('width' => 30, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [4]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [5]['data'] = array('width' => 30, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
$pdf->SetY($current2);
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','24');
|
||||
|
||||
if($this->type == "normal")
|
||||
$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME'],0,'L');
|
||||
else if($this->type == "correct") {
|
||||
$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT'],0,'L');
|
||||
$this->loadEcmInvoiceOut();
|
||||
$this->ecminvoiceout->format_all_fields();
|
||||
$pdf->Ln(5);
|
||||
$pdf->SetFont('arialpl','','18');
|
||||
$pdf->MultiCell(0,3,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT_TO'].' '.$this->ecminvoiceout->document_no);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$this->loadParser();
|
||||
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->header_text,0,'J');
|
||||
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
if($this->type == "correct") {
|
||||
$pdf->SetFont('arialpl','b','10');
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_BEFORE_CORRECT']);
|
||||
$pdf->Ln(3);
|
||||
$this->ecminvoiceout->DrawPositions($pdf);
|
||||
$pdf->SetFont('arialpl','b','10');
|
||||
$pdf->Ln(4);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_DOCUMENT_AFTER_CORRECT']);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$pdf->SetFont('arialpl','','7');
|
||||
global $mod_strings;
|
||||
|
||||
|
||||
|
||||
$currency = new Currency();
|
||||
$currency->retrieve($this->currency_id);
|
||||
$this->currency_symbol=$currency->iso4217;
|
||||
|
||||
if(!isset($this->position_list) || !is_array($this->position_list))
|
||||
$this->position_list = $this->getPositionList(true);
|
||||
$calc = $this->calculate($this->position_list,true);
|
||||
//$this->position_list = $this->formatPositions($this->position_list);
|
||||
|
||||
$calc['total'] .= ' '.$this->currency_symbol;
|
||||
$calc['subtotal'] .= ' '.$this->currency_symbol;
|
||||
if($calc['discount']) {
|
||||
$calc['total2'] .= ' '.$this->currency_symbol;
|
||||
$calc['discount']['value'] .= ' '.$this->currency_symbol;
|
||||
}
|
||||
|
||||
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
|
||||
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
|
||||
|
||||
$name_w = 17;
|
||||
//if($calc['draw_discount']) $name_w -= 8;
|
||||
//if($calc['draw_vat']) $name_w -= 8;
|
||||
$table = array();
|
||||
$table [0]['position'] = array('width' => 4, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 8);
|
||||
$table [0]['description'] = array('width' => $name_w, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['tax_code'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_TAX_CODE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['quantity'] = array('width' => 7, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['unit'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 8);
|
||||
$table [0]['unit_price'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['unit_price_total'] = array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL_PRICE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//if($calc['draw_discount'])
|
||||
$table [0]['discount'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_DISCOUNT'], 'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//if($calc['draw_vat']) {
|
||||
$table [0]['vat_id'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_VAT'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$table [0]['vat_value'] = array('width' => 13, 'value' => $mod_strings['LBL_PDF_LIST_VAT_VALUE'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
//}
|
||||
$table [0]['total'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL'],'border' => 1, 'overflow' => 1, 'align' => 'C', 'font-style' => 'b', 'font-size' => 7);
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
|
||||
$i = 1;
|
||||
$lv=return_app_list_strings_language($this->ecmlanguage);
|
||||
|
||||
$table=array();
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
$table [$i]['position'] = array('width' => 4, 'value' => $i, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$table [$i]['description'] = array('width' => $name_w, 'value' => htmlspecialchars_decode($p['name']), 'border' => 1, 'align' => 'L', 'font-size' => 7 );
|
||||
$table [$i]['tax_code'] = array('width' => 8, 'value' => $p['tax_code'],'border' => 1, 'align' => 'C', 'font-size' => 7);
|
||||
$table [$i]['quantity'] = array('width' => 7, 'value' => $p['quantity'], 'border' => 1, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit'] = array('width' => 5, 'value' => $lv['ecmproducts_unit_dom'][$p['unit_id']], 'border' => 1, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit_price'] = array('width' => 10, 'value' => format_number($p['price']).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$price_total=($p['price']-($p['price']*$p['discount']/100))*$p['quantity'];
|
||||
$table [$i]['unit_price_total'] = array('width' => 12, 'value' => format_number($price_total).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
//if($calc['draw_discount'])
|
||||
$table [$i]['discount'] = array('width' => 5, 'value' => $p['discount'], 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
//if($calc['draw_vat']){
|
||||
$table [$i]['vat_id'] = array('width' => 5, 'value' => format_number($p['vat_value']), 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$vat_value=$p['vat_value']/100*$p['price']*$p['quantity'];
|
||||
$table [$i]['vat_value'] = array('width' => 13, 'value' => format_number($vat_value).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
|
||||
//}
|
||||
$table [$i]['total'] = array('width' => 14, 'value' => format_number($price_total+$vat_value).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', 'font-size' => 7 );
|
||||
$totals[$p['vat_id']]['price']+=$price_total;
|
||||
$totals[$p['vat_id']]['total']+=$price_total+$vat_value;
|
||||
$totals[$p['vat_id']]['vat']+=$vat_value;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$pdf->DrawTable($table,array(0));
|
||||
//total, vat, subtotal
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
|
||||
//$pdf->SetX($pdf->fw-$pdf->rMargin-$pr*34);
|
||||
$table = array();
|
||||
|
||||
if($calc['vats']) {
|
||||
/*$table [] = array(
|
||||
'subtotal1' => array('width' => 42, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7),
|
||||
'subtotal2' => array('width' => 14, 'value' => $calc['subtotal'].' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7), );
|
||||
*/
|
||||
foreach($calc['vats'] as $key => $value){
|
||||
$r=mysql_fetch_array(mysql_query("select id,name,value from ecmvats where id='".$key."'"));
|
||||
$vvn=$r['name'];
|
||||
$table [] = array(
|
||||
'vat1' => array('width' => 10, 'value' => $mod_strings['LBL_PDF_VAT'].' ('.$vvn.')', 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7),
|
||||
'netto_total' => array('width' => 12, 'value' => format_number($totals[$r['id']]['price']).' '.$this->currency_symbol, 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat_rate' => array('width' => 5, 'value' => format_number($r['value']), 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat_total' => array('width' => 13, 'value' => format_number($totals[$r['id']]['vat']).' '.$this->currency_symbol, 'background' => array(255,255,255), 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7),
|
||||
'vat2' => array('width' => 14, 'value' => format_number($totals[$r['id']]['total']).' '.$this->currency_symbol, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 7), );
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($calc['discount'])) {
|
||||
$table [] = array(
|
||||
'total21' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total22' => array('width' => 34, 'value' => $calc['total2'].' '.$this->currency_symbol, 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7), );
|
||||
$table [] = array(
|
||||
'discount1' => array('width' => 86, 'value' => $mod_strings['LBL_PDF_DISCOUNT'].' '.$calc['discount']['procent'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'discount2' => array('width' => 14, 'value' => $calc['discount']['value'].' '.$this->currency_symbol, 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7), );
|
||||
}
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 40, 'value' => $mod_strings['LBL_PDF_END_TOTAL'], 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 7, 'font-style' => 'b'),
|
||||
'total2' => array('width' => 14, 'value' => $calc['total'], 'border' => 1, 'overflow' => 1, 'align' => 'R' , 'font-size' => 7, 'font-style' => 'b'), );
|
||||
$pdf->SetX(103);
|
||||
$pdf->DrawTable($table);
|
||||
$pdf->Ln(1);
|
||||
|
||||
//$table=array();
|
||||
|
||||
//$pdf->DrawTable($table);
|
||||
?>
|
||||
401
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/subfooter.php
Executable file
401
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/subfooter.php
Executable file
@@ -0,0 +1,401 @@
|
||||
<?php
|
||||
//return;
|
||||
$pdf->Ln(8);
|
||||
//if($pdf->GetY()>240)$pdf->AddPage();
|
||||
|
||||
$total = 0;
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
include_once("modules/EcmSales/EcmSale.php");
|
||||
|
||||
$sale = new EcmSale();
|
||||
$sale->retrieve($this->ecmsale_id);
|
||||
if (strlen($this->currency_id) > 10) {
|
||||
$rc = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iso4217 from currencies where id='" . $this->currency_id . "'"));
|
||||
$this->currency_id = $rc['iso4217'];
|
||||
}
|
||||
$w = $GLOBALS['db']->query("select inv_value,currency_value from ecmprepaymentinvoices where ecmsale_id='" . $this->ecmsale_id . "' and date_entered<'" . $this->date_entered . "'");
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
if (!$r['currency_value']) {
|
||||
$r['currency_value'] = 1;
|
||||
}
|
||||
|
||||
$total+=$r['inv_value'] * $r['currency_value'];
|
||||
}
|
||||
|
||||
$total = format_number($sale->getTotal() - $total);
|
||||
|
||||
$pdf->Cell(30, 4, "Do zapłaty:", 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($this->inv_value)." ".$this->currency_id, 0, 0, 'L', 1);
|
||||
|
||||
$pdf->writeHTML('</b>');
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->Cell(30, 4, "Zapłacono:", 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($this->inv_value). " " . $this->currency_id, 0, 0, 'L', 1);
|
||||
|
||||
// echo '<pre>' . var_export($this->toArray(), true);exit;
|
||||
// echo '<pre>' . var_export($app_list_strings['payment_method_dom'], true);exit;
|
||||
|
||||
if($this->ecmpaymentcondition_name) {
|
||||
$pdf->SetX(70);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml($this->ecmpaymentcondition_name);
|
||||
}
|
||||
// $pdf->Ln(4);
|
||||
// $pdf->SetFont('arialpl', '', '8');
|
||||
// $pdf->Cell(30, 4, "Słownie:", 0, 0, 'L', 1);
|
||||
// $pdf->SetFont('arialpl', 'B', '8');
|
||||
|
||||
// include_once("modules/EcmInvoiceOuts/EcmInvoiceOut.php");
|
||||
|
||||
// $sl = EcmInvoiceOut::slowniePL(format_number($this->inv_value));
|
||||
// $pdf->Cell(150, 4, $sl . " ".$this->currency_id, 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
// $inv_type = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT invoice_type FROM accounts WHERE id='".$this->parent_id."'"));
|
||||
|
||||
if ($this->currency_symbol != 'PLN') {
|
||||
// $r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT conversion_rate FROM currencies WHERE id='6336d9a0-ee5f-52e3-7d0c-4e6f1472b2bf'"));
|
||||
// $this->currency_value = $r['conversion_rate'];
|
||||
|
||||
$pdf->Cell(85, 1, "Kurs 1 EUR = " . format_number($this->currency_value_nbp, 4, 4) . ' PLN', 0, 0, 'L', 1);
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(85, 1, "Wartość VAT = " . format_number(($this->inv_value - ($this->inv_value / (1 + $this->ecmvat_value / 100))) * $this->currency_value_nbp) . ' PLN', 0, 0, 'L', 1);
|
||||
}
|
||||
/*
|
||||
*/
|
||||
|
||||
//get products
|
||||
$pdf->SetFont('arialpl', '', '7');
|
||||
$pdf->Ln(10);
|
||||
//$pdf->Cell(85,1,"Dane dotyczące zamówienia, lub umowy",0,0,'L',1);
|
||||
$pdf->Cell(85, 1, "Dane dotyczące zamówienia, lub umowy", 0, 0, 'L', 1);
|
||||
$pdf->Ln(5);
|
||||
|
||||
$inv_prod = explode("|", $this->products_on_pdf);
|
||||
|
||||
$query = "SELECT * FROM `ecmsaleitems` WHERE id IN ('" . implode("','", $inv_prod) . "') order by position asc";
|
||||
|
||||
//echo '<pre>' . var_export($this->products_on_pdf, true) . '</pre>';
|
||||
//exit;
|
||||
|
||||
$prod = $GLOBALS['db']->query($query);
|
||||
|
||||
$table = array();
|
||||
|
||||
$table[0]['position'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['position'],
|
||||
'value' => "Lp.",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['description'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['description'],
|
||||
'value' => "Nazwa",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['quantity'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['quantity'],
|
||||
'value' => "Ilość" . PHP_EOL . 'J.m.',
|
||||
'border' => 1,
|
||||
'overflow' => 1,
|
||||
'font-style' => 'b',
|
||||
'align' => 'L',
|
||||
|
||||
);
|
||||
|
||||
/*
|
||||
$table[0]['unit'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['unit'],
|
||||
'value' => "J.M.",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
*/
|
||||
|
||||
$table[0]['unit_price'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['unit_price'],
|
||||
'value' => "Cena Netto" . PHP_EOL . 'Waluta',
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['unit_price_total'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['unit_price_total'],
|
||||
'value' => "Wartość Netto",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['vat_id'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['vat_id'],
|
||||
'value' => "VAT (%)",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['vat_value'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['vat_value'],
|
||||
'value' => "Wartość Vat",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
$table[0]['total'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['total'],
|
||||
'value' => "Wartośc Brutto",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$i = 1;
|
||||
|
||||
$total = 0;
|
||||
|
||||
while ($p = $GLOBALS['db']->fetchByAssoc($prod)) {
|
||||
|
||||
// echo '<pre>'. var_export($p, true); exit;
|
||||
|
||||
$table[$i]['position'] = array(
|
||||
'width' => $widths['position'],
|
||||
'value' => $i,
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[$i]['description'] = array(
|
||||
'width' => $widths['description'],
|
||||
'value' => $p['name'],
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[$i]['quantity'] = array(
|
||||
'width' => $widths['quantity'],
|
||||
'value' => format_number($p['quantity'], 2) . PHP_EOL . $p['dd_unit_name'],
|
||||
'border' => 1,
|
||||
'overflow' => 1,
|
||||
'font-style' => '',
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
/*
|
||||
$table[$i]['unit'] = array(
|
||||
'width' => $widths['unit'],
|
||||
'value' => $p['dd_unit_name'],
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
*/
|
||||
|
||||
$price = ($p['discount'] ? ($p['price']) * (1 - $p['discount'] / 100) : ($p['price']));
|
||||
$price_total = $price * $p['quantity'];
|
||||
|
||||
$table[$i]['unit_price'] = array(
|
||||
'width' => $widths['unit_price'],
|
||||
// 'value' => format_number($p['price'], 2) . PHP_EOL . $p['currency_name'],
|
||||
'value' => format_number($price, 2) . PHP_EOL . $p['currency_name'],
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[$i]['unit_price_total'] = array(
|
||||
'width' => $widths['unit_price_total'],
|
||||
'value' => format_number($price_total, 2),
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[$i]['vat_id'] = array(
|
||||
'width' => $widths['vat_id'],
|
||||
'value' => $p['ecmvat_value'].'%',
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'C',
|
||||
);
|
||||
|
||||
$vat_value = round($price_total * ($p['ecmvat_value'] / 100), 2);
|
||||
|
||||
$table[$i]['vat_value'] = array(
|
||||
'width' => $widths['vat_value'],
|
||||
'value' => format_number($vat_value, 2),
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[$i]['total'] = array(
|
||||
'width' => $widths['total'],
|
||||
'value' => format_number($price_total + $vat_value, 2),
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$total += $p['quantity'] * ($p['price'] + ($p['price'] * ($p['ecmvat_value']/100)));
|
||||
$i++;
|
||||
}
|
||||
|
||||
$pdf->DrawTable($table, array(0));
|
||||
|
||||
$pdf->Ln(0.1);
|
||||
$table = array();
|
||||
|
||||
$table[0]['position'] = array(
|
||||
'width' => $widths['position'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['description'] = array(
|
||||
'width' => $widths['description'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['quantity'] = array(
|
||||
'width' => $widths['quantity'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'font-style' => '',
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['unit'] = array(
|
||||
'width' => $widths['unit'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['unit_price'] = array(
|
||||
'width' => $widths['unit_price'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['unit_price_total'] = array(
|
||||
'width' => $widths['unit_price_total'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['vat_id'] = array(
|
||||
'width' => $widths['vat_id'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['vat_value'] = array(
|
||||
'width' => $widths['vat_value'],
|
||||
'value' => 'Razem',
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[0]['total'] = array(
|
||||
'width' => $widths['total'],
|
||||
'value' => format_number($total, 2),
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
// $pdf->DrawTable($table, array(0));
|
||||
|
||||
$pdf->Ln(20);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '7');
|
||||
|
||||
$pdf->Cell(95, 1, "...............................................................", 0, 0, 'L', 1);
|
||||
$pdf->Cell(95, 1, "...............................................................", 0, 0, 'R', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->Cell(43, 1, "Podpis wystawiajacego", 0, 0, 'C', 1);
|
||||
|
||||
$pdf->SetX(162);
|
||||
$pdf->Cell(35, 1, "Podpis odbiorcy", 0, 0, 'C', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(43, 1, $this->setUser()->full_name, 0, 0, 'C', 1);
|
||||
|
||||
//footer text
|
||||
$pdf->Ln(18);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->MultiCell(0, 4, $this->footer_text, 0, 'J');
|
||||
|
||||
//header text
|
||||
$pdf->Ln(6);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->MultiCell(0, 4, $this->ads_text, 0, 'J');
|
||||
394
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/subfooter_.php
Executable file
394
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/subfooter_.php
Executable file
@@ -0,0 +1,394 @@
|
||||
<?php
|
||||
//return;
|
||||
$pdf->Ln(8);
|
||||
//if($pdf->GetY()>240)$pdf->AddPage();
|
||||
|
||||
$total = 0;
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
|
||||
include_once("modules/EcmSales/EcmSale.php");
|
||||
|
||||
$sale = new EcmSale();
|
||||
$sale->retrieve($this->ecmsale_id);
|
||||
if (strlen($this->currency_id) > 10) {
|
||||
$rc = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iso4217 from currencies where id='" . $this->currency_id . "'"));
|
||||
$this->currency_id = $rc['iso4217'];
|
||||
}
|
||||
$w = $GLOBALS['db']->query("select inv_value,currency_value from ecmprepaymentinvoices where ecmsale_id='" . $this->ecmsale_id . "' and date_entered<'" . $this->date_entered . "'");
|
||||
|
||||
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
|
||||
if (!$r['currency_value']) {
|
||||
$r['currency_value'] = 1;
|
||||
}
|
||||
|
||||
$total+=$r['inv_value'] * $r['currency_value'];
|
||||
}
|
||||
|
||||
$total = format_number($sale->getTotal() - $total);
|
||||
|
||||
$pdf->Cell(30, 4, "Do zapłaty:", 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($this->inv_value)." ".$this->currency_id, 0, 0, 'L', 1);
|
||||
|
||||
$pdf->writeHTML('</b>');
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->Cell(30, 4, "Zapłacono:", 0, 0, 'L', 1);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->Cell(30, 4, format_number($this->inv_value)." ".$this->currency_id, 0, 0, 'L', 1);
|
||||
|
||||
// echo '<pre>' . var_export($this->toArray(), true);exit;
|
||||
// echo '<pre>' . var_export($app_list_strings['payment_method_dom'], true);exit;
|
||||
|
||||
if($this->ecmpaymentcondition_name) {
|
||||
$pdf->SetX(70);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->WriteHtml($this->ecmpaymentcondition_name);
|
||||
}
|
||||
// $pdf->Ln(4);
|
||||
// $pdf->SetFont('arialpl', '', '8');
|
||||
// $pdf->Cell(30, 4, "Słownie:", 0, 0, 'L', 1);
|
||||
// $pdf->SetFont('arialpl', 'B', '8');
|
||||
|
||||
// include_once("modules/EcmInvoiceOuts/EcmInvoiceOut.php");
|
||||
|
||||
// $sl = EcmInvoiceOut::slowniePL(format_number($this->inv_value));
|
||||
// $pdf->Cell(150, 4, $sl . " ".$this->currency_id, 0, 0, 'L', 1);
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
// $inv_type = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT invoice_type FROM accounts WHERE id='".$this->parent_id."'"));
|
||||
|
||||
if ($this->currency_symbol != 'PLN') {
|
||||
// $r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT conversion_rate FROM currencies WHERE id='6336d9a0-ee5f-52e3-7d0c-4e6f1472b2bf'"));
|
||||
// $this->currency_value = $r['conversion_rate'];
|
||||
|
||||
$pdf->Cell(85, 1, "Kurs 1 EUR = " . format_number($this->currency_value_nbp, 4, 4) . ' PLN', 0, 0, 'L', 1);
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(85, 1, "Wartość VAT = " . format_number(($this->inv_value - ($this->inv_value / (1 + $this->ecmvat_value / 100))) * $this->currency_value_nbp) . ' PLN', 0, 0, 'L', 1);
|
||||
}
|
||||
/*
|
||||
*/
|
||||
|
||||
//get products
|
||||
$pdf->SetFont('arialpl', '', '7');
|
||||
$pdf->Ln(10);
|
||||
//$pdf->Cell(85,1,"Dane dotyczące zamówienia, lub umowy",0,0,'L',1);
|
||||
$pdf->Cell(85, 1, "Dane dotyczące zamówienia, lub umowy", 0, 0, 'L', 1);
|
||||
$pdf->Ln(5);
|
||||
|
||||
$inv_prod = explode("|", $this->products_on_pdf);
|
||||
|
||||
$query = "SELECT * FROM `ecmsaleitems` WHERE id IN ('" . implode("','", $inv_prod) . "') order by position asc";
|
||||
|
||||
//echo '<pre>' . var_export($this->products_on_pdf, true) . '</pre>';
|
||||
//exit;
|
||||
|
||||
$prod = $GLOBALS['db']->query($query);
|
||||
|
||||
$table = array();
|
||||
|
||||
$table[0]['position'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['position'],
|
||||
'value' => "Lp.",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['description'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['description'],
|
||||
'value' => "Nazwa",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['quantity'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['quantity'],
|
||||
'value' => "Ilość" . PHP_EOL . 'J.m.',
|
||||
'border' => 1,
|
||||
'overflow' => 1,
|
||||
'font-style' => 'b',
|
||||
'align' => 'L',
|
||||
|
||||
);
|
||||
|
||||
/*
|
||||
$table[0]['unit'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['unit'],
|
||||
'value' => "J.M.",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
*/
|
||||
|
||||
$table[0]['unit_price'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['unit_price'],
|
||||
'value' => "Cena Netto" . PHP_EOL . 'Waluta',
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['unit_price_total'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['unit_price_total'],
|
||||
'value' => "Wartość Netto",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['vat_id'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['vat_id'],
|
||||
'value' => "VAT (%)",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['vat_value'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['vat_value'],
|
||||
'value' => "Wartość Vat",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
$table[0]['total'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['total'],
|
||||
'value' => "Wartośc Brutto",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$i = 1;
|
||||
|
||||
$total = 0;
|
||||
|
||||
while ($p = $GLOBALS['db']->fetchByAssoc($prod)) {
|
||||
|
||||
//echo '<pre>'. var_export($p, true); exit;
|
||||
|
||||
$table[$i]['position'] = array(
|
||||
'width' => $widths['position'],
|
||||
'value' => $i,
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[$i]['description'] = array(
|
||||
'width' => $widths['description'],
|
||||
'value' => $p['name'],
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[$i]['quantity'] = array(
|
||||
'width' => $widths['quantity'],
|
||||
'value' => format_number($p['quantity'], 2) . PHP_EOL . $p['dd_unit_name'],
|
||||
'border' => 1,
|
||||
'overflow' => 1,
|
||||
'font-style' => '',
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
/*
|
||||
$table[$i]['unit'] = array(
|
||||
'width' => $widths['unit'],
|
||||
'value' => $p['dd_unit_name'],
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
*/
|
||||
|
||||
$table[$i]['unit_price'] = array(
|
||||
'width' => $widths['unit_price'],
|
||||
'value' => format_number($p['price'], 2) . PHP_EOL . $p['currency_name'],
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[$i]['unit_price_total'] = array(
|
||||
'width' => $widths['unit_price_total'],
|
||||
'value' => format_number($p['quantity'] * $p['price'], 2),
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[$i]['vat_id'] = array(
|
||||
'width' => $widths['vat_id'],
|
||||
'value' => $p['ecmvat_name'],
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'C',
|
||||
);
|
||||
|
||||
$table[$i]['vat_value'] = array(
|
||||
'width' => $widths['vat_value'],
|
||||
'value' => format_number($p['price'] * ($p['ecmvat_value']/100), 2),
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[$i]['total'] = array(
|
||||
'width' => $widths['total'],
|
||||
'value' => format_number($p['quantity'] * ($p['price'] + ($p['price'] * ($p['ecmvat_value']/100))), 2),
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$total += $p['quantity'] * ($p['price'] + ($p['price'] * ($p['ecmvat_value']/100)));
|
||||
$i++;
|
||||
}
|
||||
|
||||
$pdf->DrawTable($table, array(0));
|
||||
|
||||
$pdf->Ln(0.1);
|
||||
$table = array();
|
||||
|
||||
$table[0]['position'] = array(
|
||||
'width' => $widths['position'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['description'] = array(
|
||||
'width' => $widths['description'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['quantity'] = array(
|
||||
'width' => $widths['quantity'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'font-style' => '',
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['unit'] = array(
|
||||
'width' => $widths['unit'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['unit_price'] = array(
|
||||
'width' => $widths['unit_price'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['unit_price_total'] = array(
|
||||
'width' => $widths['unit_price_total'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['vat_id'] = array(
|
||||
'width' => $widths['vat_id'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['vat_value'] = array(
|
||||
'width' => $widths['vat_value'],
|
||||
'value' => 'Razem',
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[0]['total'] = array(
|
||||
'width' => $widths['total'],
|
||||
'value' => format_number($total, 2),
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
// $pdf->DrawTable($table, array(0));
|
||||
|
||||
$pdf->Ln(20);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', '7');
|
||||
|
||||
$pdf->Cell(95, 1, "...............................................................", 0, 0, 'L', 1);
|
||||
$pdf->Cell(95, 1, "...............................................................", 0, 0, 'R', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetX(10);
|
||||
$pdf->Cell(43, 1, "Podpis wystawiajacego", 0, 0, 'C', 1);
|
||||
|
||||
$pdf->SetX(162);
|
||||
$pdf->Cell(35, 1, "Podpis odbiorcy", 0, 0, 'C', 1);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->Cell(43, 1, $this->setUser()->full_name, 0, 0, 'C', 1);
|
||||
|
||||
//footer text
|
||||
$pdf->Ln(18);
|
||||
$pdf->SetFont('arialpl', '', '8');
|
||||
$pdf->MultiCell(0, 4, $this->footer_text, 0, 'J');
|
||||
|
||||
//header text
|
||||
$pdf->Ln(6);
|
||||
$pdf->SetFont('arialpl', 'B', '8');
|
||||
$pdf->MultiCell(0, 4, $this->ads_text, 0, 'J');
|
||||
766
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/subheader.php
Executable file
766
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/subheader.php
Executable file
@@ -0,0 +1,766 @@
|
||||
<?php
|
||||
|
||||
global $app_list_strings;
|
||||
|
||||
$address = htmlspecialchars_decode(str_replace("<", "<", str_replace(">", ">", $this->parent_name)));
|
||||
if ($this->parent_contact_name) {
|
||||
$address .= "\n" . $this->parent_contact_name;
|
||||
|
||||
if ($this->parent_contact_title) {
|
||||
$address .= "\n" . $this->parent_contact_title;
|
||||
}
|
||||
|
||||
$personplus = 5;
|
||||
} else {
|
||||
$personplus = 0;
|
||||
}
|
||||
|
||||
if ($this->parent_address_street) {
|
||||
$address .= "\n" . $this->parent_address_street;
|
||||
}
|
||||
|
||||
if ($this->parent_address_postalcode) {
|
||||
$address .= "\n" . $this->parent_address_postalcode;
|
||||
}
|
||||
|
||||
if ($this->parent_address_city) {
|
||||
$address .= " " . $this->parent_address_city;
|
||||
}
|
||||
|
||||
$v = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT to_vatid FROM ecmprepaymentinvoices WHERE id='".$this->id."'"));
|
||||
$this->to_vatid = $v['to_vatid'];
|
||||
//$this->to_vatid="SELECT to_vatid FROM ecmprapaymentinvoices WHERE id='".$this->id."'";
|
||||
|
||||
if($this->to_vatid)
|
||||
$address .= "\nNIP ".$this->to_vatid;
|
||||
|
||||
/*
|
||||
if ($this->to_nip) {
|
||||
$address .= "\nNip: " . $this->to_nip;
|
||||
} elseif (!$this->to_nip && $this->to_vatid) {
|
||||
$address .= "\nNip: " . $this->to_vatid;
|
||||
}
|
||||
*/
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iln,to_nip from accounts where id='" . $this->parent_id . "'"));
|
||||
|
||||
if ($r['iln']) {
|
||||
$address .= "\nILN: " . $r['iln'];
|
||||
}
|
||||
|
||||
//to address
|
||||
$old_x = $pdf->GetX();
|
||||
$old_y = $pdf->GetY();
|
||||
|
||||
$pdf->SetXY(10, 53);
|
||||
|
||||
$db = $GLOBALS['db'];
|
||||
|
||||
//$pdf->header_text = $pdf->template->mfp->parseText($pdf->header_text);
|
||||
//$pdf->MultiCell(60, 4, $pdf->edt->header_text, 0, 'L');
|
||||
|
||||
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35, 1,$mod_strings['LBL_PDF_BUYER'], 0, 0, 'L', 1);
|
||||
$pdf->Ln(3);
|
||||
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$pdf->MultiCell(60, 4, $address, 0, 'L');
|
||||
|
||||
$address = "";
|
||||
$address = str_replace("<", "<", str_replace(">", ">", $r['parent_name']));
|
||||
|
||||
if ($r['parent_address_street']) {
|
||||
$address .= "\n" . $r['parent_address_street'];
|
||||
}
|
||||
|
||||
if ($r['parent_address_postalcode']) {
|
||||
$address .= "\n" . $r['parent_address_postalcode'];
|
||||
}
|
||||
|
||||
if ($r['parent_address_city']) {
|
||||
$address .= " " . $r['parent_address_city'];
|
||||
}
|
||||
|
||||
if ($r['to_nip']) {
|
||||
$address .= "\nNip: " . $r['to_nip'];
|
||||
} elseif (!$r['to_nip'] && $r['to_vatid']) {
|
||||
$address .= "\nNip: " . $r['to_vatid'];
|
||||
}
|
||||
|
||||
$rr = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iln from accounts where id='" . $r['parent_id'] . "'"));
|
||||
|
||||
if ($rr['iln']) {
|
||||
$address .= "\nILN: " . $rr['iln'];
|
||||
}
|
||||
|
||||
$ynew = $pdf->GetY() + 12;
|
||||
|
||||
if ($this->ecmpaymentcondition_id) {
|
||||
require_once("modules/EcmPaymentConditions/EcmPaymentCondition.php");
|
||||
|
||||
$pc = new EcmPaymentCondition();
|
||||
$pc->retrieve($this->ecmpaymentcondition_id);
|
||||
}
|
||||
|
||||
$pdf->SetXY(160, $old_y + 10 + $personplus);
|
||||
|
||||
$table = array();
|
||||
|
||||
$table[0]['date_reg'] = array(
|
||||
'width' => 16,
|
||||
'value' => "Data wystawienia",
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-style' => 'b',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
$table[1]['date_reg_value'] = array(
|
||||
'width' => 36+ 4,
|
||||
'value' => $this->register_date,
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
$table[2]['date_reg1'] = array(
|
||||
'width' => 16,
|
||||
'value' => "Data przedpłaty",
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-style' => 'b',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
$table[3]['date_reg1_value'] = array(
|
||||
'width' => 36+ 4,
|
||||
'value' => $this->register_date,
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
$q = 'select s.`document_no` as `number`, s.`parent_document_no` as `doc_number`, s.`date_entered` as `date` from `ecmprepaymentinvoices` as pi join `ecmsales` as s on s.`id` = pi.`ecmsale_id` where pi.`id` = \'' . $this->id . '\' group by s.`document_no`;';
|
||||
|
||||
$result = $db->query($q);
|
||||
$results = $db->fetchByAssoc($result);
|
||||
|
||||
// echo '<pre>' . var_export($results['doc_number'], true);
|
||||
// echo '<pre>' . var_export(preg_split ('/( )/', $results['doc_number']), true);
|
||||
// exit;
|
||||
|
||||
if($results) {
|
||||
/*
|
||||
$table[3]['date_sell'] = array(
|
||||
'width' => 16,
|
||||
'value' => 'Zamówienie klienta',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
$table[3]['date_sell_value'] = array(
|
||||
// 'width' => 36 + 16 + 4,
|
||||
'width' => 36 + 4,
|
||||
'value' => chunk_split($results['doc_number'], 15),
|
||||
// 'value' => chunk_split('Zamówienie: ' . $results['doc_number'], 35), //chunk_split($results['doc_number'], 15),
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-style' => 'b',
|
||||
'font-size' => 8,
|
||||
'valign' => 'C',
|
||||
);
|
||||
*/
|
||||
|
||||
//echo '<pre>' . var_dump($results['doc_number'], chunk_split($results['doc_number'], 9), true); exit;
|
||||
|
||||
$table[4]['date_sell'] = array(
|
||||
'width' => 16,
|
||||
'value' => 'Nr ZS',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-style' => 'b',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
$table[5]['date_sell_value'] = array(
|
||||
'width' => 36 + 4,
|
||||
'value' => $results['number'],
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-size' => 8,
|
||||
'valign' => 'C',
|
||||
);
|
||||
|
||||
$table[6]['date_sell'] = array(
|
||||
'width' => 16,
|
||||
'value' => 'Data ZS',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-style' => 'b',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
$table[7]['date_sell_value'] = array(
|
||||
'width' => 36 + 4,
|
||||
'value' => date('d.m.Y', strtotime($results['date'])),
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
|
||||
'font-size' => 8,
|
||||
'valign' => 'C',
|
||||
);
|
||||
}
|
||||
|
||||
// if ($this->ecmpaymentcondition_id) {
|
||||
// $table[2]['payment_method'] = array(
|
||||
// 'width' => 20,
|
||||
// 'value' => "Metoda płatności",
|
||||
// 'border' => 0,
|
||||
// 'overflow' => 1,
|
||||
// 'align' => 'L',
|
||||
// 'font-size' => 8,
|
||||
// );
|
||||
|
||||
// $table[2]['payment_method_value'] = array(
|
||||
// 'width' => 25,
|
||||
// 'value' => $app_list_strings['ecmpaymentconditions_payment_method_dom'][$pc->payment_method],
|
||||
// 'border' => 0,
|
||||
// 'overflow' => 1,
|
||||
// 'align' => 'L',
|
||||
// 'font-style' => 'b',
|
||||
// 'font-size' => 8,
|
||||
// );
|
||||
// }
|
||||
|
||||
$pdf->SetXY(170,5);
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
$pdf->Ln(5);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '18');
|
||||
$pdf->SetXY(60, $pdf->tMargin + 25);
|
||||
|
||||
$pdf->MultiCell(80, 7, "Faktura nr " . $this->document_no. PHP_EOL. 'zaliczkowa', 0, 'C');
|
||||
$pdf->SetFont('arialpl', '', 4);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(60);
|
||||
|
||||
$pdf->SetY($ynew);
|
||||
|
||||
$table = array();
|
||||
|
||||
if (!$this->currency_value) {
|
||||
$this->currency_value = 1;
|
||||
}
|
||||
|
||||
$widths = array(
|
||||
'position' => 4,
|
||||
'description' => 30,
|
||||
'quantity' => 8,
|
||||
//'unit' => 7,
|
||||
'unit_price' => 14,
|
||||
'unit_price_total' => 15,
|
||||
'vat_id' => 8,
|
||||
'vat_value' => 14,
|
||||
'total' => 16,
|
||||
//
|
||||
'number' => 20,
|
||||
'date' => 10,
|
||||
'value' => 14 + 8,
|
||||
'fix_right' => 53,
|
||||
//
|
||||
'fix_left' => 56,
|
||||
'rate' => 8,
|
||||
'netto' => 15,
|
||||
'vat' => 14,
|
||||
'brutto' => 16,
|
||||
);
|
||||
|
||||
$table[0]['position'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['position'],
|
||||
'value' => "Lp.",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['description'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['description'],
|
||||
'value' => "Nazwa",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['quantity'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['quantity'],
|
||||
'value' => "Ilość" . PHP_EOL . 'J.m.',
|
||||
'border' => 1,
|
||||
'overflow' => 1,
|
||||
'font-style' => 'b',
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
/*
|
||||
$table[0]['unit'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['unit'],
|
||||
'value' => "J.M.",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
*/
|
||||
|
||||
$table[0]['unit_price'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['unit_price'],
|
||||
'value' => "Cena Netto",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['unit_price_total'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['unit_price_total'],
|
||||
'value' => "Wartość Netto",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['vat_id'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['vat_id'],
|
||||
'value' => "VAT (%)",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['vat_value'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['vat_value'],
|
||||
'value' => "Wartość VAT",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['total'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['total'],
|
||||
'value' => "Wartość Brutto",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
// ~
|
||||
|
||||
$table[1]['position'] = array(
|
||||
'width' => $widths['position'],
|
||||
'value' => "1",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[1]['description'] = array(
|
||||
'width' => $widths['description'],
|
||||
'value' => $this->description,
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[1]['quantity'] = array(
|
||||
'width' => $widths['quantity'],
|
||||
'value' => "1" . PHP_EOL . 'SZT.',
|
||||
'border' => 1,
|
||||
'overflow' => 1,
|
||||
'font-style' => '',
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
/*
|
||||
$table[1]['unit'] = array(
|
||||
'width' => $widths['unit'],
|
||||
'value' => "SZT.",
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
*/
|
||||
|
||||
$c = new Currency();
|
||||
$c->retrieve($this->currency_id);
|
||||
$c->name = $c->iso4217;
|
||||
$table[1]['unit_price'] = array(
|
||||
'width' => $widths['unit_price'],
|
||||
'value' => number_format(($this->inv_value / (1 + $this->ecmvat_value / 100)), 2, ",", ".") . ' ' . $c->name,
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[1]['unit_price_total'] = array(
|
||||
'width' => $widths['unit_price_total'],
|
||||
'value' => number_format(($this->inv_value / (1 + $this->ecmvat_value / 100)), 2, ",", ".") . ' ' . $c->name,
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[1]['vat_id'] = array(
|
||||
'width' => $widths['vat_id'],
|
||||
'value' => $this->ecmvat_name,
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'C',
|
||||
);
|
||||
|
||||
$table[1]['vat_value'] = array(
|
||||
'width' => $widths['vat_value'],
|
||||
'value' => number_format(($this->inv_value - ($this->inv_value / (1 + $this->ecmvat_value / 100))), 2, ",", ".") . " " . $c->name,
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[1]['total'] = array(
|
||||
'width' => $widths['total'],
|
||||
'value' => number_format((double) $this->inv_value, 2, ",", ".") . ' ' . $c->name,
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
// echo '<pre>' . var_export($results, true) . '</pre>';
|
||||
// exit;
|
||||
|
||||
if($docNumber = @$results['doc_number']) {
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$pdf->Cell(85, 1, "Zamówienie klienta: " . $docNumber, 0, 0, 'L', 1);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
|
||||
$pdf->DrawTable($table, array(0));
|
||||
|
||||
$pdf->Ln(0);
|
||||
$pdf->SetFont('arialpl', '', '7');
|
||||
|
||||
global $mod_strings;
|
||||
|
||||
$currency = new Currency();
|
||||
$currency->retrieve($this->currency_id);
|
||||
$this->currency_symbol = $currency->iso4217;
|
||||
|
||||
$lv = return_app_list_strings_language($this->ecmlanguage);
|
||||
|
||||
if ($this->ecmsale_id) {
|
||||
include_once("modules/EcmSales/EcmSale.php");
|
||||
|
||||
$sale = new EcmSale();
|
||||
$sale->retrieve($this->ecmsale_id);
|
||||
$this->position_list = $sale->getPositionList(true);
|
||||
$calc = $sale->calculate($this->position_list, true);
|
||||
}
|
||||
|
||||
$pdf->Ln(8);
|
||||
|
||||
$y = $pdf->GetY();
|
||||
|
||||
$table = array();
|
||||
|
||||
|
||||
$table[0]['fix'] = array(
|
||||
//'background' => array(233, 0, 0),
|
||||
'width' => $widths['fix_left'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
);
|
||||
|
||||
$table[0]['netto'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['netto'],
|
||||
'value' => "Wartość netto",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['rate'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['rate'],
|
||||
'value' => "VAT (%)",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['vat'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['vat'],
|
||||
'value' => "Wartość VAT",
|
||||
'border' => 1,
|
||||
'overflow' => 1,
|
||||
'font-style' => 'b',
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['brutto'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['brutto'],
|
||||
'value' => "Wartość brutto",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
//$pdf->SetXY(10, $y);
|
||||
//$pdf->MultiCell(80, 7, "Rozliczenie zaliczki wg stawek:", 0, 'L');
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->DrawTable($table, array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
if (!$this->currency_value) {
|
||||
$this->currency_value = 1;
|
||||
}
|
||||
|
||||
$table = array();
|
||||
|
||||
$i = 1;
|
||||
|
||||
$table[$i]['fix'] = array(
|
||||
//'background' => array(233, 0, 0),
|
||||
'width' => $widths['fix_left'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
);
|
||||
|
||||
$table[$i]['netto'] = array(
|
||||
'width' => $widths['netto'],
|
||||
'value' => number_format(($this->inv_value / (1 + $this->ecmvat_value / 100)), 2, ",", ".") . ' ' . $c->name,
|
||||
'border' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[$i]['rate'] = array(
|
||||
'width' => $widths['rate'],
|
||||
'value' => $this->ecmvat_name,
|
||||
'border' => 1,
|
||||
'align' => 'C',
|
||||
);
|
||||
|
||||
$table[$i]['vat'] = array(
|
||||
'width' => $widths['vat'],
|
||||
'value' => number_format(($this->inv_value - ($this->inv_value / (1 + $this->ecmvat_value / 100))) , 2, ",", ".") . " " . $c->name,
|
||||
'border' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[$i]['brutto'] = array(
|
||||
'width' => $widths['brutto'],
|
||||
'value' => number_format(($this->inv_value), 2, ",", ".") . " ".$c->name,
|
||||
'border' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
//$table=array();
|
||||
$pdf->SetX(10);
|
||||
$pdf->DrawTable($table);
|
||||
|
||||
|
||||
$rzal = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select date_entered from ecmprepaymentinvoices where id='" . $this->id . "'"));
|
||||
$q = "select document_no,register_date,inv_value,date_entered,currency_value from ecmprepaymentinvoices where deleted='0' and ecmsale_id='" . $this->ecmsale_id . "' and date_entered<'" . $rzal['date_entered'] . "'";
|
||||
$wi = $GLOBALS['db']->query($q);
|
||||
|
||||
if (mysql_num_rows($wi) > 0) {
|
||||
$table = array();
|
||||
|
||||
$table[0]['position'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['position'],
|
||||
'value' => "Lp.",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['number'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['number'],
|
||||
'value' => "Numer faktury",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['date'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['date'],
|
||||
'value' => "Data",
|
||||
'border' => 1,
|
||||
'overflow' => 1,
|
||||
'font-style' => 'b',
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['value'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['value'],
|
||||
'value' => "Wartość brutto",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['fix'] = array(
|
||||
//'background' => array(233, 0, 0),
|
||||
'width' => $widths['fix_right'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->MultiCell(80, 7, "Poprzednie zaliczki:", 0, 'L');
|
||||
$pdf->DrawTable($table, array(0));
|
||||
|
||||
$pdf->Ln(0);
|
||||
|
||||
$table = array();
|
||||
|
||||
$i = 1;
|
||||
|
||||
$lv = return_app_list_strings_language($this->ecmlanguage);
|
||||
|
||||
$rzal = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select date_entered from ecmprepaymentinvoices where id='" . $this->id . "'"));
|
||||
$wi = $GLOBALS['db']->query("select document_no,register_date,inv_value,date_entered,currency_value from ecmprepaymentinvoices where deleted='0' and ecmsale_id='" . $this->ecmsale_id . "' and date_entered<'" . $rzal['date_entered'] . "'");
|
||||
|
||||
while ($ri = $GLOBALS['db']->fetchByAssoc($wi)) {
|
||||
$m++;
|
||||
|
||||
if (!$ri['currency_value']) {
|
||||
$ri['currency_value'] = 1;
|
||||
}
|
||||
|
||||
$sum+=$ri['inv_value'] * $ri['currency_value'];
|
||||
|
||||
$table[$m]['position'] = array(
|
||||
'width' => $widths['position'],
|
||||
'value' => $m,
|
||||
'border' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[$m]['number'] = array(
|
||||
'width' => $widths['number'],
|
||||
'value' => $ri['document_no'],
|
||||
'border' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[$m]['date'] = array(
|
||||
'width' => $widths['date'],
|
||||
'value' => $ri['register_date'],
|
||||
'border' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[$m]['value'] = array(
|
||||
'width' => $widths['value'],
|
||||
'value' => number_format($ri['inv_value'] * $ri['currency_value'], 2, ",", ".") . ' ' . $this->currency_symbol,
|
||||
'border' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[$m]['fix'] = array(
|
||||
//'background' => array(233, 0, 0),
|
||||
'width' => $widths['fix_right'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
);
|
||||
}
|
||||
|
||||
$table[$m + 1]['position'] = array(
|
||||
'width' => $widths['position'],
|
||||
'value' => "",
|
||||
'border' => 0,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[$m + 1]['number'] = array(
|
||||
'width' => $widths['number'],
|
||||
'value' => "",
|
||||
'border' => 0,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[$m + 1]['date'] = array(
|
||||
'width' => $widths['date'],
|
||||
'value' => "Razem",
|
||||
'border' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[$m + 1]['value'] = array(
|
||||
'width' => $widths['value'],
|
||||
'value' => number_format($sum, 2, ",", ".") . ' ' . $this->currency_symbol,
|
||||
'border' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[$m + 1]['fix'] = array(
|
||||
//'background' => array(233, 0, 0),
|
||||
'width' => $widths['fix_right'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
);
|
||||
|
||||
$pdf->DrawTable($table);
|
||||
}
|
||||
790
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/subheader_.php
Executable file
790
modules/EcmDocumentTemplates/templates/EcmPrepaymentInvoices/subheader_.php
Executable file
@@ -0,0 +1,790 @@
|
||||
<?php
|
||||
|
||||
global $app_list_strings;
|
||||
|
||||
$address = htmlspecialchars_decode(str_replace("<", "<", str_replace(">", ">", $this->parent_name)));
|
||||
if ($this->parent_contact_name) {
|
||||
$address .= "\n" . $this->parent_contact_name;
|
||||
|
||||
if ($this->parent_contact_title) {
|
||||
$address .= "\n" . $this->parent_contact_title;
|
||||
}
|
||||
|
||||
$personplus = 5;
|
||||
} else {
|
||||
$personplus = 0;
|
||||
}
|
||||
|
||||
if ($this->parent_address_street) {
|
||||
$address .= "\n" . $this->parent_address_street;
|
||||
}
|
||||
|
||||
if ($this->parent_address_postalcode) {
|
||||
$address .= "\n" . $this->parent_address_postalcode;
|
||||
}
|
||||
|
||||
if ($this->parent_address_city) {
|
||||
$address .= " " . $this->parent_address_city;
|
||||
}
|
||||
|
||||
$v = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("SELECT to_vatid FROM ecmprepaymentinvoices WHERE id='".$this->id."'"));
|
||||
$this->to_vatid = $v['to_vatid'];
|
||||
//$this->to_vatid="SELECT to_vatid FROM ecmprapaymentinvoices WHERE id='".$this->id."'";
|
||||
|
||||
if($this->to_vatid)
|
||||
$address .= "\nNIP ".$this->to_vatid;
|
||||
|
||||
/*
|
||||
if ($this->to_nip) {
|
||||
$address .= "\nNip: " . $this->to_nip;
|
||||
} elseif (!$this->to_nip && $this->to_vatid) {
|
||||
$address .= "\nNip: " . $this->to_vatid;
|
||||
}
|
||||
*/
|
||||
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iln,to_nip from accounts where id='" . $this->parent_id . "'"));
|
||||
|
||||
if ($r['iln']) {
|
||||
$address .= "\nILN: " . $r['iln'];
|
||||
}
|
||||
|
||||
//to address
|
||||
$old_x = $pdf->GetX();
|
||||
$old_y = $pdf->GetY();
|
||||
|
||||
$pdf->SetXY(10, 53);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35, 1, "WYSTAWCA:", 0, 0, 'L', 1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(10);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$db = $GLOBALS['db'];
|
||||
$qr = 'SELECT nip FROM accounts WHERE id = \'' . $pdf->edt->account_id . '\'';
|
||||
$r = $db->fetchByAssoc($db->query($qr));
|
||||
|
||||
$wys = $pdf->edt->name . PHP_EOL;
|
||||
|
||||
if ($pdf->edt->footer_address) {
|
||||
$wys .= $pdf->edt->footer_address . PHP_EOL;
|
||||
}
|
||||
|
||||
if ($r['nip']) {
|
||||
$wys.= "NIP " . $r['nip'];
|
||||
}
|
||||
|
||||
$qr = 'SELECT index_dbf FROM accounts WHERE id = \'' . $this->parent_id . '\'';
|
||||
$r = $db->fetchByAssoc($db->query($qr));
|
||||
|
||||
if ($r['index_dbf']) {
|
||||
$address .= PHP_EOL . $mod_strings['LBL_PDF_INDEX_DBF'] . ": " . $r['index_dbf'];
|
||||
}
|
||||
|
||||
$pdf->MultiCell(60, 4, $wys, 0, 'L');
|
||||
//$this->loadParser();
|
||||
//$pdf->header_text = $pdf->template->mfp->parseText($pdf->header_text);
|
||||
//$pdf->MultiCell(60, 4, $pdf->edt->header_text, 0, 'L');
|
||||
|
||||
$pdf->SetXY(76, 53);
|
||||
$pdf->SetFont('arialpl', 'B', 8);
|
||||
$pdf->Cell(35, 1, "ODBIORCA:", 0, 0, 'L', 1);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(76);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$pdf->MultiCell(60, 4, $address, 0, 'L');
|
||||
|
||||
$address = "";
|
||||
$address = str_replace("<", "<", str_replace(">", ">", $r['parent_name']));
|
||||
|
||||
if ($r['parent_address_street']) {
|
||||
$address .= "\n" . $r['parent_address_street'];
|
||||
}
|
||||
|
||||
if ($r['parent_address_postalcode']) {
|
||||
$address .= "\n" . $r['parent_address_postalcode'];
|
||||
}
|
||||
|
||||
if ($r['parent_address_city']) {
|
||||
$address .= " " . $r['parent_address_city'];
|
||||
}
|
||||
|
||||
if ($r['to_nip']) {
|
||||
$address .= "\nNip: " . $r['to_nip'];
|
||||
} elseif (!$r['to_nip'] && $r['to_vatid']) {
|
||||
$address .= "\nNip: " . $r['to_vatid'];
|
||||
}
|
||||
|
||||
$rr = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select iln from accounts where id='" . $r['parent_id'] . "'"));
|
||||
|
||||
if ($rr['iln']) {
|
||||
$address .= "\nILN: " . $rr['iln'];
|
||||
}
|
||||
|
||||
$ynew = $pdf->GetY() + 12;
|
||||
|
||||
if ($this->ecmpaymentcondition_id) {
|
||||
require_once("modules/EcmPaymentConditions/EcmPaymentCondition.php");
|
||||
|
||||
$pc = new EcmPaymentCondition();
|
||||
$pc->retrieve($this->ecmpaymentcondition_id);
|
||||
}
|
||||
|
||||
$pdf->SetXY(160, $old_y + 10 + $personplus);
|
||||
|
||||
$table = array();
|
||||
|
||||
$table[0]['date_reg'] = array(
|
||||
'width' => 16,
|
||||
'value' => "Data wystawienia",
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
$table[0]['date_reg_value'] = array(
|
||||
'width' => 36+ 4,
|
||||
'value' => $this->register_date,
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-style' => 'b',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
$table[1]['date_reg1'] = array(
|
||||
'width' => 16,
|
||||
'value' => "Data przedpłaty",
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
$table[1]['date_reg1_value'] = array(
|
||||
'width' => 36+ 4,
|
||||
'value' => $this->register_date,
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-style' => 'b',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
$q = 'select s.`document_no` as `number`, s.`parent_document_no` as `doc_number`, s.`date_entered` as `date` from `ecmprepaymentinvoices` as pi join `ecmsales` as s on s.`id` = pi.`ecmsale_id` where pi.`id` = \'' . $this->id . '\' group by s.`document_no`;';
|
||||
|
||||
$result = $db->query($q);
|
||||
$results = $db->fetchByAssoc($result);
|
||||
|
||||
// echo '<pre>' . var_export($results['doc_number'], true);
|
||||
// echo '<pre>' . var_export(preg_split ('/( )/', $results['doc_number']), true);
|
||||
// exit;
|
||||
|
||||
if($results) {
|
||||
/*
|
||||
$table[3]['date_sell'] = array(
|
||||
'width' => 16,
|
||||
'value' => 'Zamówienie klienta',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
$table[3]['date_sell_value'] = array(
|
||||
// 'width' => 36 + 16 + 4,
|
||||
'width' => 36 + 4,
|
||||
'value' => chunk_split($results['doc_number'], 15),
|
||||
// 'value' => chunk_split('Zamówienie: ' . $results['doc_number'], 35), //chunk_split($results['doc_number'], 15),
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-style' => 'b',
|
||||
'font-size' => 8,
|
||||
'valign' => 'C',
|
||||
);
|
||||
*/
|
||||
|
||||
//echo '<pre>' . var_dump($results['doc_number'], chunk_split($results['doc_number'], 9), true); exit;
|
||||
|
||||
$table[4]['date_sell'] = array(
|
||||
'width' => 16,
|
||||
'value' => 'Nr ZS',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
$table[4]['date_sell_value'] = array(
|
||||
'width' => 36 + 4,
|
||||
'value' => $results['number'],
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-style' => 'b',
|
||||
'font-size' => 8,
|
||||
'valign' => 'C',
|
||||
);
|
||||
|
||||
$table[5]['date_sell'] = array(
|
||||
'width' => 16,
|
||||
'value' => 'Data ZS',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
$table[5]['date_sell_value'] = array(
|
||||
'width' => 36 + 4,
|
||||
'value' => date('d.m.Y', strtotime($results['date'])),
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-style' => 'b',
|
||||
'font-size' => 8,
|
||||
'valign' => 'C',
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->ecmpaymentcondition_id) {
|
||||
$table[2]['payment_method'] = array(
|
||||
'width' => 20,
|
||||
'value' => "Metoda płatności",
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-size' => 8,
|
||||
);
|
||||
|
||||
$table[2]['payment_method_value'] = array(
|
||||
'width' => 25,
|
||||
'value' => $app_list_strings['ecmpaymentconditions_payment_method_dom'][$pc->payment_method],
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
'font-style' => 'b',
|
||||
'font-size' => 8,
|
||||
);
|
||||
}
|
||||
|
||||
$pdf->SetXY(143, $pdf->tMargin + 20);
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
$pdf->Ln(5);
|
||||
|
||||
$pdf->SetFont('arialpl', '', '18');
|
||||
$pdf->SetXY(60, $pdf->tMargin + 25);
|
||||
|
||||
$pdf->MultiCell(80, 7, "Faktura nr " . $this->document_no. PHP_EOL. 'zaliczkowa', 0, 'C');
|
||||
$pdf->SetFont('arialpl', '', 4);
|
||||
$pdf->Ln(3);
|
||||
$pdf->SetX(60);
|
||||
|
||||
$pdf->SetY($ynew);
|
||||
|
||||
$table = array();
|
||||
|
||||
if (!$this->currency_value) {
|
||||
$this->currency_value = 1;
|
||||
}
|
||||
|
||||
$widths = array(
|
||||
'position' => 4,
|
||||
'description' => 30,
|
||||
'quantity' => 8,
|
||||
//'unit' => 7,
|
||||
'unit_price' => 14,
|
||||
'unit_price_total' => 15,
|
||||
'vat_id' => 8,
|
||||
'vat_value' => 14,
|
||||
'total' => 16,
|
||||
//
|
||||
'number' => 20,
|
||||
'date' => 10,
|
||||
'value' => 14 + 8,
|
||||
'fix_right' => 53,
|
||||
//
|
||||
'fix_left' => 56,
|
||||
'rate' => 8,
|
||||
'netto' => 15,
|
||||
'vat' => 14,
|
||||
'brutto' => 16,
|
||||
);
|
||||
|
||||
$table[0]['position'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['position'],
|
||||
'value' => "Lp.",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['description'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['description'],
|
||||
'value' => "Nazwa",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['quantity'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['quantity'],
|
||||
'value' => "Ilość" . PHP_EOL . 'J.m.',
|
||||
'border' => 1,
|
||||
'overflow' => 1,
|
||||
'font-style' => 'b',
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
/*
|
||||
$table[0]['unit'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['unit'],
|
||||
'value' => "J.M.",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
*/
|
||||
|
||||
$table[0]['unit_price'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['unit_price'],
|
||||
'value' => "Cena Netto",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['unit_price_total'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['unit_price_total'],
|
||||
'value' => "Wartość Netto",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['vat_id'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['vat_id'],
|
||||
'value' => "VAT (%)",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['vat_value'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['vat_value'],
|
||||
'value' => "Wartość VAT",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['total'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['total'],
|
||||
'value' => "Wartość Brutto",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
// ~
|
||||
|
||||
$table[1]['position'] = array(
|
||||
'width' => $widths['position'],
|
||||
'value' => "1",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[1]['description'] = array(
|
||||
'width' => $widths['description'],
|
||||
'value' => $this->description,
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[1]['quantity'] = array(
|
||||
'width' => $widths['quantity'],
|
||||
'value' => "1" . PHP_EOL . 'SZT.',
|
||||
'border' => 1,
|
||||
'overflow' => 1,
|
||||
'font-style' => '',
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
/*
|
||||
$table[1]['unit'] = array(
|
||||
'width' => $widths['unit'],
|
||||
'value' => "SZT.",
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
*/
|
||||
|
||||
$c = new Currency();
|
||||
$c->retrieve($this->currency_id);
|
||||
$c->name = $c->iso4217;
|
||||
$table[1]['unit_price'] = array(
|
||||
'width' => $widths['unit_price'],
|
||||
'value' => number_format(($this->inv_value / (1 + $this->ecmvat_value / 100)), 2, ",", ".") . ' ' . $c->name,
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[1]['unit_price_total'] = array(
|
||||
'width' => $widths['unit_price_total'],
|
||||
'value' => number_format(($this->inv_value / (1 + $this->ecmvat_value / 100)), 2, ",", ".") . ' ' . $c->name,
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[1]['vat_id'] = array(
|
||||
'width' => $widths['vat_id'],
|
||||
'value' => $this->ecmvat_name,
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'C',
|
||||
);
|
||||
|
||||
$table[1]['vat_value'] = array(
|
||||
'width' => $widths['vat_value'],
|
||||
'value' => number_format(($this->inv_value - ($this->inv_value / (1 + $this->ecmvat_value / 100))), 2, ",", ".") . " " . $c->name,
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[1]['total'] = array(
|
||||
'width' => $widths['total'],
|
||||
'value' => number_format((double) $this->inv_value, 2, ",", ".") . ' ' . $c->name,
|
||||
'border' => 1,
|
||||
'font-style' => '',
|
||||
'overflow' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
// echo '<pre>' . var_export($results, true) . '</pre>';
|
||||
// exit;
|
||||
|
||||
if($docNumber = @$results['doc_number']) {
|
||||
$pdf->SetFont('arialpl', '', 10);
|
||||
$pdf->Cell(85, 1, "Zamówienie klienta: " . $results['doc_number'], 0, 0, 'L', 1);
|
||||
$pdf->Ln(3);
|
||||
}
|
||||
|
||||
$pdf->DrawTable($table, array(0));
|
||||
|
||||
$pdf->Ln(0);
|
||||
$pdf->SetFont('arialpl', '', '7');
|
||||
|
||||
global $mod_strings;
|
||||
|
||||
$currency = new Currency();
|
||||
$currency->retrieve($this->currency_id);
|
||||
$this->currency_symbol = $currency->iso4217;
|
||||
|
||||
$lv = return_app_list_strings_language($this->ecmlanguage);
|
||||
|
||||
if ($this->ecmsale_id) {
|
||||
include_once("modules/EcmSales/EcmSale.php");
|
||||
|
||||
$sale = new EcmSale();
|
||||
$sale->retrieve($this->ecmsale_id);
|
||||
$this->position_list = $sale->getPositionList(true);
|
||||
$calc = $sale->calculate($this->position_list, true);
|
||||
}
|
||||
|
||||
$pdf->Ln(8);
|
||||
|
||||
$y = $pdf->GetY();
|
||||
|
||||
$table = array();
|
||||
|
||||
|
||||
$table[0]['fix'] = array(
|
||||
//'background' => array(233, 0, 0),
|
||||
'width' => $widths['fix_left'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
);
|
||||
|
||||
$table[0]['netto'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['netto'],
|
||||
'value' => "Wartość netto",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['rate'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['rate'],
|
||||
'value' => "VAT (%)",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['vat'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['vat'],
|
||||
'value' => "Wartość VAT",
|
||||
'border' => 1,
|
||||
'overflow' => 1,
|
||||
'font-style' => 'b',
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['brutto'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['brutto'],
|
||||
'value' => "Wartość brutto",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
//$pdf->SetXY(10, $y);
|
||||
//$pdf->MultiCell(80, 7, "Rozliczenie zaliczki wg stawek:", 0, 'L');
|
||||
|
||||
$pdf->SetX(10);
|
||||
|
||||
$pdf->DrawTable($table, array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
if (!$this->currency_value) {
|
||||
$this->currency_value = 1;
|
||||
}
|
||||
|
||||
$table = array();
|
||||
|
||||
$i = 1;
|
||||
|
||||
$table[$i]['fix'] = array(
|
||||
//'background' => array(233, 0, 0),
|
||||
'width' => $widths['fix_left'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
);
|
||||
|
||||
$table[$i]['netto'] = array(
|
||||
'width' => $widths['netto'],
|
||||
'value' => number_format(($this->inv_value / (1 + $this->ecmvat_value / 100)), 2, ",", ".") . $c->name,
|
||||
'border' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[$i]['rate'] = array(
|
||||
'width' => $widths['rate'],
|
||||
'value' => $this->ecmvat_name,
|
||||
'border' => 1,
|
||||
'align' => 'C',
|
||||
);
|
||||
|
||||
$table[$i]['vat'] = array(
|
||||
'width' => $widths['vat'],
|
||||
'value' => number_format(($this->inv_value - ($this->inv_value / (1 + $this->ecmvat_value / 100))) , 2, ",", ".") . " " . $c->name,
|
||||
'border' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[$i]['brutto'] = array(
|
||||
'width' => $widths['brutto'],
|
||||
'value' => number_format(($this->inv_value), 2, ",", ".") . " ".$c->name,
|
||||
'border' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
//$table=array();
|
||||
$pdf->SetX(10);
|
||||
$pdf->DrawTable($table);
|
||||
|
||||
|
||||
$rzal = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select date_entered from ecmprepaymentinvoices where id='" . $this->id . "'"));
|
||||
$q = "select document_no,register_date,inv_value,date_entered,currency_value from ecmprepaymentinvoices where deleted='0' and ecmsale_id='" . $this->ecmsale_id . "' and date_entered<'" . $rzal['date_entered'] . "'";
|
||||
$wi = $GLOBALS['db']->query($q);
|
||||
|
||||
if (mysql_num_rows($wi) > 0) {
|
||||
$table = array();
|
||||
|
||||
$table[0]['position'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['position'],
|
||||
'value' => "Lp.",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['number'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['number'],
|
||||
'value' => "Numer faktury",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['date'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['date'],
|
||||
'value' => "Data",
|
||||
'border' => 1,
|
||||
'overflow' => 1,
|
||||
'font-style' => 'b',
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['value'] = array(
|
||||
'background' => array(233, 233, 233),
|
||||
'width' => $widths['value'],
|
||||
'value' => "Wartość brutto",
|
||||
'border' => 1,
|
||||
'font-style' => 'b',
|
||||
'overflow' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[0]['fix'] = array(
|
||||
//'background' => array(233, 0, 0),
|
||||
'width' => $widths['fix_right'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pdf->MultiCell(80, 7, "Poprzednie zaliczki:", 0, 'L');
|
||||
$pdf->DrawTable($table, array(0));
|
||||
|
||||
$pdf->Ln(0);
|
||||
|
||||
$table = array();
|
||||
|
||||
$i = 1;
|
||||
|
||||
$lv = return_app_list_strings_language($this->ecmlanguage);
|
||||
|
||||
$rzal = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select date_entered from ecmprepaymentinvoices where id='" . $this->id . "'"));
|
||||
$wi = $GLOBALS['db']->query("select document_no,register_date,inv_value,date_entered,currency_value from ecmprepaymentinvoices where deleted='0' and ecmsale_id='" . $this->ecmsale_id . "' and date_entered<'" . $rzal['date_entered'] . "'");
|
||||
|
||||
while ($ri = $GLOBALS['db']->fetchByAssoc($wi)) {
|
||||
$m++;
|
||||
|
||||
if (!$ri['currency_value']) {
|
||||
$ri['currency_value'] = 1;
|
||||
}
|
||||
|
||||
$sum+=$ri['inv_value'] * $ri['currency_value'];
|
||||
|
||||
$table[$m]['position'] = array(
|
||||
'width' => $widths['position'],
|
||||
'value' => $m,
|
||||
'border' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[$m]['number'] = array(
|
||||
'width' => $widths['number'],
|
||||
'value' => $ri['document_no'],
|
||||
'border' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[$m]['date'] = array(
|
||||
'width' => $widths['date'],
|
||||
'value' => $ri['register_date'],
|
||||
'border' => 1,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[$m]['value'] = array(
|
||||
'width' => $widths['value'],
|
||||
'value' => number_format($ri['inv_value'] * $ri['currency_value'], 2, ",", ".") . ' ' . $this->currency_symbol,
|
||||
'border' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[$m]['fix'] = array(
|
||||
//'background' => array(233, 0, 0),
|
||||
'width' => $widths['fix_right'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
);
|
||||
}
|
||||
|
||||
$table[$m + 1]['position'] = array(
|
||||
'width' => $widths['position'],
|
||||
'value' => "",
|
||||
'border' => 0,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[$m + 1]['number'] = array(
|
||||
'width' => $widths['number'],
|
||||
'value' => "",
|
||||
'border' => 0,
|
||||
'align' => 'L',
|
||||
);
|
||||
|
||||
$table[$m + 1]['date'] = array(
|
||||
'width' => $widths['date'],
|
||||
'value' => "Razem",
|
||||
'border' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[$m + 1]['value'] = array(
|
||||
'width' => $widths['value'],
|
||||
'value' => number_format($sum, 2, ",", ".") . ' ' . $this->currency_symbol,
|
||||
'border' => 1,
|
||||
'align' => 'R',
|
||||
);
|
||||
|
||||
$table[$m + 1]['fix'] = array(
|
||||
//'background' => array(233, 0, 0),
|
||||
'width' => $widths['fix_right'],
|
||||
'value' => '',
|
||||
'border' => 0,
|
||||
'overflow' => 1,
|
||||
);
|
||||
|
||||
$pdf->DrawTable($table);
|
||||
}
|
||||
78
modules/EcmDocumentTemplates/templates/EcmPurchaseOrders/e5/footer.php
Executable file
78
modules/EcmDocumentTemplates/templates/EcmPurchaseOrders/e5/footer.php
Executable file
@@ -0,0 +1,78 @@
|
||||
<?
|
||||
$this->SetAutoPageBreak(true,24);
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetY($this->fh-15);
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->SetFillColor(255,255,255);
|
||||
$this->Rect(0, $this->getBreakLine(), $this->fw, $this->bMargin+1, "F");
|
||||
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Cell(0, 10, $this->PageNo().'/{nb}');
|
||||
|
||||
$this->Ln(5);
|
||||
$this->AliasNbPages();
|
||||
$this->SetLineWidth(0);
|
||||
$this->SetDrawColor(0,0,0);
|
||||
$this->Line($this->lMargin,$this->getBreakLine()-16,$this->fw-$this->rMargin,$this->fh-$this->bMargin-16+1);
|
||||
|
||||
|
||||
if($this->edt->show_footer_on_all_pages == 0 && $this->page > 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->SetXY($this->lMargin,$this->fh-$this->bMargin+3-16);//16
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,$this->edt->footer_account);
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'KRS: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->footer_krs,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,$this->edt->footer_address);
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'NIP: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->footer_nip,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,$this->edt->footer_phone);
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'REGON: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->footer_regon,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,$this->edt->footer_fax);
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'Bank: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->footer_bankname,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,'www.e5.pl');
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'Numer konta: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,$this->edt->account_number,0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(110,4,'');
|
||||
$this->SetFont('arialpl','B','7');
|
||||
$this->Cell(20,4,'Numer GIOS: ');
|
||||
$this->SetFont('arialpl','','7');
|
||||
$this->Cell(45,4,"E0006254W",0,0,'L');
|
||||
$this->Ln();
|
||||
|
||||
$this->SetFont("arialpl","B",8);
|
||||
$this->SetXY(40,$this->GetY()+1);
|
||||
$r=mysql_fetch_array(mysql_query("select document_no from ".strtolower($_REQUEST['module'])." where id='".$_REQUEST['record']."'"));
|
||||
$this->Cell(45,4,$r['document_no'],0,0,'L');
|
||||
?>
|
||||
17
modules/EcmDocumentTemplates/templates/EcmPurchaseOrders/e5/header.back.php
Executable file
17
modules/EcmDocumentTemplates/templates/EcmPurchaseOrders/e5/header.back.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//logo
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '')
|
||||
if(file_exists($this->edt->logo_path))
|
||||
$this->Image($this->edt->logo_path,$this->rMargin+132,$this->tMargin,0,18.3);
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->lMargin,$this->tMargin+3);
|
||||
$this->MultiCell(100,3.15,$this->edt->header_text,0,'L');
|
||||
|
||||
$this->SetY(32);
|
||||
?>
|
||||
21
modules/EcmDocumentTemplates/templates/EcmPurchaseOrders/e5/header.php
Executable file
21
modules/EcmDocumentTemplates/templates/EcmPurchaseOrders/e5/header.php
Executable file
@@ -0,0 +1,21 @@
|
||||
<?
|
||||
error_reporting(0);
|
||||
if(!$this->blnShowHeader) return;
|
||||
|
||||
if($this->edt->show_header_on_all_pages == 0 && $this->page > 1) return;
|
||||
|
||||
//from address
|
||||
$this->SetFont('arialpl', '', 8);
|
||||
$this->SetXY($this->lMargin,$this->tMargin+2);
|
||||
$this->SetFont('arialpl', '', 20);
|
||||
$this->MultiCell(150,20,'Zamówienie zakupu',0,'C');
|
||||
//$this->MultiCell(100,3.15,$this->edt->header_text.'
|
||||
//'.translate('LBL_PDF_NIP',$module_t).': '.$nip,0,'L');
|
||||
//$this->MultiCell(100,4,"Wystawca:\n".$this->edt->header_text,0,'L');
|
||||
|
||||
//logo
|
||||
if(isset($this->edt->logo_path) && $this->edt->logo_path != '' && file_exists($this->edt->logo_path)){
|
||||
$this->Image($this->edt->logo_path,$this->lMargin+132,$this->tMargin+5,0,12.3);
|
||||
}
|
||||
|
||||
?>
|
||||
55
modules/EcmDocumentTemplates/templates/EcmPurchaseOrders/e5/subfooter.php
Executable file
55
modules/EcmDocumentTemplates/templates/EcmPurchaseOrders/e5/subfooter.php
Executable file
@@ -0,0 +1,55 @@
|
||||
<?
|
||||
|
||||
|
||||
|
||||
//payment conditions
|
||||
if(!empty($this->ecmpaymentcondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmpaymentcondition_text,0,'L');
|
||||
}
|
||||
|
||||
//delivery conditions
|
||||
if(!empty($this->ecmdeliverycondition_text)) {
|
||||
$pdf->Ln(4);
|
||||
$pdf->SetFont('arialpl','','8');
|
||||
$pdf->MultiCell(0,4,$this->ecmdeliverycondition_text,0,'L');
|
||||
}
|
||||
|
||||
|
||||
//footer text
|
||||
|
||||
$wiersze = array();
|
||||
|
||||
$pdf->Ln(4);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
|
||||
$wiersze = explode("\n", $this->footer_text);
|
||||
$table = array();
|
||||
$i =0;
|
||||
foreach ($wiersze as $wiersz) {
|
||||
$table [$i]['wiersz'] = array('width' => 100, 'value' => $wiersz, 'border' => 0, 'overflow' => 1, 'align' => 'J');
|
||||
$i++;
|
||||
}
|
||||
$pdf->DrawTable($table,array(0));
|
||||
|
||||
/*
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->footer_text,0,'J');
|
||||
*/
|
||||
|
||||
|
||||
//header text
|
||||
/*
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
|
||||
*/
|
||||
?>
|
||||
235
modules/EcmDocumentTemplates/templates/EcmPurchaseOrders/e5/subheader.back.php
Executable file
235
modules/EcmDocumentTemplates/templates/EcmPurchaseOrders/e5/subheader.back.php
Executable file
@@ -0,0 +1,235 @@
|
||||
<?
|
||||
$pdf->Ln(2);
|
||||
|
||||
|
||||
//to address
|
||||
|
||||
$address = $this->parent_name;
|
||||
if($this->parent_contact_name) {
|
||||
$address .= "\n".$this->parent_contact_name;
|
||||
if($this->parent_contact_title) $address .= "\n".$this->parent_contact_title;
|
||||
}
|
||||
if($this->parent_address_street) $address .= "\n".$this->parent_address_street;
|
||||
|
||||
if($this->parent_address_postalcode) $address .= "\n".$this->parent_address_postalcode;
|
||||
|
||||
if($this->parent_address_city) $address .= " ".$this->parent_address_city;
|
||||
|
||||
if($this->to_vatid) $address .= "\n\n".$mod_strings['LBL_PDF_VATID']." ".$this->to_vatid;
|
||||
|
||||
$pdf->SetFont('arialpl', '', 10);
|
||||
|
||||
$pdf->Ln(2);
|
||||
$current = $pdf->GetY();
|
||||
//$pdf->MultiCell(0,4,$address,0,'L');
|
||||
$current2 = $pdf->GetY();
|
||||
|
||||
//$current = $pdf->GetY();
|
||||
//$pdf->Ln(7);
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-30,$current);
|
||||
$table = array();
|
||||
$table [0]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [1]['data'] = array('width' => 30, 'value' => $this->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [2]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [3]['data'] = array('width' => 30, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
|
||||
$next = 4;
|
||||
if(isset($this->validtill_date) && $this->validtill_date != '') {
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_VALIDTILL_DATE'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $this->validtill_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
}
|
||||
if($this->correct_id){
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_CORRECT_TO'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$r=mysql_fetch_array(mysql_query("select document_no from ecmstockdocins where id='".$this->correct_id."'"));
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $r['document_no'], 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
}
|
||||
|
||||
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
$pdf->SetY($current2);
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','22');
|
||||
|
||||
$pdf->SetY(45);
|
||||
$pdf->SetX(65);
|
||||
if($this->correct_id) $pdf->MultiCell(90,10,$mod_strings['LBL_PDF_DOCUMENT_NAME_CORRECT'],70,'C');
|
||||
else $pdf->MultiCell(90,10,$mod_strings['LBL_PDF_DOCUMENT_NAME'],70,'C');
|
||||
|
||||
$yaftername=$pdf->GetY()+7;
|
||||
if($this->correct_id)$yaftername+=7;
|
||||
|
||||
|
||||
if(isset($this->validtill_date) && $this->validtill_date != '') $pdf->Ln(9);
|
||||
|
||||
|
||||
$this->loadParser();
|
||||
|
||||
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(20);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->SetY(36);
|
||||
$pdf->MultiCell(0,4,$mod_strings['LBL_PDF_QUOTE_FOR'],0,'J');
|
||||
$pdf->Ln(1);
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
$pdf->MultiCell(0,4,$address,0,'J');
|
||||
|
||||
|
||||
|
||||
$pdf->Ln(20);
|
||||
$pdf->SetY($yaftername);
|
||||
|
||||
|
||||
|
||||
|
||||
global $mod_strings;
|
||||
if(!isset($this->position_list) || !is_array($this->position_list))
|
||||
$this->position_list = $this->getPositionList(true);
|
||||
$calc = $this->calculate($this->position_list,true);
|
||||
$this->position_list = $this->formatPositions($this->position_list);
|
||||
|
||||
$calc['total'] .= ' '.$this->currency_symbol;
|
||||
$calc['subtotal'] .= ' '.$this->currency_symbol;
|
||||
if($calc['discount']) {
|
||||
$calc['total2'] .= ' '.$this->currency_symbol;
|
||||
$calc['discount']['value'] .= ' '.$this->currency_symbol;
|
||||
}
|
||||
|
||||
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
|
||||
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
|
||||
|
||||
|
||||
|
||||
$name_w = 42;
|
||||
$image_w = 10;
|
||||
$recipient_code_w = 10;
|
||||
|
||||
if($this->show_images_on_offers){
|
||||
$name_w -= $image_w;
|
||||
}
|
||||
if($this->show_recipient_code){
|
||||
$name_w -= $recipient_code_w;
|
||||
}
|
||||
|
||||
if($calc['draw_discount']){
|
||||
$name_w -= 8;
|
||||
}
|
||||
if($calc['draw_vat']){
|
||||
$name_w -= 8;
|
||||
}
|
||||
|
||||
$table = array();
|
||||
if($this->show_images_on_offers)
|
||||
$table [0]['image'] = array('width' => $image_w, 'value' => $mod_strings['LBL_PDF_LIST_IMAGE'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
|
||||
$table [0]['position'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['code'] = array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_CODE'],'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
if($this->show_recipient_code)
|
||||
$table [0]['recipient_code'] = array('width' => $recipient_code_w, 'value' => $mod_strings['LBL_PDF_LIST_RECIPIENT_CODE'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
//$table [0]['unit'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'],'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['description'] = array('width' => $name_w, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['quantity'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'],'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['unit'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'], 'border' => 0,'background' => array(233,233,233), 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['unit_price'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
if($calc['draw_discount']) $table [0]['discount'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_DISCOUNT'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
|
||||
if($calc['draw_vat']) $table [0]['vat_id'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_VAT'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
|
||||
$table [0]['total'] = array('width' => 14, 'value' => "Suma netto", 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'R');
|
||||
|
||||
$i = 1;
|
||||
$lv=return_app_list_strings_language($this->ecmlanguage);
|
||||
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
if($this->show_images_on_offers){
|
||||
if(file_exists($this->getProductImage($p['id']))){$table [$i]['image'] = array('width' => $image_w, 'value' => '', 'border' => 0, 'align' => 'R', 'image_path' => $this->getProductImage($p['id']));
|
||||
//$iarr[]=$this->getProductImage($p['id']);
|
||||
}
|
||||
else $table [$i]['image'] = array('width' => $image_w, 'value' => '', 'border' => 0, 'align' => 'R');
|
||||
}
|
||||
$table [$i]['position'] = array('width' => 5, 'value' => $i, 'border' => 0, 'align' => 'C', );
|
||||
$table [$i]['code'] = array('width' => 12, 'value' => $p['code'], 'border' => 0, 'align' => 'C', );
|
||||
if($this->show_recipient_code)
|
||||
$table [$i]['recipient_code'] = array('width' => $recipient_code_w, 'value' => $p['recipient_code'], 'border' => 0, 'align' => 'C', );
|
||||
//$table [$i]['unit'] = array('width' => 10, 'value' => $p['unit_id'], 'border' => 0, 'align' => 'C', );
|
||||
|
||||
/*
|
||||
if($this->ecmlanguage=="en_us"){
|
||||
$r=mysql_fetch_array(mysql_query("select short_description from ecmproduct_language_en_view where ecmproduct_id='".$p['id']."'"));
|
||||
$dname=$r['short_description'];
|
||||
}
|
||||
elseif($this->ecmlanguage=="ge_ge"){
|
||||
$r=mysql_fetch_array(mysql_query("select short_description from ecmproduct_language_de_view where ecmproduct_id='".$p['id']."'"));
|
||||
$dname=$r['short_description'];
|
||||
}
|
||||
else $dname=$p['name'];
|
||||
*/
|
||||
|
||||
$table [$i]['description'] = array('width' => $name_w, 'value' => htmlspecialchars_decode($p['name']), 'border' => 0, 'align' => 'L', );
|
||||
$table [$i]['quantity'] = array('width' => 8, 'value' => $p['quantity'], 'border' => 0, 'align' => 'C', );
|
||||
$table [$i]['unit'] = array('width' => 5, 'value' => $lv['ecmproducts_unit_dom'][$p['unit_id']], 'border' => 0, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit_price'] = array('width' => 14, 'value' => $p['price'], 'border' => 0, 'align' => 'C', );
|
||||
if($calc['draw_discount']) $table [$i]['discount'] = array('width' => 8, 'value' => $p['discount'], 'border' => 0, 'align' => 'R', );
|
||||
if($calc['draw_vat']) $table [$i]['vat_id'] = array('width' => 8, 'value' => $p['vat_name'], 'border' => 0, 'align' => 'R', );
|
||||
$table [$i]['total'] = array('width' => 14, 'value' => $p['total'], 'border' => 0, 'align' => 'R', );
|
||||
$i++;
|
||||
}
|
||||
$starttab=$pdf->GetY()+10;
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$endtab=$pdf->GetY();
|
||||
//for($n=0;$n<$i;$n++){
|
||||
//if(file_exists($iarr[$n]))$pdf->Image($iarr[$n],$pdf->GetX()+1,$starttab+$n*18+1,15,0);
|
||||
//}
|
||||
$pdf->SetY($endtab);
|
||||
//total, vat, subtotal
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
|
||||
//$pdf->SetX($pdf->fw-$pdf->rMargin-$pr*34);
|
||||
$table = array();
|
||||
|
||||
if($calc['vats']) {
|
||||
$table [] = array(
|
||||
'subtotal1' => array('width' => 66, 'value' => "Suma netto", 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9),
|
||||
'subtotal2' => array('width' => 34, 'value' => $calc['subtotal'], 'border' => 0, 'overflow' => 1, 'align' => 'R', 'font-size' => 9), );
|
||||
|
||||
foreach($calc['vats'] as $key => $value){
|
||||
$r=mysql_fetch_array(mysql_query("select name from ecmvats where id='".$key."'"));
|
||||
$vvn=$r['name'];
|
||||
$table [] = array(
|
||||
'vat1' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_VAT'].' ('.$vvn.')', 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9),
|
||||
'vat2' => array('width' => 34, 'value' => $value, 'border' => 0, 'overflow' => 1, 'align' => 'R', 'font-size' => 9), );
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($calc['discount'])) {
|
||||
$table [] = array(
|
||||
'total21' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
|
||||
'total22' => array('width' => 34, 'value' => $calc['total2'], 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 9), );
|
||||
$table [] = array(
|
||||
'discount1' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_DISCOUNT'].' '.$calc['discount']['procent'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
|
||||
'discount2' => array('width' => 34, 'value' => $calc['discount']['value'], 'border' => 0, 'overflow' => 1, 'align' => 'R' , 'font-size' => 9), );
|
||||
}
|
||||
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 66, 'value' => "Suma brutto", 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
|
||||
'total2' => array('width' => 34, 'value' => $calc['total'], 'border' => 0, 'background' => array(233,233,233), 'overflow' => 1, 'align' => 'R' , 'font-size' => 9, 'font-style' => 'b'), );
|
||||
|
||||
$pdf->DrawTable($table);
|
||||
?>
|
||||
212
modules/EcmDocumentTemplates/templates/EcmPurchaseOrders/e5/subheader.php
Executable file
212
modules/EcmDocumentTemplates/templates/EcmPurchaseOrders/e5/subheader.php
Executable file
@@ -0,0 +1,212 @@
|
||||
<?
|
||||
$pdf->SetAutoPageBreak(true,50);
|
||||
$pdf->Ln(2);
|
||||
|
||||
$pdf->SetFont('arialpl', '', 20);
|
||||
$pdf->MultiCell(150,0,$this->document_no,0,'C');
|
||||
|
||||
$pdf->Ln(2);
|
||||
$pdf->SetFont('arialpl', '', 10);
|
||||
$current = $pdf->GetY();
|
||||
//$pdf->MultiCell(0,4,$address,0,'L');
|
||||
$current2 = $pdf->GetY();
|
||||
|
||||
//$current = $pdf->GetY();
|
||||
//$pdf->Ln(7);
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-30,36);
|
||||
$table = array();
|
||||
$table [0]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [1]['data'] = array('width' => 30, 'value' => $this->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [2]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [3]['data'] = array('width' => 30, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [4]['data'] = array('width' => 30, 'value' => "Data dostawy", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [5]['data'] = array('width' => 30, 'value' => $this->delivery_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
|
||||
$next = 6;
|
||||
if(isset($this->validtill_date) && $this->validtill_date != '') {
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_VALIDTILL_DATE'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $this->validtill_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
}
|
||||
|
||||
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
$pdf->SetY($current2);
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','22');
|
||||
|
||||
//$pdf->SetY(28);
|
||||
//$pdf->SetX(65);
|
||||
//$pdf->MultiCell(90,10,$this->name,70,'C');
|
||||
$yaftername=$pdf->GetY()+7;
|
||||
|
||||
|
||||
if(isset($this->validtill_date) && $this->validtill_date != '') $pdf->Ln(9);
|
||||
|
||||
|
||||
//$this->loadParser();
|
||||
|
||||
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
//wystawca
|
||||
$pdf->SetXY(25,15);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$pdf->MultiCell(60,4,$pdf->edt->header_text,0,'L');
|
||||
|
||||
|
||||
|
||||
//Odbiorca:
|
||||
|
||||
$pdf->Ln(20);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->SetY(36);
|
||||
$pdf->MultiCell(0,4,"Odbiorca",0,'J');
|
||||
$pdf->Ln(1);
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
$pdf->MultiCell(0,4,$this->parent_name,0,'J');
|
||||
if($this->parent_address_street) $pdf->MultiCell(0,4,$this->parent_address_street,0,'J');
|
||||
if($this->parent_address_postalcode) $city = $this->parent_address_postalcode;
|
||||
if($this->parent_address_city) $city.=" ".$this->parent_address_city;
|
||||
if ($city) $pdf->MultiCell(0,4,$city,0,'J');
|
||||
|
||||
|
||||
$pdf->Ln(20);
|
||||
$pdf->SetY($yaftername);
|
||||
|
||||
|
||||
|
||||
|
||||
//********************
|
||||
global $mod_strings;
|
||||
if(!isset($this->position_list) || !is_array($this->position_list))
|
||||
$this->position_list = $this->getPositionList(true);
|
||||
$calc = $this->calculate($this->position_list,true);
|
||||
$this->position_list = $this->formatPositions($this->position_list);
|
||||
|
||||
$calc['total'] .= ' '.$this->currency_symbol;
|
||||
$calc['subtotal'] .= ' '.$this->currency_symbol;
|
||||
if($calc['discount']) {
|
||||
$calc['total2'] .= ' '.$this->currency_symbol;
|
||||
$calc['discount']['value'] .= ' '.$this->currency_symbol;
|
||||
}
|
||||
|
||||
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
|
||||
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
|
||||
|
||||
|
||||
|
||||
$pdf->Ln(7);
|
||||
$name_w = 43;
|
||||
$table = array();
|
||||
|
||||
$table [0]['image'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_IMAGE'], 'border' => 0,'background' => array(233,233,233), 'overflow' => 1, 'align' => 'R');
|
||||
$table [0]['position'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['code'] = array('width' => 16, 'value' => "Index\nEAN\nVendor index", 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['description'] = array('width' => 31, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'], 'border' => 0,'background' => array(233,233,233),'font-style'=>'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['quantity'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'], 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['unit'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'], 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['unit_price'] = array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_PRICE'], 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['total'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL'], 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$pdf->SetY(70);
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
$table=array();
|
||||
$i = 1;
|
||||
$ii =1;
|
||||
$lv=return_app_list_strings_language($this->ecmlanguage);
|
||||
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
|
||||
$p_image=$this->getProductImage($p['id']);
|
||||
|
||||
if(file_exists($p_image)){$table [$i]['image'] = array('width' => 10, 'value' => '', 'border' => 0, 'align' => 'R', 'image_path' => $p_image);
|
||||
}
|
||||
else $table [$i]['image'] = array('width' => 10, 'value' => '', 'border' => 0, 'align' => 'R');
|
||||
|
||||
|
||||
$table [$i]['position'] = array('width' => 5, 'value' => $ii, 'border' => 0, 'align' => 'C', );
|
||||
|
||||
$query = "SELECT ean FROM ecmproduct_language WHERE ecmproduct_id='".$p['id']."' AND language='".substr($this->ecmlanguage, 0, 2)."';";
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
$ean = $GLOBALS['db']->fetchByAssoc($result);
|
||||
if (empty($ean['ean'])) {
|
||||
// try only pl
|
||||
$query = "SELECT ean FROM ecmproduct_language WHERE ecmproduct_id='".$p['id']."' AND language='pl';";
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
$ean = $GLOBALS['db']->fetchByAssoc($result);
|
||||
}
|
||||
if (empty($ean['ean'])) $ean='-'; else $ean=$ean['ean'];
|
||||
$query = "SELECT vendor_part_no FROM ecmproducts WHERE id='".$p['id']."';";
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
$vpn = $GLOBALS['db']->fetchByAssoc($result);
|
||||
if (empty($vpn['vendor_part_no'])) $vpn='-'; else $vpn=$vpn['vendor_part_no'];
|
||||
|
||||
$table [$i]['code'] = array('width' => 16, 'value' => $p['code']."\n".$ean."\n".$vpn, 'border' => 0, 'align' => 'C', );
|
||||
$table [$i]['description'] = array('width' => 31, 'value' => htmlspecialchars_decode($p['name']), 'border' => 0, 'align' => 'L', );
|
||||
$table [$i]['quantity'] = array('width' => 8, 'value' => $p['quantity'], 'border' => 0, 'align' => 'C', );
|
||||
$table [$i]['unit'] = array('width' => 5, 'value' => $lv['ecmproducts_unit_dom'][$p['unit_id']], 'border' => 0, 'align' => 'C', 'font-size' => 7 );
|
||||
$table [$i]['unit_price'] = array('width' => 12, 'value' => $p['price'], 'border' => 0, 'align' => 'C', );
|
||||
$table [$i]['total'] = array('width' => 14, 'value' => $p['total'], 'border' => 0, 'align' => 'R', );
|
||||
$i++;
|
||||
$table [$i]['image'] = array('width' => 100, 'font-style'=>'b', 'value' => '___________________________________________________________________________________________________________','border'=>'0', 'align' => 'R',);
|
||||
$i++;
|
||||
$ii++;
|
||||
}
|
||||
$pdf->DrawTable($table,array(0));
|
||||
|
||||
$endtab=$pdf->GetY();
|
||||
$pdf->SetY($endtab);
|
||||
|
||||
$pdf->SetAutoPageBreak(true,45);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
|
||||
$table = array();
|
||||
|
||||
if($calc['vats']) {
|
||||
$table [] = array(
|
||||
'subtotal1' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9),
|
||||
'subtotal2' => array('width' => 34, 'value' => $calc['subtotal'], 'border' => 0, 'overflow' => 1, 'align' => 'R', 'font-size' => 9),
|
||||
);
|
||||
|
||||
foreach($calc['vats'] as $key => $value){
|
||||
$r=mysql_fetch_array(mysql_query("select name from ecmvats where id='".$key."'"));
|
||||
$vvn=$r['name'];
|
||||
$table [] = array(
|
||||
'vat1' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_VAT'].' ('.$vvn.')', 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9),
|
||||
'vat2' => array('width' => 34, 'value' => $value, 'border' => 0, 'overflow' => 1, 'align' => 'R', 'font-size' => 9),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_END_TOTAL'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
|
||||
'total2' => array('width' => 34, 'value' => $calc['total'], 'border' => 0, 'background' => array(233,233,233), 'overflow' => 1, 'align' => 'R' , 'font-size' => 9, 'font-style' => 'b'),
|
||||
);
|
||||
|
||||
//if($pdf->GetY()+30>$pdf->fh-$pdf->bMargin)$pdf->AddPage();
|
||||
//$pdf->SetX(127);
|
||||
$pdf->DrawTable($table);
|
||||
|
||||
//show ads text
|
||||
$pdf->SetY($pdf->GetY()+20);
|
||||
$pdf->SetFont('arialpl', '', 10);
|
||||
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
|
||||
|
||||
|
||||
$pdf->SetAutoPageBreak(true,50);
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,254 @@
|
||||
<?
|
||||
//$pdf->SetAutoPageBreak(true,34);
|
||||
|
||||
$pdf->Ln(2);
|
||||
|
||||
$pdf->SetFont('arialpl', '', 10);
|
||||
|
||||
$pdf->Ln(2);
|
||||
$current = $pdf->GetY();
|
||||
//$pdf->MultiCell(0,4,$address,0,'L');
|
||||
$current2 = $pdf->GetY();
|
||||
|
||||
//$current = $pdf->GetY();
|
||||
//$pdf->Ln(7);
|
||||
$pdf->SetXY($pdf->fw-$pdf->rMargin-30,36);
|
||||
$table = array();
|
||||
$table [0]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_NUMBER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [1]['data'] = array('width' => 30, 'value' => $this->document_no, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [2]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_DATE_REGISTER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [3]['data'] = array('width' => 30, 'value' => $this->register_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
|
||||
$next = 4;
|
||||
if(isset($this->validtill_date) && $this->validtill_date != '') {
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_VALIDTILL_DATE'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $this->validtill_date, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
}
|
||||
|
||||
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $this->setUser()->full_name, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$pdf->DrawTable($table, null, 0.5, 0.5, 3);
|
||||
|
||||
$pdf->SetY($current2);
|
||||
|
||||
$pdf->Ln(12);
|
||||
|
||||
$pdf->SetFont('arialpl','','22');
|
||||
|
||||
$pdf->SetY(28);
|
||||
$pdf->SetX(65);
|
||||
$pdf->MultiCell(90,10,$mod_strings['LBL_PDF_PACKING_LIST'],70,'C');
|
||||
$yaftername=$pdf->GetY()+7;
|
||||
|
||||
|
||||
if(isset($this->validtill_date) && $this->validtill_date != '') $pdf->Ln(9);
|
||||
|
||||
|
||||
$this->loadParser();
|
||||
|
||||
|
||||
$this->header_text = $this->template->mfp->parseText($this->header_text);
|
||||
|
||||
$this->footer_text = $this->template->mfp->parseText($this->footer_text);
|
||||
|
||||
$this->ads_text = $this->template->mfp->parseText($this->ads_text);
|
||||
|
||||
//wystawca
|
||||
$pdf->SetXY(25,15);
|
||||
$pdf->SetFont('arialpl', '', 8);
|
||||
$pdf->MultiCell(60,4,$pdf->edt->header_text,0,'L');
|
||||
|
||||
|
||||
|
||||
//Odbiorca:
|
||||
|
||||
$pdf->Ln(20);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->SetY(36);
|
||||
$pdf->MultiCell(0,4,"Odbiorca",0,'J');
|
||||
$pdf->Ln(1);
|
||||
$pdf->SetFont('arialpl','','10');
|
||||
$pdf->MultiCell(0,4,$this->parent_name,0,'J');
|
||||
if($this->parent_address_street) $pdf->MultiCell(0,4,$this->parent_address_street,0,'J');
|
||||
if($this->parent_address_postalcode) $city = $this->parent_address_postalcode;
|
||||
if($this->parent_address_city) $city.=" ".$this->parent_address_city;
|
||||
if ($city) $pdf->MultiCell(0,4,$city,0,'J');
|
||||
|
||||
|
||||
$pdf->Ln(20);
|
||||
$pdf->SetY($yaftername);
|
||||
|
||||
|
||||
|
||||
|
||||
//********************
|
||||
global $mod_strings;
|
||||
if(!isset($this->position_list) || !is_array($this->position_list))
|
||||
$this->position_list = $this->getPositionList(true);
|
||||
$calc = $this->calculate($this->position_list,true);
|
||||
$this->position_list = $this->formatPositions($this->position_list);
|
||||
|
||||
$calc['total'] .= ' '.$this->currency_symbol;
|
||||
$calc['subtotal'] .= ' '.$this->currency_symbol;
|
||||
if($calc['discount']) {
|
||||
$calc['total2'] .= ' '.$this->currency_symbol;
|
||||
$calc['discount']['value'] .= ' '.$this->currency_symbol;
|
||||
}
|
||||
|
||||
if(isset($calc['vats']) && is_array($calc['vats']) && count($calc['vats']) > 0)
|
||||
foreach($calc['vats'] as $key => $value) $calc['vats'][$key] .= ' '.$this->currency_symbol;
|
||||
|
||||
|
||||
|
||||
$pdf->Ln(7);
|
||||
$name_w = 43;
|
||||
$table = array();
|
||||
|
||||
//$table [0]['image'] = array('width' => 10, 'value' => $mod_strings['LBL_PDF_LIST_IMAGE'], 'border' => 0,'background' => array(233,233,233), 'overflow' => 1, 'align' => 'R');
|
||||
$table [0]['position'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['code'] = array('width' => 16, 'value' => "Index\nEAN", 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['description'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'], 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['quantity'] = array('width' => 8, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'], 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
//ilo<6C><6F> sz. w kartonie
|
||||
$table [0]['pcs-ctn'] = array('width' => 5, 'value' => "psc\nctn", 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
//ilo<6C><6F> karton<6F>w
|
||||
$table [0]['total-ctns'] = array('width' => 5, 'value' => "total ctns", 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
//obj<62>to<74><6F> kartonu
|
||||
$table [0]['cubm-ctns'] = array('width' => 6, 'value' => "cubm\nctns", 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
//obj<62>to<74><6F> ca<63>kowita
|
||||
$table [0]['total-cubm'] = array('width' => 6, 'value' => "total\ncubm", 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
//waga netto
|
||||
$table [0]['netto'] = array('width' => 6, 'value' => "N.W\nctns", 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
//suma netto
|
||||
$table [0]['total-netto'] = array('width' => 8, 'value' => "total kg N.W", 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
//waga brutto
|
||||
$table [0]['brutto'] = array('width' => 6, 'value' => "G.W.\nctns", 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
//suma brutto
|
||||
$table [0]['total-brutto'] = array('width' => 8, 'value' => "total kg G.W", 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
|
||||
$pdf->SetY(60);
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
$table=array();
|
||||
$i = 1;
|
||||
$ii =1;
|
||||
$lv=return_app_list_strings_language($this->ecmlanguage);
|
||||
|
||||
//total array 0-quantity, 1-total-ctns, 2-total-cubm, 3-totan-NW, 4-total-GW
|
||||
//$total_array[] = array();
|
||||
//for ($i; $i<4; $i++) $total_array[$i]=0;
|
||||
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
/*
|
||||
$p_image=$this->getProductImage($p['id']);
|
||||
|
||||
if(file_exists($p_image)){$table [$i]['image'] = array('width' => 10, 'value' => '', 'border' => 0, 'align' => 'R', 'image_path' => $p_image);
|
||||
}
|
||||
else $table [$i]['image'] = array('width' => 10, 'value' => '', 'border' => 0, 'align' => 'R');
|
||||
*/
|
||||
|
||||
$table [$i]['position'] = array('width' => 5, 'value' => $ii, 'border' => 0, 'align' => 'C', );
|
||||
|
||||
$query = "SELECT ean FROM ecmproduct_language WHERE ecmproduct_id='".$p['id']."' AND language='".substr($this->ecmlanguage, 0, 2)."';";
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
$ean = $GLOBALS['db']->fetchByAssoc($result);
|
||||
if (empty($ean['ean'])) {
|
||||
// try pl
|
||||
$query = "SELECT ean FROM ecmproduct_language WHERE ecmproduct_id='".$p['id']."' AND language='pl';";
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
$ean = $GLOBALS['db']->fetchByAssoc($result);
|
||||
}
|
||||
if (empty($ean['ean'])) $ean=''; else $ean=$ean['ean'];
|
||||
$table [$i]['code'] = array('width' => 16, 'value' => $p['code']."\n".$ean, 'border' => 0, 'align' => 'C', );
|
||||
$table [$i]['description'] = array('width' => 20, 'value' => htmlspecialchars_decode($p['name']), 'border' => 0, 'align' => 'L', );
|
||||
$table [$i]['quantity'] = array('width' => 8, 'value' => $p['quantity'], 'border' => 0, 'align' => 'C', );
|
||||
$total_array[0]+=intval($p['quantity']);
|
||||
//getData
|
||||
$query = "SELECT pieces_per_carton, carton_volume_meter, carton_netto_weight, carton_brutto_weight FROM ecmproducts WHERE id='".$p['id']."';";
|
||||
$result = $GLOBALS['db']->query($query);
|
||||
$row = $GLOBALS['db']->fetchByAssoc($result);
|
||||
$totalctns = ceil($p['quantity']/$row['pieces_per_carton']);
|
||||
$totalcubm = ceil($p['quantity']/$row['pieces_per_carton'])*$row['carton_volume_meter'];
|
||||
$totalnetto = ceil($p['quantity']/$row['pieces_per_carton'])*$row['carton_netto_weight'];
|
||||
$totalbrutto = ceil($p['quantity']/$row['pieces_per_carton'])*$row['carton_brutto_weight'];
|
||||
$total_array[1]+= (float) $totalctns;
|
||||
$total_array[2]+= (float) $totalcubm;
|
||||
$total_array[3]+= (float) $totalnetto;
|
||||
$total_array[4]+= (float) $totalbrutto;
|
||||
|
||||
|
||||
//ilo<6C><6F> sz. w kartonie
|
||||
$table [$i]['pcs-ctn'] = array('width' => 5, 'value' => $row['pieces_per_carton'], 'border' => 0,'font-style' => '', 'overflow' => 1, 'align' => 'C');
|
||||
//ilo<6C><6F> karton<6F>w
|
||||
$table [$i]['total-ctns'] = array('width' => 5, 'value' => round($totalctns,2), 'border' => 0,'font-style' => '', 'overflow' => 1, 'align' => 'C');
|
||||
//obj<62>to<74><6F> kartonu
|
||||
$table [$i]['cubm-ctns'] = array('width' => 6, 'value' => round($row['carton_volume_meter'],2), 'border' => 0,'font-style' => '', 'overflow' => 1, 'align' => 'C');
|
||||
//obj<62>to<74><6F> ca<63>kowita
|
||||
$table [$i]['total-cubm'] = array('width' => 6, 'value' => round($totalcubm,2), 'border' => 0,'font-style' => '', 'overflow' => 1, 'align' => 'C');
|
||||
//waga netto
|
||||
$table [$i]['netto'] = array('width' => 6, 'value' => round($row['carton_netto_weight'],2), 'border' => 0,'font-style' => '', 'overflow' => 1, 'align' => 'C');
|
||||
//suma netto
|
||||
$table [$i]['total-netto'] = array('width' => 8, 'value' => round($totalnetto,2), 'border' => 0,'font-style' => '', 'overflow' => 1, 'align' => 'C');
|
||||
//waga brutto
|
||||
$table [$i]['brutto'] = array('width' => 6, 'value' => round($row['carton_brutto_weight'],2), 'border' => 0,'font-style' => '', 'overflow' => 0, 'align' => 'C');
|
||||
//suma brutto
|
||||
$table [$i]['total-brutto'] = array('width' => 8, 'value' => round($totalbrutto,2), 'border' => 0,'font-style' => '', 'overflow' => 1, 'align' => 'C');
|
||||
$i++;
|
||||
$table [$i]['image'] = array('width' => 100, 'font-style'=>'b', 'value' => '___________________________________________________________________________________________________________','border'=>'0', 'align' => 'R',);
|
||||
$i++;
|
||||
$ii++;
|
||||
}
|
||||
//TOTAL ROW
|
||||
$table [$i]['position'] = array('width' => 5, 'value' => "", 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [$i]['code'] = array('width' => 16, 'value' => "TOTAL", 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [$i]['description'] = array('width' => 20, 'value' => "", 'border' => 0,'background' => array(233,233,233), 'overflow' => 1, 'align' => 'C');
|
||||
$table [$i]['quantity'] = array('width' => 8, 'value' => $total_array[0], 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [$i]['pcs-ctn'] = array('width' => 5, 'value' => "", 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [$i]['total-ctns'] = array('width' => 5, 'value' => round($total_array[1],2), 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [$i]['cubm-ctns'] = array('width' => 6, 'value' => "", 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [$i]['total-cubm'] = array('width' => 6, 'value' => round($total_array[2],2), 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [$i]['netto'] = array('width' => 6, 'value' => "", 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [$i]['total-netto'] = array('width' => 8, 'value' => round($total_array[3],2), 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [$i]['brutto'] = array('width' => 6, 'value' => "", 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
$table [$i]['total-brutto'] = array('width' => 8, 'value' => round($total_array[4],2), 'border' => 0,'background' => array(233,233,233),'font-style' => 'b', 'overflow' => 1, 'align' => 'C');
|
||||
|
||||
$pdf->DrawTable($table,array(0));
|
||||
|
||||
$endtab=$pdf->GetY();
|
||||
$pdf->SetY($endtab);
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
|
||||
$table = array();
|
||||
|
||||
if($calc['vats']) {
|
||||
$table [] = array(
|
||||
'subtotal1' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_TOTAL'], 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9),
|
||||
'subtotal2' => array('width' => 34, 'value' => $calc['subtotal'], 'border' => 0, 'overflow' => 1, 'align' => 'R', 'font-size' => 9),
|
||||
);
|
||||
|
||||
foreach($calc['vats'] as $key => $value){
|
||||
$r=mysql_fetch_array(mysql_query("select name from ecmvats where id='".$key."'"));
|
||||
$vvn=$r['name'];
|
||||
$table [] = array(
|
||||
'vat1' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_VAT'].' ('.$vvn.')', 'background' => array(255,255,255), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9),
|
||||
'vat2' => array('width' => 34, 'value' => $value, 'border' => 0, 'overflow' => 1, 'align' => 'R', 'font-size' => 9),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 66, 'value' => $mod_strings['LBL_PDF_END_TOTAL'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 9, 'font-style' => 'b'),
|
||||
'total2' => array('width' => 34, 'value' => $calc['total'], 'border' => 0, 'background' => array(233,233,233), 'overflow' => 1, 'align' => 'R' , 'font-size' => 9, 'font-style' => 'b'),
|
||||
);
|
||||
|
||||
//if($pdf->GetY()+30>$pdf->fh-$pdf->bMargin)$pdf->AddPage();
|
||||
//$pdf->SetX(127);
|
||||
// $pdf->DrawTable($table);
|
||||
|
||||
?>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user