From 16c35035c1452dd325d13d2f85ce11bd5757c697 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Thu, 25 Oct 2018 12:07:40 +0200 Subject: [PATCH 1/2] FIX: pdf typhon: order reference duplicate --- .../livraison/doc/pdf_typhon.modules.php | 37 ------------------- 1 file changed, 37 deletions(-) diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php index 1f8e06eb04d..bbc74f3b6bb 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php @@ -754,43 +754,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder $posy+=2; - // Add list of linked orders on shipment - // Currently not supported by pdf_writeLinkedObjects, link for delivery to order is done through shipment) - if ($object->origin == 'expedition' || $object->origin == 'shipping') - { - $Yoff=$posy-5; - - include_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; - $shipment = new Expedition($this->db); - $shipment->fetch($object->origin_id); - - $origin = $shipment->origin; - $origin_id = $shipment->origin_id; - - if ($conf->$origin->enabled) - { - $outputlangs->load('orders'); - - $classname = ucfirst($origin); - $linkedobject = new $classname($this->db); - $result=$linkedobject->fetch($origin_id); - if ($result >= 0) - { - $pdf->SetFont('','', $default_font_size - 2); - $text=$linkedobject->ref; - if ($linkedobject->ref_client) $text.=' ('.$linkedobject->ref_client.')'; - $Yoff = $Yoff+8; - $pdf->SetXY($this->page_largeur - $this->marge_droite - 100,$Yoff); - $pdf->MultiCell(100, 2, $outputlangs->transnoentities("RefOrder") ." : ".$outputlangs->transnoentities($text), 0, 'R'); - $Yoff = $Yoff+3; - $pdf->SetXY($this->page_largeur - $this->marge_droite - 60,$Yoff); - $pdf->MultiCell(60, 2, $outputlangs->transnoentities("OrderDate")." : ".dol_print_date($linkedobject->date,"day",false,$outputlangs,true), 0, 'R'); - } - } - - $posy=$Yoff; - } - // Show list of linked objects $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); From a30091fd7485c31a9ea3310b6d953d850a141d24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 27 Oct 2018 09:51:19 +0200 Subject: [PATCH 2/2] Update commande.class.php --- htdocs/commande/class/commande.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index d2f915406f8..cc64226a67a 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -76,6 +76,9 @@ class Commande extends CommonOrder public $facturee; public $billed; // billed or not + /** + * @var int Draft Status of the order + */ public $brouillon; public $cond_reglement_code; @@ -226,7 +229,7 @@ class Commande extends CommonOrder $mybool|=@include_once $dir.$file; } - if (! $mybool) + if ($mybool === false) { dol_print_error('',"Failed to include file ".$file); return ''; @@ -400,6 +403,7 @@ class Commande extends CommonOrder { $this->ref = $num; $this->statut = self::STATUS_VALIDATED; + $this->brouillon = 0; } if (! $error)