Fix: Libraries not used inside a web container must not use a GETPOST function.

This commit is contained in:
Laurent Destailleur 2011-04-13 13:33:02 +00:00
parent 519fd1abee
commit a8a9a4c283
9 changed files with 119 additions and 87 deletions

View File

@ -140,13 +140,16 @@ class ModeleNumRefCommandes
* @param object object order * @param object object order
* @param modele force le modele a utiliser ('' to not force) * @param modele force le modele a utiliser ('' to not force)
* @param outputlangs objet lang a utiliser pour traduction * @param outputlangs objet lang a utiliser pour traduction
* @param hidedetails Hide details of lines
* @param hidedesc Hide description
*/ */
function commande_pdf_create($db, $object, $modele, $outputlangs) function commande_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0)
{ {
global $conf,$langs; global $conf,$langs;
$langs->load("orders"); $langs->load("orders");
$dir = DOL_DOCUMENT_ROOT."/includes/modules/commande/"; $dir = DOL_DOCUMENT_ROOT."/includes/modules/commande/";
$srctemplatepath='';
$modelisok=0; $modelisok=0;
$liste=array(); $liste=array();
@ -183,7 +186,7 @@ function commande_pdf_create($db, $object, $modele, $outputlangs)
// We save charset_output to restore it because write_file can change it if needed for // We save charset_output to restore it because write_file can change it if needed for
// output format that does not support UTF8. // output format that does not support UTF8.
$sav_charset_output=$outputlangs->charset_output; $sav_charset_output=$outputlangs->charset_output;
if ($obj->write_file($object, $outputlangs) > 0) if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc) > 0)
{ {
$outputlangs->charset_output=$sav_charset_output; $outputlangs->charset_output=$sav_charset_output;
// on supprime l'image correspondant au preview // on supprime l'image correspondant au preview
@ -193,7 +196,7 @@ function commande_pdf_create($db, $object, $modele, $outputlangs)
else else
{ {
$outputlangs->charset_output=$sav_charset_output; $outputlangs->charset_output=$sav_charset_output;
dol_syslog("Erreur dans commande_pdf_create"); dol_syslog("Error");
dol_print_error($db,$obj->error); dol_print_error($db,$obj->error);
return 0; return 0;
} }

View File

@ -87,12 +87,16 @@ class pdf_edison extends ModelePDFCommandes
/** /**
* \brief Fonction generant la commande sur le disque * Function to build pdf onto disk
* \param com id de la propale a generer * @param object Id of object to generate
* \param outputlangs Lang output object * @param outputlangs Lang output object
* \return int 1=ok, 0=ko * @param srctemplatepath Full path of source filename for generator using a template file
* @param hidedetails Do not show line details
* @param hidedesc Do not show desc
* @param hideref Do not show ref
* @return int 1=OK, 0=KO
*/ */
function write_file($object,$outputlangs) function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
{ {
global $user,$conf,$langs,$mysoc; global $user,$conf,$langs,$mysoc;
@ -203,7 +207,7 @@ class pdf_edison extends ModelePDFCommandes
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page $pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
// Description de la ligne produit // Description de la ligne produit
pdf_writelinedesc($pdf,$object,$i,$outputlangs,100,3,30,$curY,1,GETPOST('hidedesc')); pdf_writelinedesc($pdf,$object,$i,$outputlangs,100,3,30,$curY,1,$hidedesc);
//$pdf->writeHTMLCell(100, 3, 30, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1); //$pdf->writeHTMLCell(100, 3, 30, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
@ -213,19 +217,19 @@ class pdf_edison extends ModelePDFCommandes
$pdf->SetXY (10, $curY); $pdf->SetXY (10, $curY);
$pdf->MultiCell(20, 3, $ref, 0, 'C'); $pdf->MultiCell(20, 3, $ref, 0, 'C');
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, GETPOST('hidedetails')); $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY (133, $curY); $pdf->SetXY (133, $curY);
$pdf->MultiCell(12, 3, $vat_rate, 0, 'C'); $pdf->MultiCell(12, 3, $vat_rate, 0, 'C');
$qty = pdf_getlineqty($object, $i, $outputlangs, GETPOST('hidedetails')); $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY (145, $curY); $pdf->SetXY (145, $curY);
$pdf->MultiCell(10, 3, $qty, 0, 'C'); $pdf->MultiCell(10, 3, $qty, 0, 'C');
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, GETPOST('hidedetails')); $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY (156, $curY); $pdf->SetXY (156, $curY);
$pdf->MultiCell(18, 3, $up_excl_tax, 0, 'R', 0); $pdf->MultiCell(18, 3, $up_excl_tax, 0, 'R', 0);
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, GETPOST('hidedetails')); $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY (174, $curY); $pdf->SetXY (174, $curY);
$pdf->MultiCell(26, 3, $total_excl_tax, 0, 'R', 0); $pdf->MultiCell(26, 3, $total_excl_tax, 0, 'R', 0);

View File

@ -102,12 +102,16 @@ class pdf_einstein extends ModelePDFCommandes
} }
/** /**
* \brief Fonction generant la commande sur le disque * Function to build pdf onto disk
* \param object Objet commande a generer * @param object Id of object to generate
* \param outputlangs Lang object for output language * @param outputlangs Lang output object
* \return int 1=ok, 0=ko * @param srctemplatepath Full path of source filename for generator using a template file
* @param hidedetails Do not show line details
* @param hidedesc Do not show desc
* @param hideref Do not show ref
* @return int 1=OK, 0=KO
*/ */
function write_file($object,$outputlangs) function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
{ {
global $user,$langs,$conf; global $user,$langs,$conf;
$default_font_size = pdf_getPDFFontSize($outputlangs); $default_font_size = pdf_getPDFFontSize($outputlangs);
@ -251,7 +255,7 @@ class pdf_einstein extends ModelePDFCommandes
// Description of product line // Description of product line
$curX = $this->posxdesc-1; $curX = $this->posxdesc-1;
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,GETPOST('hideref'),GETPOST('hidedesc')); pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc);
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
@ -259,18 +263,18 @@ class pdf_einstein extends ModelePDFCommandes
// TVA // TVA
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{ {
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, GETPOST('hidedetails')); $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY ($this->posxtva, $curY); $pdf->SetXY ($this->posxtva, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva-1, 3, $vat_rate, 0, 'R'); $pdf->MultiCell($this->posxup-$this->posxtva-1, 3, $vat_rate, 0, 'R');
} }
// Prix unitaire HT avant remise // Prix unitaire HT avant remise
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, GETPOST('hidedetails')); $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY ($this->posxup, $curY); $pdf->SetXY ($this->posxup, $curY);
$pdf->MultiCell($this->posxqty-$this->posxup-1, 3, $up_excl_tax, 0, 'R', 0); $pdf->MultiCell($this->posxqty-$this->posxup-1, 3, $up_excl_tax, 0, 'R', 0);
// Quantity // Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, GETPOST('hidedetails')); $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY ($this->posxqty, $curY); $pdf->SetXY ($this->posxqty, $curY);
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 3, $qty, 0, 'R'); $pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 3, $qty, 0, 'R');
@ -278,12 +282,12 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetXY ($this->posxdiscount, $curY); $pdf->SetXY ($this->posxdiscount, $curY);
if ($object->lines[$i]->remise_percent) if ($object->lines[$i]->remise_percent)
{ {
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, GETPOST('hidedetails')); $remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 3, $remise_percent, 0, 'R'); $pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 3, $remise_percent, 0, 'R');
} }
// Total HT ligne // Total HT ligne
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, GETPOST('hidedetails')); $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY ($this->postotalht, $curY); $pdf->SetXY ($this->postotalht, $curY);
$pdf->MultiCell(26, 3, $total_excl_tax, 0, 'R', 0); $pdf->MultiCell(26, 3, $total_excl_tax, 0, 'R', 0);

View File

@ -104,12 +104,16 @@ class pdf_crabe extends ModelePDFFactures
/** /**
* Write the object to document file to disk * Function to build pdf onto disk
* @param object Object invoice to build (or id if old method) * @param object Id of object to generate
* @param outputlangs Lang object for output language * @param outputlangs Lang output object
* @param srctemplatepath Full path of source filename for generator using a template file
* @param hidedetails Do not show line details
* @param hidedesc Do not show desc
* @param hideref Do not show ref
* @return int 1=OK, 0=KO * @return int 1=OK, 0=KO
*/ */
function write_file($object,$outputlangs) function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
{ {
global $user,$langs,$conf; global $user,$langs,$conf;
@ -258,7 +262,7 @@ class pdf_crabe extends ModelePDFFactures
// Description of product line // Description of product line
$pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
$curX = $this->posxdesc-1; $curX = $this->posxdesc-1;
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,GETPOST('hideref'),GETPOST('hidedesc')); pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc);
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
@ -266,18 +270,18 @@ class pdf_crabe extends ModelePDFFactures
// VAT Rate // VAT Rate
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{ {
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, GETPOST('hidedetails')); $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY ($this->posxtva, $curY); $pdf->SetXY ($this->posxtva, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva-1, 3, $vat_rate, 0, 'R'); $pdf->MultiCell($this->posxup-$this->posxtva-1, 3, $vat_rate, 0, 'R');
} }
// Prix unitaire HT avant remise // Prix unitaire HT avant remise
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, GETPOST('hidedetails')); $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY ($this->posxup, $curY); $pdf->SetXY ($this->posxup, $curY);
$pdf->MultiCell($this->posxqty-$this->posxup-1, 3, $up_excl_tax, 0, 'R', 0); $pdf->MultiCell($this->posxqty-$this->posxup-1, 3, $up_excl_tax, 0, 'R', 0);
// Quantity // Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, GETPOST('hidedetails')); $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY ($this->posxqty, $curY); $pdf->SetXY ($this->posxqty, $curY);
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 3, $qty, 0, 'R'); // Enough for 6 chars $pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 3, $qty, 0, 'R'); // Enough for 6 chars
@ -285,12 +289,12 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY ($this->posxdiscount, $curY); $pdf->SetXY ($this->posxdiscount, $curY);
if ($object->lines[$i]->remise_percent) if ($object->lines[$i]->remise_percent)
{ {
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, GETPOST('hidedetails')); $remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 3, $remise_percent, 0, 'R'); $pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 3, $remise_percent, 0, 'R');
} }
// Total HT ligne // Total HT ligne
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, GETPOST('hidedetails')); $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY ($this->postotalht, $curY); $pdf->SetXY ($this->postotalht, $curY);
$pdf->MultiCell(26, 3, $total_excl_tax, 0, 'R', 0); $pdf->MultiCell(26, 3, $total_excl_tax, 0, 'R', 0);

View File

@ -102,12 +102,16 @@ class pdf_oursin extends ModelePDFFactures
/** /**
* \brief Fonction generant la facture sur le disque * Function to build pdf onto disk
* \param fac Objet invoice to build (or id if old method) * @param object Id of object to generate
* \param outputlangs Lang object for output language * @param outputlangs Lang output object
* \return int 1=ok, 0=ko * @param srctemplatepath Full path of source filename for generator using a template file
* @param hidedetails Do not show line details
* @param hidedesc Do not show desc
* @param hideref Do not show ref
* @return int 1=OK, 0=KO
*/ */
function write_file($object,$outputlangs) function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
{ {
global $user,$langs,$conf; global $user,$langs,$conf;
@ -219,7 +223,7 @@ class pdf_oursin extends ModelePDFFactures
$curY = $nexY; $curY = $nexY;
// Description of product line // Description of product line
pdf_writelinedesc($pdf,$object,$i,$outputlangs,108,3,$this->posxdesc-1,$curY+1,GETPOST('hideref'),GETPOST('hidedesc')); pdf_writelinedesc($pdf,$object,$i,$outputlangs,108,3,$this->posxdesc-1,$curY+1,$hideref,$hidedesc);
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
@ -228,31 +232,31 @@ class pdf_oursin extends ModelePDFFactures
{ {
if ($this->franchise!=1) if ($this->franchise!=1)
{ {
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, GETPOST('hidedetails')); $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY ($this->marges['g']+118, $curY); $pdf->SetXY ($this->marges['g']+118, $curY);
$pdf->MultiCell(12, 3, $vat_rate, 0, 'R'); $pdf->MultiCell(12, 3, $vat_rate, 0, 'R');
} }
} }
// Prix unitaire HT avant remise // Prix unitaire HT avant remise
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, GETPOST('hidedetails')); $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY ($this->marges['g']+132, $curY); $pdf->SetXY ($this->marges['g']+132, $curY);
$pdf->MultiCell(16, 3, $up_excl_tax, 0, 'R', 0); $pdf->MultiCell(16, 3, $up_excl_tax, 0, 'R', 0);
// Quantity // Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, GETPOST('hidedetails')); $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY ($this->marges['g']+150, $curY); $pdf->SetXY ($this->marges['g']+150, $curY);
$pdf->MultiCell(10, 3, $qty, 0, 'R'); $pdf->MultiCell(10, 3, $qty, 0, 'R');
// Remise sur ligne // Remise sur ligne
$pdf->SetXY ($this->marges['g']+160, $curY); $pdf->SetXY ($this->marges['g']+160, $curY);
if ($object->lines[$i]->remise_percent) { if ($object->lines[$i]->remise_percent) {
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, GETPOST('hidedetails')); $remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
$pdf->MultiCell(14, 3, $remise_percent, 0, 'R'); $pdf->MultiCell(14, 3, $remise_percent, 0, 'R');
} }
// Total HT // Total HT
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, GETPOST('hidedetails')); $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY ($this->marges['g']+168, $curY); $pdf->SetXY ($this->marges['g']+168, $curY);
$pdf->MultiCell(21, 3, $total_excl_tax, 0, 'R', 0); $pdf->MultiCell(21, 3, $total_excl_tax, 0, 'R', 0);

View File

@ -140,9 +140,11 @@ class ModeleNumRefFactures
* @param message message * @param message message
* @param modele force le modele a utiliser ('' to not force) * @param modele force le modele a utiliser ('' to not force)
* @param outputlangs objet lang a utiliser pour traduction * @param outputlangs objet lang a utiliser pour traduction
* @param hidedetails Hide details of lines
* @param hidedesc Hide description
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function facture_pdf_create($db, $object, $message, $modele, $outputlangs) function facture_pdf_create($db, $object, $message, $modele, $outputlangs, $hidedetails=0, $hidedesc=0)
{ {
global $conf,$langs; global $conf,$langs;
$langs->load("bills"); $langs->load("bills");
@ -204,7 +206,7 @@ function facture_pdf_create($db, $object, $message, $modele, $outputlangs)
// We save charset_output to restore it because write_file can change it if needed for // We save charset_output to restore it because write_file can change it if needed for
// output format that does not support UTF8. // output format that does not support UTF8.
$sav_charset_output=$outputlangs->charset_output; $sav_charset_output=$outputlangs->charset_output;
if ($obj->write_file($object, $outputlangs, $srctemplatepath) > 0) if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc) > 0)
{ {
// Success in building document. We build meta file. // Success in building document. We build meta file.
facture_meta_create($db, $object->id); facture_meta_create($db, $object->id);

View File

@ -136,14 +136,17 @@ class ModeleNumRefPropales
* @param id id de la propale a creer * @param id id de la propale a creer
* @param modele force le modele a utiliser ('' to not force) * @param modele force le modele a utiliser ('' to not force)
* @param outputlangs objet lang a utiliser pour traduction * @param outputlangs objet lang a utiliser pour traduction
* @param hidedetails Hide details of lines
* @param hidedesc Hide description
* @return int 0 si KO, 1 si OK * @return int 0 si KO, 1 si OK
*/ */
function propale_pdf_create($db, $object, $modele, $outputlangs) function propale_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0)
{ {
global $langs; global $langs;
$langs->load("propale"); $langs->load("propale");
$dir = "/includes/modules/propale/"; $dir = "/includes/modules/propale/";
$srctemplatepath='';
$modelisok=0; $modelisok=0;
// Positionne modele sur le nom du modele de propale a utiliser // Positionne modele sur le nom du modele de propale a utiliser
@ -188,7 +191,7 @@ function propale_pdf_create($db, $object, $modele, $outputlangs)
// We save charset_output to restore it because write_file can change it if needed for // We save charset_output to restore it because write_file can change it if needed for
// output format that does not support UTF8. // output format that does not support UTF8.
$sav_charset_output=$outputlangs->charset_output; $sav_charset_output=$outputlangs->charset_output;
if ($obj->write_file($object, $outputlangs) > 0) if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc) > 0)
{ {
$outputlangs->charset_output=$sav_charset_output; $outputlangs->charset_output=$sav_charset_output;
// on supprime l'image correspondant au preview // on supprime l'image correspondant au preview

View File

@ -101,12 +101,16 @@ class pdf_propale_azur extends ModelePDFPropales
} }
/** /**
* \brief Fonction generant la propale sur le disque * Function to build pdf onto disk
* \param object Objet propal a generer (ou id si ancienne methode) * @param object Id of object to generate
* \param outputlangs Lang object for output language * @param outputlangs Lang output object
* \return int 1=ok, 0=ko * @param srctemplatepath Full path of source filename for generator using a template file
* @param hidedetails Do not show line details
* @param hidedesc Do not show desc
* @param hideref Do not show ref
* @return int 1=OK, 0=KO
*/ */
function write_file($object,$outputlangs) function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
{ {
global $user,$langs,$conf; global $user,$langs,$conf;
$default_font_size = pdf_getPDFFontSize($outputlangs); $default_font_size = pdf_getPDFFontSize($outputlangs);
@ -239,7 +243,7 @@ class pdf_propale_azur extends ModelePDFPropales
// Description de la ligne produit // Description de la ligne produit
$curX = $this->posxdesc-1; $curX = $this->posxdesc-1;
pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,GETPOST('hideref'),GETPOST('hidedesc')); pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc);
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
@ -247,18 +251,18 @@ class pdf_propale_azur extends ModelePDFPropales
// TVA // TVA
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
{ {
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, GETPOST('hidedetails')); $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY ($this->posxtva, $curY); $pdf->SetXY ($this->posxtva, $curY);
$pdf->MultiCell($this->posxup-$this->posxtva-1, 4, $vat_rate, 0, 'R'); $pdf->MultiCell($this->posxup-$this->posxtva-1, 4, $vat_rate, 0, 'R');
} }
// Prix unitaire HT avant remise // Prix unitaire HT avant remise
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, GETPOST('hidedetails')); $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY ($this->posxup, $curY); $pdf->SetXY ($this->posxup, $curY);
$pdf->MultiCell($this->posxqty-$this->posxup-1, 4, $up_excl_tax, 0, 'R', 0); $pdf->MultiCell($this->posxqty-$this->posxup-1, 4, $up_excl_tax, 0, 'R', 0);
// Quantity // Quantity
$qty = pdf_getlineqty($object, $i, $outputlangs, GETPOST('hidedetails')); $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY ($this->posxqty, $curY); $pdf->SetXY ($this->posxqty, $curY);
$pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 4, $qty, 0, 'R'); $pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 4, $qty, 0, 'R');
@ -266,12 +270,12 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->SetXY ($this->posxdiscount, $curY); $pdf->SetXY ($this->posxdiscount, $curY);
if ($object->lines[$i]->remise_percent) if ($object->lines[$i]->remise_percent)
{ {
$remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, GETPOST('hidedetails')); $remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
$pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 4, $remise_percent, 0, 'R'); $pdf->MultiCell($this->postotalht-$this->posxdiscount-1, 4, $remise_percent, 0, 'R');
} }
// Total HT ligne // Total HT ligne
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, GETPOST('hidedetails')); $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY ($this->postotalht, $curY); $pdf->SetXY ($this->postotalht, $curY);
$pdf->MultiCell(26, 4, $total_excl_tax, 0, 'R', 0); $pdf->MultiCell(26, 4, $total_excl_tax, 0, 'R', 0);

View File

@ -77,12 +77,16 @@ class pdf_propale_jaune extends ModelePDFPropales
/** /**
* \brief Fonction generant la propale sur le disque * Function to build pdf onto disk
* \param object Objet propal * @param object Id of object to generate
* \param outputlangs Lang object for output language * @param outputlangs Lang output object
* \return int 1=ok, 0=ko * @param srctemplatepath Full path of source filename for generator using a template file
* @param hidedetails Do not show line details
* @param hidedesc Do not show desc
* @param hideref Do not show ref
* @return int 1=OK, 0=KO
*/ */
function write_file($object,$outputlangs) function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
{ {
global $user,$langs,$conf; global $user,$langs,$conf;
$default_font_size = pdf_getPDFFontSize($outputlangs); $default_font_size = pdf_getPDFFontSize($outputlangs);
@ -192,7 +196,7 @@ class pdf_propale_jaune extends ModelePDFPropales
$pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page $pdf->SetFont('','', $default_font_size - 1); // Dans boucle pour gerer multi-page
// Description de la ligne produit // Description de la ligne produit
pdf_writelinedesc($pdf,$object,$i,$outputlangs,102,4,30,$curY,1,GETPOST('hidedesc')); pdf_writelinedesc($pdf,$object,$i,$outputlangs,102,4,30,$curY,1,$hidedesc);
$pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
@ -201,19 +205,19 @@ class pdf_propale_jaune extends ModelePDFPropales
$pdf->SetXY (10, $curY ); $pdf->SetXY (10, $curY );
$pdf->MultiCell(20, 4, $ref, 0, 'L', 0); $pdf->MultiCell(20, 4, $ref, 0, 'L', 0);
$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, GETPOST('hidedetails')); $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY (132, $curY ); $pdf->SetXY (132, $curY );
$pdf->MultiCell(12, 4, $vat_rate, 0, 'R'); $pdf->MultiCell(12, 4, $vat_rate, 0, 'R');
$qty = pdf_getlineqty($object, $i, $outputlangs, GETPOST('hidedetails')); $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY (144, $curY ); $pdf->SetXY (144, $curY );
$pdf->MultiCell(10, 4, $qty, 0, 'R', 0); $pdf->MultiCell(10, 4, $qty, 0, 'R', 0);
$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, GETPOST('hidedetails')); $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY (154, $curY ); $pdf->SetXY (154, $curY );
$pdf->MultiCell(22, 4, $up_excl_tax, 0, 'R', 0); $pdf->MultiCell(22, 4, $up_excl_tax, 0, 'R', 0);
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, GETPOST('hidedetails')); $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
$pdf->SetXY (176, $curY ); $pdf->SetXY (176, $curY );
$pdf->MultiCell(24, 4, $total_excl_tax, 0, 'R', 0); $pdf->MultiCell(24, 4, $total_excl_tax, 0, 'R', 0);