Fix label goes in desc and lost fourn ref

This commit is contained in:
atm-ph 2018-03-05 17:18:03 +01:00
parent ebb4da8417
commit 5971cd8e59
2 changed files with 6 additions and 5 deletions

View File

@ -1368,7 +1368,7 @@ class CommandeFournisseur extends CommonOrder
* @param int $origin_id Id of origin object * @param int $origin_id Id of origin object
* @return int <=0 if KO, >0 if OK * @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; global $langs,$mysoc,$conf;
@ -1401,7 +1401,7 @@ class CommandeFournisseur extends CommonOrder
$pu=$pu_ttc; $pu=$pu_ttc;
} }
$desc=trim($desc); $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 // Check parameters
if ($qty < 1 && ! $fk_product) if ($qty < 1 && ! $fk_product)

View File

@ -1050,8 +1050,8 @@ if (empty($reshook))
if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0) if (empty($lines[$i]->subprice) || $lines[$i]->qty <= 0)
continue; continue;
$label = (! empty($lines[$i]->label) ? $lines[$i]->label : ''); $label = (! empty($lines[$i]->label) ? $lines[$i]->label : $lines[$i]->product_label);
$desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->libelle); $desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->product_desc);
$product_type = (! empty($lines[$i]->product_type) ? $lines[$i]->product_type : 0); $product_type = (! empty($lines[$i]->product_type) ? $lines[$i]->product_type : 0);
// Reset fk_parent_line for no child products and special product // Reset fk_parent_line for no child products and special product
@ -1098,7 +1098,8 @@ if (empty($reshook))
$lines[$i]->fk_unit, $lines[$i]->fk_unit,
0, 0,
$element, $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) { if ($result < 0) {