From a790ef9f7c334368219c0264c81de6ebd07f45f6 Mon Sep 17 00:00:00 2001 From: gauthier <gauthier.verdol@atm-consulting.fr> Date: Thu, 23 Mar 2017 12:35:43 +0100 Subject: [PATCH] FIX : origin & origin id on supplier order line --- htdocs/fourn/class/fournisseur.commande.class.php | 7 +++++-- htdocs/fourn/commande/card.php | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 8d45b11beb3..e68fbd36a94 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1340,9 +1340,11 @@ class CommandeFournisseur extends CommonOrder * @param array $array_options extrafields array * @param string $fk_unit Code of the unit to use. Null to use the default one * @param string $pu_ht_devise Amount in currency + * @param string $origin 'order', ... + * @param int $origin_id Id of origin object * @return int <=0 if KO, >0 if OK */ - public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $type=0, $info_bits=0, $notrigger=false, $date_start=null, $date_end=null, $array_options=0, $fk_unit=null, $pu_ht_devise=0) + public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0.0, $txlocaltax2=0.0, $fk_product=0, $fk_prod_fourn_price=0, $fourn_ref='', $remise_percent=0.0, $price_base_type='HT', $pu_ttc=0.0, $type=0, $info_bits=0, $notrigger=false, $date_start=null, $date_end=null, $array_options=0, $fk_unit=null, $pu_ht_devise=0, $origin='', $origin_id=0) { global $langs,$mysoc,$conf; @@ -1511,7 +1513,8 @@ class CommandeFournisseur extends CommonOrder $this->line->total_ttc=$total_ttc; $this->line->product_type=$type; $this->line->special_code=$this->special_code; - $this->line->origin=$this->origin; + $this->line->origin=$origin; + $this->line->origin_id=$origin_id; $this->line->fk_unit=$fk_unit; $this->line->date_start=$date_start; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index fb6bc840354..f891ed11a90 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1068,7 +1068,10 @@ if (empty($reshook)) null, null, array(), - $lines[$i]->fk_unit + $lines[$i]->fk_unit, + 0, + $element, + !empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid ); } -- GitLab