Merge pull request #6358 from defrance/patch-71
FIX : fill fourn remise percent with select product mode
This commit is contained in:
commit
64da0e77d5
@ -1408,6 +1408,11 @@ class CommandeFournisseur extends CommonOrder
|
||||
{
|
||||
$pu = $prod->fourn_pu; // Unit price supplier price set by get_buyprice
|
||||
$ref_supplier = $prod->ref_supplier; // Ref supplier price set by get_buyprice
|
||||
// is remise percent not keyed but present for the product we add it
|
||||
if ($remise_percent == 0 && $prod->remise_percent !=0)
|
||||
$remise_percent =$prod->remise_percent;
|
||||
|
||||
|
||||
}
|
||||
if ($result == 0) // If result == 0, we failed to found the supplier reference price
|
||||
{
|
||||
|
||||
@ -1470,7 +1470,7 @@ class Product extends CommonObject
|
||||
$result = 0;
|
||||
|
||||
// We do a first seach with a select by searching with couple prodfournprice and qty only (later we will search on triplet qty/product_id/fourn_ref)
|
||||
$sql = "SELECT pfp.rowid, pfp.price as price, pfp.quantity as quantity,";
|
||||
$sql = "SELECT pfp.rowid, pfp.price as price, pfp.quantity as quantity, pfp.remise_percent,";
|
||||
$sql.= " pfp.fk_product, pfp.ref_fourn, pfp.fk_soc, pfp.tva_tx, pfp.fk_supplier_price_expression";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
|
||||
$sql.= " WHERE pfp.rowid = ".$prodfournprice;
|
||||
@ -1504,6 +1504,7 @@ class Product extends CommonObject
|
||||
$this->fourn_price_base_type = 'HT'; // Price base type
|
||||
$this->ref_fourn = $obj->ref_fourn; // deprecated
|
||||
$this->ref_supplier = $obj->ref_fourn; // Ref supplier
|
||||
$this->remise_percent = $obj->remise_percent; // remise percent if present and not typed
|
||||
$this->vatrate_supplier = $obj->tva_tx; // Vat ref supplier
|
||||
$result=$obj->fk_product;
|
||||
return $result;
|
||||
@ -1549,6 +1550,7 @@ class Product extends CommonObject
|
||||
$this->fourn_price_base_type = 'HT'; // Price base type for a virtual supplier
|
||||
$this->ref_fourn = $obj->ref_supplier; // deprecated
|
||||
$this->ref_supplier = $obj->ref_supplier; // Ref supplier
|
||||
$this->remise_percent = $obj->remise_percent; // remise percent if present and not typed
|
||||
$this->vatrate_supplier = $obj->tva_tx; // Vat ref supplier
|
||||
$result=$obj->fk_product;
|
||||
return $result;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user