Merge pull request #2778 from atm-maxime/3.6

Fix : shipment PDF was not using generation params
This commit is contained in:
Juanjo Menent 2015-05-06 21:00:49 +02:00
commit 5d65d666f7
3 changed files with 15 additions and 10 deletions

View File

@ -141,15 +141,18 @@ abstract class ModelNumRefExpedition
}
/**
* Cree un bon d'expedition sur disque
* Cree un bon d'expedition sur disque
*
* @param DoliDB $db Objet base de donnee
* @param Object $object Object expedition
* @param string $modele Force le modele a utiliser ('' to not force)
* @param Translate $outputlangs Objet lang a utiliser pour traduction
* @return int <=0 if KO, >0 if OK
* @param DoliDB $db Objet base de donnee
* @param Object $object Object expedition
* @param string $modele Force le modele a utiliser ('' to not force)
* @param Translate $outputlangs Objet lang a utiliser pour traduction
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @return int <=0 if KO, >0 if OK
*/
function expedition_pdf_create($db, $object, $modele, $outputlangs)
function expedition_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{
global $conf,$user,$langs;
@ -214,7 +217,7 @@ function expedition_pdf_create($db, $object, $modele, $outputlangs)
// We save charset_output to restore it because write_file can change it if needed for
// output format that does not support UTF8.
$sav_charset_output=$outputlangs->charset_output;
if ($obj->write_file($object, $outputlangs, $srctemplatepath) > 0)
if ($obj->write_file($object, $outputlangs, $srctemplatepath, $hidedetails, $hidedesc, $hideref) > 0)
{
$outputlangs->charset_output=$sav_charset_output;

View File

@ -1540,6 +1540,8 @@ class Expedition extends CommonObject
if ($this->db->query($sql) )
{
//TODO: Option to set order billed if 100% of order is shipped
$this->billed=1;
$this->db->commit();
return 1;
}
else

View File

@ -255,7 +255,7 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
$ret=$object->fetch($id); // Reload to get new records
$result=expedition_pdf_create($db,$object,$object->modelpdf,$outputlangs);
$result=expedition_pdf_create($db,$object,$object->modelpdf,$outputlangs, $hidedetails, $hidedesc, $hideref);
}
if ($result < 0)
{
@ -355,7 +355,7 @@ if (empty($reshook)) {
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
$result=expedition_pdf_create($db,$object,$object->modelpdf,$outputlangs);
$result=expedition_pdf_create($db,$object,$object->modelpdf,$outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result <= 0)
{
dol_print_error($db,$result);