WriteHtml(''); $pdf->SetAutoPageBreak(true, 20); //$pdf->AddFont('arialgr', '', 'arialgr.php'); //$pdf->SetFont('arialgr','','8'); //$pdf->MultiCell(0,4,"TEST",0,'J'); $lv = return_app_list_strings_language($this->ecmlanguage); //echo $this->invoice_type . ' - ' . $this->currency_symbol; //exit; //if ($this->currency_symbol != 'EUR') { $c = new Currency(); $c->retrieve('6336d9a0-ee5f-52e3-7d0c-4e6f1472b2bf'); if ($this->invoice_type == 'K') { if($this->currency_symbol != 'EUR') { $pdf->SetFont('arialpl', '', 8); $pdf->setX(11); $pdf->WriteHtml(sprintf('Podana wartość zamówienia wg aktualnego kursu sprzedaży walut w banku Citi Handlowym: 1 EUR = %s %s.', format_number($c->conversion_rate, 4, 4), $this->currency_symbol)); $pdf->Ln(4); $pdf->setX(11); $pdf->WriteHtml('Ceny zostaną przeliczone wg odpowiedniego kursu obowiązującego w chwili wystawienia faktury.'); $pdf->Ln(4); } else { $pdf->SetFont('arialpl', '', 8); $pdf->setX(11); $pdf->WriteHtml('Faktura zostanie wystawiona w walucie EURO i płatność nastąpi w walucie EURO.'); $pdf->Ln(4); } } if ($this->payment_method && $this->payment_method != 'INNY') { $table = array(); $pm = $lv['payment_method_dom'][$this->payment_method]; if ($this->payment_deadline && $this->payment_deadline != '') $pm.=', ' . $this->payment_deadline . ' dni'; $table [0][] = array( 'width' => 30, 'value' => $mod_strings['LBL_PDF_PAYMENT'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9, ); $table [0][] = array( 'width' => 70, 'value' => $pm, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => '', 'font-size' => 9, ); $pdf->Ln(5); $pdf->DrawTable($table, null, 0, 0, 3); } elseif ($this->payment_description != '' && $this->payment_method == '') { $table = array(); $table [0][] = array( 'width' => 30, 'value' => $mod_strings['LBL_PDF_PAYMENT'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9, ); $table [0][] = array( 'width' => 70, 'value' => $this->payment_description, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => '', 'font-size' => 9, ); $pdf->Ln(5); $pdf->DrawTable($table, null, 0, 0, 3); } if ($this->realization_description && $this->realization_description != '') { $table = array(); $table [0][] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_REALIZATION'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9); $table [0][] = array('width' => 70, 'value' => $this->realization_description, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => '', 'font-size' => 9); $pdf->Ln(1); $pdf->DrawTable($table, null, 0, 0, 3); } if ($this->delivery_description && $this->delivery_description != '') { $table = array(); $table [0][] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_DELIVERY'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9); $table [0][] = array('width' => 70, 'value' => $this->delivery_description, 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => '', 'font-size' => 9); $pdf->Ln(1); $pdf->DrawTable($table, null, 0, 0, 3); } //check delivery address $q = " select shipping_address_street, shipping_address_city, shipping_address_postalcode, shipping_address_state, shipping_address_country from accounts where (shipping_address_street!=billing_address_street OR shipping_address_city!=billing_address_city OR shipping_address_postalcode!=billing_address_postalcode OR shipping_address_state!=billing_address_state OR shipping_address_country!=billing_address_country) AND id='" . $this->parent_id . "'; "; $res = $GLOBALS['db']->query($q); if (mysql_num_rows($res) > 0) { $r = $GLOBALS['db']->fetchByAssoc($res); $table = array(); $table [0][] = array('width' => 30, 'value' => $mod_strings['LBL_PDF_SHIP_TO'], 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => 'b', 'font-size' => 9); $table [0][] = array('width' => 100, 'value' => html_entity_decode($r['shipping_address_street']) . ', ' . html_entity_decode($r['shipping_address_postalcode']) . ' ' . html_entity_decode($r['shipping_address_city']), 'border' => 0, 'overflow' => 1, 'align' => 'L', 'font-style' => '', 'font-size' => 9); $pdf->Ln(1); $pdf->DrawTable($table, null, 0, 0, 3); } //echo '
'. var_export($this->currency_symbol, true); exit;
/*
$pdf->SetX(10);
$pdf->SetFont('arialpl', 'b', 8);
$pdf->Cell(25, 4, 'Metoda płatności: ', 0, 0, 'L', 1);

global $app_list_strings;
$pdf->SetFont('arialpl', '', 8);
//echo '
' . var_export($this->payment_method, true);
//echo '
' . var_export($app_list_strings['payment_method_dom'], true);exit;
if($this->payment_method != '' && $this->payment_method != 'INNY') {
    $pdf->Cell(50, 4, $app_list_strings['payment_method_dom'][$this->payment_method] . ($this->payment_deadline ? (', ' . $this->payment_deadline . ' dni') : '') , 0, 0, 'L', 1);
} else {
    $pdf->Cell(50, 4, $this->payment_description, 0, 0, 'L', 1);
}
$pdf->Ln(4);
*/   
if ($this->footer_text != '') {
    //footer text
    $pdf->Ln(4);
    
    $pdf->SetFont('arialpl', '', '8');
    $pdf->MultiCell(0, 4, $this->footer_text, 0, 'J');
}

//payment conditions
$pdf->SetFont('arialpl', 'B', '8');

/*
  // if($this->payment_method)$pm.=$mod_strings['LBL_PDF_PAYMENT_METHOD'].$GLOBALS['app_list_strings']['payment_method_dom'][$this->payment_method]." ";
  // if($this->payment_deadline)$pm.=$mod_strings['LBL_PDF_PAYMENT_DEADLINE'].$this->payment_deadline.$mod_strings['LBL_PDF_PAYMENT_DEADLINE2']." ";
  $pm.="\n";
  //  if($this->payment_description)$pm.=$mod_strings['LBL_PDF_PAYMENT_DESCRIPTION'].$this->payment_description." ";
  if($pm){
  $pdf->Ln();
  $pdf->MultiCell(0,4,$pm,0,'L');
  }
  if($this->validtill_date){
  $pdf->Ln();
  $pdf->MultiCell(0,4,$mod_strings['LBL_PDF_VALIDTILL_DATE'].": ".$this->validtill_date,0,'L');

  }
 */
if ($this->ads_text != '') {
    //ads text
    $pdf->Ln(4);
    
    $pdf->SetFont('arialpl', '', '8');
    $pdf->MultiCell(0, 4, $this->ads_text, 0, 'J');
}
/*


  if($this->show_primary_params){
  $pdf->AddPage();
  $pdf->SetFont('arialpl','B','14');
  $pdf->MultiCell(0,8,$mod_strings['LBL_PDF_PARAMS_HEADER'],0,'J');
  $pdf->Ln(6);
  $tab_header = array(
  'name' => array(
  'width' => 44,
  'value' => $mod_strings['LBL_PDF_PARAMS_HEADER_NAME'],
  'background' => array(233,233,233),
  'border' => 0,
  'overflow' => 1,
  'align' => 'L',
  'font-size' => 7,
  'font-style' => 'b'
  ),
  'symbol' => array(
  'width' => 30,
  'value' => $mod_strings['LBL_PDF_PARAMS_HEADER_SYMBOL'],
  'background' => array(233,233,233),
  'border' => 0,
  'overflow' => 1,
  'align' => 'C',
  'font-size' => 7,
  'font-style' => 'b'
  ),
  'value' => array(
  'width' => 12,
  'value' => $mod_strings['LBL_PDF_PARAMS_HEADER_VALUE'],
  'background' => array(233,233,233),
  'border' => 0,
  'overflow' => 1,
  'align' => 'C',
  'font-size' => 7,
  'font-style' => 'b'
  ),
  'unit' => array(
  'width' => 12,
  'value' => $mod_strings['LBL_PDF_PARAMS_HEADER_UNIT'],
  'background' => array(233,233,233),
  'border' => 0,
  'overflow' => 1,
  'align' => 'C',
  'font-size' => 7,
  'font-style' => 'b'
  ),
  );
  $i=0;
  foreach($this->position_list as $p) {
  $i++;
  $pdf->SetFont('arialpl','B','11');



  $lv=return_app_list_strings_language($this->ecmlanguage);

  $tablen = array();
  $tablen [0]['position'] = array('width' => 5, 'value' => $mod_strings['LBL_PDF_LIST_POSITION'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');
  $tablen [0]['description'] = array('width' => 95, 'value' => $mod_strings['LBL_PDF_LIST_DESCRIPTION'], 'background' => array(233,233,233), 'border' => 0, 'overflow' => 1, 'align' => 'C');

  $tablen [1]['position'] = array('width' => 5, 'value' => $i, 'border' => 0, 'align' => 'C' );
  $tablen [1]['description'] = array('width' => 95, 'value' => htmlspecialchars_decode($p['name']), 'border' => 0, 'align' => 'L' );







  //$pdf->SetFont('arialpl','B','9');
  $pdf->SetFont('arialgr','','8');
  //$pdf->Ln();
  $table = array();
  $table_advanced = array();
  $table[]=$tab_header;
  $table_advanced[]=$tab_header;
  $w_p=$GLOBALS['db']->query("select * from ecmquoteitemsparams where ecmquote_id='".$this->id."' and item_id='".$p['iid']."' and deleted='0' order by position asc");
  $pom=0;
  while($r_p=$GLOBALS['db']->fetchByAssoc($w_p)){
  $pom=1;
  $tab_item=array(
  'name' => array(
  'width' => 44,
  'value' => $r_p['name'],
  'background' => array(255,255,255),
  'border' => 0,
  'overflow' => 1,
  'align' => 'L',
  'font-size' => 7,
  'font-style' => ''
  ),
  'symbol' => array(
  'width' => 30,
  'value' => $r_p['symbol'],
  'background' => array(255,255,255),
  'border' => 0,
  'overflow' => 1,
  'align' => 'C',
  'font-size' => 7,
  'font-style' => ''
  ),
  'value' => array(
  'width' => 12,
  'value' => $r_p['value'],
  'background' => array(255,255,255),
  'border' => 0,
  'overflow' => 1,
  'align' => 'C',
  'font-size' => 7,
  'font-style' => ''
  ),
  'unit' => array(
  'width' => 12,
  'value' => $r_p['unit'],
  'background' => array(255,255,255),
  'border' => 0,
  'overflow' => 1,
  'align' => 'C',
  'font-size' => 7,
  'font-style' => ''
  ),
  );

  if ($r_p['value']!='') {
  if($r_p['type']=="P" || $r_p['type']==""){
  $table[]=$tab_item;
  $table_advanced[]=$tab_item;
  }
  else $table_advanced[]=$tab_item;
  }
  }
  if($pom){
  $pdf->DrawTable($tablen);
  if(!$this->show_advanced_params)$pdf->DrawTable($table);
  if($this->show_advanced_params){
  $pdf->SetFont('arialpl','B','9');
  $pdf->DrawTable($table_advanced);
  }
  $pdf->Ln(10);
  }
  }


  }

 */