diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index 295139e4619..2c0a8db75fd 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -197,16 +197,16 @@ class pdf_typhon extends ModelePDFDeliveryOrder $tplidx = $pdf->importPage(1); } - // Complete object by loading several other informations + // We get the shipment that is the origin of delivery receipt $expedition=new Expedition($this->db); - $result = $expedition->fetch($object->expedition_id); - + $result = $expedition->fetch($object->origin_id); + // Now we get the order that is origin of shipment $commande = new Commande($this->db); if ($expedition->origin == 'commande') { $commande->fetch($expedition->origin_id); } - $object->commande=$commande; + $object->commande=$commande; // We set order of shipment onto delivery. $pdf->Open(); diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 57f00161f8a..c947a98dd11 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -54,8 +54,6 @@ class Livraison extends CommonObject var $note_public; var $note_private; - var $expedition_id; - var $date_delivery; // Date really received var $date_creation; var $date_valid; diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php index 425b5ab20f0..32c5c474ba1 100644 --- a/htdocs/livraison/fiche.php +++ b/htdocs/livraison/fiche.php @@ -185,7 +185,7 @@ if ($action == 'builddoc') // En get ou en post $object = new Livraison($db); $object->fetch($id); $object->fetch_thirdparty(); - + // Save last template used to generate document if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));