Fix: pdf_getPDFFontSize must be after pdf_getInstance
Conflicts: htdocs/core/modules/commande/doc/pdf_einstein.modules.php
This commit is contained in:
parent
8f3f28c28f
commit
c9ee9c7a38
@ -119,6 +119,8 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$this->tva=array();
|
$this->tva=array();
|
||||||
$this->localtax1=array();
|
$this->localtax1=array();
|
||||||
$this->localtax2=array();
|
$this->localtax2=array();
|
||||||
|
$this->localtax1_type=array();
|
||||||
|
$this->localtax2_type=array();
|
||||||
$this->atleastoneratenotnull=0;
|
$this->atleastoneratenotnull=0;
|
||||||
$this->atleastonediscount=0;
|
$this->atleastonediscount=0;
|
||||||
}
|
}
|
||||||
@ -150,8 +152,6 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$outputlangs->load("products");
|
$outputlangs->load("products");
|
||||||
$outputlangs->load("orders");
|
$outputlangs->load("orders");
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
|
||||||
|
|
||||||
if ($conf->commande->dir_output)
|
if ($conf->commande->dir_output)
|
||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
@ -186,7 +186,8 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
|
|
||||||
// Create pdf instance
|
// Create pdf instance
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||||
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
@ -370,9 +371,9 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
|
if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
|
||||||
|
|
||||||
$vatrate=(string) $object->lines[$i]->tva_tx;
|
$vatrate=(string) $object->lines[$i]->tva_tx;
|
||||||
$localtax1rate=(string) $object->lines[$i]->localtax1_tx;
|
$localtax1rate=(string) $object->lines[$i]->localtax1_tx;
|
||||||
$localtax2rate=(string) $object->lines[$i]->localtax2_tx;
|
$localtax2rate=(string) $object->lines[$i]->localtax2_tx;
|
||||||
|
|
||||||
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
|
||||||
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
|
if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
|
||||||
if (! isset($this->localtax1[$localtax1rate])) $this->localtax1[$localtax1rate]='';
|
if (! isset($this->localtax1[$localtax1rate])) $this->localtax1[$localtax1rate]='';
|
||||||
@ -380,7 +381,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$this->tva[$vatrate] += $tvaligne;
|
$this->tva[$vatrate] += $tvaligne;
|
||||||
$this->localtax1[$localtax1rate]+=$localtax1ligne;
|
$this->localtax1[$localtax1rate]+=$localtax1ligne;
|
||||||
$this->localtax2[$localtax2rate]+=$localtax2ligne;
|
$this->localtax2[$localtax2rate]+=$localtax2ligne;
|
||||||
|
|
||||||
$nexY+=2; // Passe espace entre les lignes
|
$nexY+=2; // Passe espace entre les lignes
|
||||||
|
|
||||||
// Detect if some page were added automatically and output _tableau for past pages
|
// Detect if some page were added automatically and output _tableau for past pages
|
||||||
@ -692,7 +693,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach($this->tva as $tvakey => $tvaval)
|
foreach($this->tva as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey > 0) // On affiche pas taux 0
|
if ($tvakey > 0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
|
|||||||
@ -84,7 +84,6 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
function write_file(&$object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
|
function write_file(&$object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
global $user,$conf,$langs,$mysoc;
|
global $user,$conf,$langs,$mysoc;
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
|
||||||
|
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
@ -147,6 +146,7 @@ class pdf_expedition_merou extends ModelePdfExpedition
|
|||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
|
|
||||||
$pdf=pdf_getInstance($this->format,'mm','l');
|
$pdf=pdf_getInstance($this->format,'mm','l');
|
||||||
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
$heightforinfotot = 0; // Height reserved to output the info and total part
|
$heightforinfotot = 0; // Height reserved to output the info and total part
|
||||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
|
|||||||
@ -87,7 +87,6 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
function write_file(&$object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
|
function write_file(&$object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0,$hookmanager=false)
|
||||||
{
|
{
|
||||||
global $user,$conf,$langs;
|
global $user,$conf,$langs;
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
|
||||||
|
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
@ -133,7 +132,8 @@ class pdf_expedition_rouget extends ModelePdfExpedition
|
|||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
$heightforinfotot = 0; // Height reserved to output the info and total part
|
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||||
|
$heightforinfotot = 0; // Height reserved to output the info and total part
|
||||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
$pdf->SetAutoPageBreak(1,0);
|
$pdf->SetAutoPageBreak(1,0);
|
||||||
|
|||||||
@ -150,8 +150,6 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$outputlangs->load("bills");
|
$outputlangs->load("bills");
|
||||||
$outputlangs->load("products");
|
$outputlangs->load("products");
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
|
||||||
|
|
||||||
if ($conf->facture->dir_output)
|
if ($conf->facture->dir_output)
|
||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
@ -186,6 +184,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
|
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
@ -197,6 +196,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->setPrintFooter(false);
|
$pdf->setPrintFooter(false);
|
||||||
}
|
}
|
||||||
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
$pdf->SetFont(pdf_getPDFFont($outputlangs));
|
||||||
|
|
||||||
// Set path to the background PDF File
|
// Set path to the background PDF File
|
||||||
if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
|
if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -117,8 +117,6 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
$outputlangs->load("companies");
|
$outputlangs->load("companies");
|
||||||
$outputlangs->load("interventions");
|
$outputlangs->load("interventions");
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
|
||||||
|
|
||||||
if ($conf->ficheinter->dir_output)
|
if ($conf->ficheinter->dir_output)
|
||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
@ -140,6 +138,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||||||
if (file_exists($dir))
|
if (file_exists($dir))
|
||||||
{
|
{
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
|
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:25); // Height reserved to output the free text on last page
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:25); // Height reserved to output the free text on last page
|
||||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
|
|||||||
@ -113,7 +113,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
function write_file($object,$outputlangs)
|
function write_file($object,$outputlangs)
|
||||||
{
|
{
|
||||||
global $user,$langs,$conf;
|
global $user,$langs,$conf;
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
|
||||||
|
|
||||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
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
|
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
|
||||||
@ -150,6 +149,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
|
|||||||
if (file_exists($dir))
|
if (file_exists($dir))
|
||||||
{
|
{
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
|
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
|
|||||||
@ -108,8 +108,6 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
{
|
{
|
||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontsize($outputlangs);
|
|
||||||
|
|
||||||
$objectref = dol_sanitizeFileName($object->ref);
|
$objectref = dol_sanitizeFileName($object->ref);
|
||||||
$dir = $conf->projet->dir_output;
|
$dir = $conf->projet->dir_output;
|
||||||
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
|
if (! preg_match('/specimen/i',$objectref)) $dir.= "/" . $objectref;
|
||||||
@ -127,6 +125,7 @@ class pdf_baleine extends ModelePDFProjects
|
|||||||
if (file_exists($dir))
|
if (file_exists($dir))
|
||||||
{
|
{
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
|
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
|
|||||||
@ -149,8 +149,6 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$outputlangs->load("propal");
|
$outputlangs->load("propal");
|
||||||
$outputlangs->load("products");
|
$outputlangs->load("products");
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
|
||||||
|
|
||||||
if ($conf->propal->dir_output)
|
if ($conf->propal->dir_output)
|
||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
@ -185,6 +183,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
|
|
||||||
// Create pdf instance
|
// Create pdf instance
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
|
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
|
|||||||
@ -146,8 +146,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$outputlangs->load("bills");
|
$outputlangs->load("bills");
|
||||||
$outputlangs->load("products");
|
$outputlangs->load("products");
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
|
||||||
|
|
||||||
if ($conf->fournisseur->dir_output.'/facture')
|
if ($conf->fournisseur->dir_output.'/facture')
|
||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
@ -184,6 +182,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
|
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
|
|||||||
@ -156,8 +156,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$outputlangs->load("products");
|
$outputlangs->load("products");
|
||||||
$outputlangs->load("orders");
|
$outputlangs->load("orders");
|
||||||
|
|
||||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
|
||||||
|
|
||||||
if ($conf->fournisseur->dir_output.'/commande')
|
if ($conf->fournisseur->dir_output.'/commande')
|
||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
@ -196,6 +194,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
$nblignes = count($object->lines);
|
$nblignes = count($object->lines);
|
||||||
|
|
||||||
$pdf=pdf_getInstance($this->format);
|
$pdf=pdf_getInstance($this->format);
|
||||||
|
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||||
$heightforinfotot = 50; // Height reserved to output the info and total part
|
$heightforinfotot = 50; // Height reserved to output the info and total part
|
||||||
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
|
||||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user