Skip to content

Commit

Permalink
FIX: incoterms do not output into crabe invoice PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
atm-florian committed Jul 28, 2016
1 parent 0e79cae commit c13c151
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions htdocs/core/modules/facture/doc/pdf_crabe.modules.php
Expand Up @@ -167,7 +167,7 @@ function __construct($db)
function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
{
global $user,$langs,$conf,$mysoc,$db,$hookmanager;

if (! is_object($outputlangs)) $outputlangs=$langs;
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
Expand Down Expand Up @@ -252,7 +252,7 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid

// Set nblignes with the new facture lines content after hook
$nblignes = count($object->lines);

// Create pdf instance
$pdf=pdf_getInstance($this->format);
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
Expand Down Expand Up @@ -337,6 +337,10 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
$height_incoterms = 0;
if ($conf->incoterm->enabled)
{
if (is_object($object->thirdparty))
{
$object->fk_incoterms=$object->thirdparty->fk_incoterms;
}
$desc_incoterms = $object->getIncotermsForPDF();
if ($desc_incoterms)
{
Expand Down Expand Up @@ -550,7 +554,7 @@ function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hid
} else {
$tvaligne = $sign * $object->lines[$i]->total_tva;
}

$localtax1ligne=$object->lines[$i]->total_localtax1;
$localtax2ligne=$object->lines[$i]->total_localtax2;
$localtax1_rate=$object->lines[$i]->localtax1_tx;
Expand Down Expand Up @@ -1557,7 +1561,7 @@ function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
$posy=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42;
$posx=$this->marge_gauche;
if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80;

$hautcadre=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 38 : 40;
$widthrecbox=!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 82;

Expand Down

0 comments on commit c13c151

Please sign in to comment.