Fix label goes in desc and lost fourn ref
This commit is contained in:
parent
ebb4da8417
commit
5971cd8e59
@ -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)
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user