init
This commit is contained in:
77
modules/templates/EcmStockDocMoves/e5/footer.php
Executable file
77
modules/templates/EcmStockDocMoves/e5/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');
|
||||
?>
|
||||
19
modules/templates/EcmStockDocMoves/e5/header.php
Executable file
19
modules/templates/EcmStockDocMoves/e5/header.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?
|
||||
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);
|
||||
}
|
||||
|
||||
?>
|
||||
46
modules/templates/EcmStockDocMoves/e5/subfooter.php
Executable file
46
modules/templates/EcmStockDocMoves/e5/subfooter.php
Executable file
@@ -0,0 +1,46 @@
|
||||
<?
|
||||
|
||||
|
||||
|
||||
//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->name,0,'J');
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(10);
|
||||
$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,"wydal",0,0,'C',1);
|
||||
$pdf->SetX(155);
|
||||
$pdf->Cell(35,1,"przyjal",0,0,'C',1);
|
||||
$pdf->Ln(20);
|
||||
/*
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
|
||||
*/
|
||||
?>
|
||||
219
modules/templates/EcmStockDocMoves/e5/subheader.back.php
Executable file
219
modules/templates/EcmStockDocMoves/e5/subheader.back.php
Executable file
@@ -0,0 +1,219 @@
|
||||
<?
|
||||
$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();
|
||||
|
||||
//$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 ecmstockdocinsideins 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');
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_STOCK_FROM'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$r=mysql_fetch_array(mysql_query("select name from ecmstocks where id='".$this->stock_from_id."'"));
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $r['name'], 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_STOCK_TO'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$r=mysql_fetch_array(mysql_query("select name from ecmstocks where id='".$this->stock_to_id."'"));
|
||||
$table [$next++]['data'] = array('width' => 30, 'value' => $r['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(60);
|
||||
$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,$this->parent_name,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 = 22;
|
||||
$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();
|
||||
$table [0]['position'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
//if($this->show_images_on_offers)
|
||||
$table [0]['code'] = array('width' => $image_w, 'value' => "Index", 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
$table [0]['quantity'] = array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'],'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+28), 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'], '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' => 'C');
|
||||
//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' => 'C');
|
||||
$table [0]['total'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
|
||||
$i = 1;
|
||||
$lv=return_app_list_strings_language($this->ecmlanguage);
|
||||
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
$table [$i]['position'] = array('width' => 5, 'value' => $i, 'border' => 0, 'align' => 'R', );
|
||||
/*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']));
|
||||
else $table [$i]['image'] = array('width' => $image_w, 'value' => '', 'border' => 0, 'align' => 'R');
|
||||
}*/
|
||||
$table [$i]['code'] = array('width' => $image_w, 'value' => $p['code'], 'border' => 0, 'align' => 'R');
|
||||
$table [$i]['quantity'] = array('width' => 12, 'value' => $p['quantity'], 'border' => 0, 'align' => 'C', );
|
||||
//$table [$i]['unit'] = array('width' => 10, 'value' => $p['unit_id'], 'border' => 0, 'align' => 'C', );
|
||||
$table [$i]['description'] = array('width' => ($name_w+28), 'value' => htmlspecialchars_decode($p['name']), 'border' => 0, 'align' => 'L', );
|
||||
$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' => 'R', );
|
||||
//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++;
|
||||
}
|
||||
|
||||
$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' => 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), );
|
||||
}
|
||||
}
|
||||
|
||||
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' => $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'), );
|
||||
|
||||
$pdf->DrawTable($table);
|
||||
?>
|
||||
168
modules/templates/EcmStockDocMoves/e5/subheader.php
Executable file
168
modules/templates/EcmStockDocMoves/e5/subheader.php
Executable file
@@ -0,0 +1,168 @@
|
||||
<?
|
||||
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,33);
|
||||
$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(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]['stock'] = array('width' => 20, 'value' => "Z magazynu", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [2]['stock_value'] = array('width' => 36, 'value' => $this->stock_from_name, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$table [3]['stock_to'] = array('width' => 20, 'value' => "Na magazyn", 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [3]['stock_to_value'] = array('width' => 36, 'value' => $this->stock_to_name, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 8);
|
||||
|
||||
$table [4]['user'] = array('width' => 20, 'value' => $mod_strings['LBL_PDF_OWNER'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-size' => 8);
|
||||
$table [4]['user_value'] = array('width' => 36, 'value' => $this->setUser()->full_name, '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);
|
||||
$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);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$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 = 43;
|
||||
$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]['unit'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_UNIT'], '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);
|
||||
$pdf->DrawTable($table,array(0));
|
||||
$pdf->Ln(0);
|
||||
|
||||
$table=array();
|
||||
$i = 1;
|
||||
$lv=return_app_list_strings_language($this->ecmlanguage);
|
||||
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
$table [$i]['position'] = array('width' => 5, 'value' => $i, '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]['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' => 14, 'value' => format_number($p['price']).' '.$this->currency_symbol, 'border' => 1, 'align' => 'C', );
|
||||
$table [$i]['total'] = array('width' => 14, 'value' => format_number($p['total']).' '.$this->currency_symbol, 'border' => 1, 'align' => 'R', );
|
||||
$i++;
|
||||
}
|
||||
$pdf->DrawTable($table,array(0));
|
||||
|
||||
|
||||
$pdf->Ln(4);
|
||||
$pr = ($pdf->fw-$pdf->lMargin-$pdf->rMargin)/100;
|
||||
$table = array();
|
||||
/*
|
||||
if($calc['vats']) {
|
||||
$table [] = array(
|
||||
'subtotal1' => array('width' => 13,'font-style' => 'b', 'value' => "Suma netto", 'border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 9),
|
||||
'subtotal2' => array('width' => 28, 'value' => $calc['subtotal'], 'border' => 1, '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' => 13,'font-style' => 'b', 'value' => $mod_strings['LBL_PDF_VAT'].' ('.$vvn.')','border' => 1, 'overflow' => 1, 'align' => 'L', 'font-size' => 9),
|
||||
'vat2' => array('width' => 28, 'value' => $value, 'border' => 1, 'overflow' => 1, 'align' => 'R', 'font-size' => 9)
|
||||
);
|
||||
}
|
||||
}*/
|
||||
|
||||
$table [] = array(
|
||||
'total1' => array('width' => 13,'font-style' => 'b', 'value' => "Suma brutto",'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(127);
|
||||
$pdf->DrawTable($table);
|
||||
?>
|
||||
31
modules/templates/EcmStockDocMoves/saascrm/footer.php
Executable file
31
modules/templates/EcmStockDocMoves/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');
|
||||
?>
|
||||
33
modules/templates/EcmStockDocMoves/saascrm/header.php
Executable file
33
modules/templates/EcmStockDocMoves/saascrm/header.php
Executable file
@@ -0,0 +1,33 @@
|
||||
<?
|
||||
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);
|
||||
}*/
|
||||
?>
|
||||
37
modules/templates/EcmStockDocMoves/saascrm/subfooter.php
Executable file
37
modules/templates/EcmStockDocMoves/saascrm/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');
|
||||
|
||||
|
||||
|
||||
//header text
|
||||
|
||||
$pdf->Ln(10);
|
||||
|
||||
$pdf->SetFont('arialpl','B','10');
|
||||
|
||||
$pdf->MultiCell(0,4,$this->ads_text,0,'J');
|
||||
?>
|
||||
210
modules/templates/EcmStockDocMoves/saascrm/subheader.php
Executable file
210
modules/templates/EcmStockDocMoves/saascrm/subheader.php
Executable file
@@ -0,0 +1,210 @@
|
||||
<?
|
||||
/*
|
||||
$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-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');
|
||||
$table [6]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_STOCK_FROM'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [7]['data'] = array('width' => 30, 'value' => $this->stock_from_name, 'border' => 0, 'overflow' => 1, 'align' => 'L');
|
||||
$table [8]['data'] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_STOCK_TO'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9);
|
||||
$table [9]['data'] = array('width' => 30, 'value' => $this->stock_to_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(30);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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 = 47;
|
||||
$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();
|
||||
$table [0]['position'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
|
||||
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]['quantity'] = array('width' => 12, 'value' => $mod_strings['LBL_PDF_LIST_QUANTITY'],'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+28), 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'], 'background' => array(233,233,233), 'border' => 0, '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' => 'C');
|
||||
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' => 'C');
|
||||
$table [0]['total'] = array('width' => 14, 'value' => $mod_strings['LBL_PDF_LIST_TOTAL'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');*/
|
||||
|
||||
$i = 1;
|
||||
if($this->position_list != '')
|
||||
foreach($this->position_list as $p) {
|
||||
$table [$i]['position'] = array('width' => 5, 'value' => $i, 'border' => 0, 'align' => 'R', );
|
||||
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']));
|
||||
else $table [$i]['image'] = array('width' => $image_w, 'value' => '', 'border' => 0, 'align' => 'R');
|
||||
}
|
||||
$table [$i]['quantity'] = array('width' => 12, 'value' => $p['quantity'], 'border' => 0, 'align' => 'C', );
|
||||
//$table [$i]['unit'] = array('width' => 10, 'value' => $p['unit_id'], 'border' => 0, 'align' => 'C', );
|
||||
$table [$i]['description'] = array('width' => ($name_w+28), 'value' => htmlspecialchars_decode($p['name']), 'border' => 0, 'align' => 'L', );
|
||||
/*$table [$i]['unit_price'] = array('width' => 14, 'value' => $p['price'], 'border' => 0, 'align' => 'R', );
|
||||
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++;
|
||||
}
|
||||
|
||||
$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' => 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), );
|
||||
}
|
||||
}
|
||||
|
||||
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' => $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'), );*/
|
||||
|
||||
$pdf->DrawTable($table);
|
||||
?>
|
||||
Reference in New Issue
Block a user