From 5971cd8e59d435c15e5f0b30531a60d87e038a85 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Mon, 5 Mar 2018 17:18:03 +0100 Subject: [PATCH] Fix label goes in desc and lost fourn ref --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- htdocs/fourn/commande/card.php | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 4d492bf2bbe..eacc27e29c1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1368,7 +1368,7 @@ class CommandeFournisseur extends CommonOrder * @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, $origin='', $origin_id=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, $label='') { global $langs,$mysoc,$conf; @@ -1401,7 +1401,7 @@ class CommandeFournisseur extends CommonOrder $pu=$pu_ttc; } $desc=trim($desc); - $ref_supplier=''; // Ref of supplier price when we add line + $ref_supplier=$fourn_ref; // Ref of supplier price when we add line // Check parameters if ($qty < 1 && ! $fk_product) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index aa833d49b6e..fe26bcdc672 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1050,8 +1050,8 @@ if (empty($reshook)) if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0) continue; - $label = (! empty($lines[$i]->label) ? $lines[$i]->label : ''); - $desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->libelle); + $label = (! empty($lines[$i]->label) ? $lines[$i]->label : $lines[$i]->product_label); + $desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->product_desc); $product_type = (! empty($lines[$i]->product_type) ? $lines[$i]->product_type : 0); // Reset fk_parent_line for no child products and special product @@ -1098,7 +1098,8 @@ if (empty($reshook)) $lines[$i]->fk_unit, 0, $element, - !empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid + !empty($lines[$i]->id) ? $lines[$i]->id : $lines[$i]->rowid, + $label ); if ($result < 0) {