diff --git a/htdocs/core/modules/expedition/modules_expedition.php b/htdocs/core/modules/expedition/modules_expedition.php index ceddd5064e1..f225367defa 100644 --- a/htdocs/core/modules/expedition/modules_expedition.php +++ b/htdocs/core/modules/expedition/modules_expedition.php @@ -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; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index d86061949dd..ce9885c1f1a 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -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 diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 5afbb78d241..9cda78f59fe 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -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);