Merge pull request #5294 from atm-maxime/fix_productprice_multicompany
FIX #4762 Fix product supplier price modification with multicompany
This commit is contained in:
commit
454d054fdf
@ -2278,7 +2278,7 @@ class Form
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('productprice', 1).")";
|
||||
$sql.= " AND p.tobuy = 1";
|
||||
$sql.= " AND s.fournisseur = 1";
|
||||
$sql.= " AND p.rowid = ".$productid;
|
||||
|
||||
@ -433,7 +433,7 @@ class ProductFournisseur extends Product
|
||||
$sql.= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.unitcharges, pfp.info_bits, pfp.delivery_time_days";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= " WHERE pfp.entity IN (".getEntity('product', 1).")";
|
||||
$sql.= " WHERE pfp.entity IN (".getEntity('productprice', 1).")";
|
||||
$sql.= " AND pfp.fk_soc = s.rowid";
|
||||
$sql.= " AND pfp.fk_product = ".$prodid;
|
||||
if (empty($sortfield)) $sql.= " ORDER BY s.nom, pfp.quantity, pfp.price";
|
||||
|
||||
@ -2631,7 +2631,7 @@ class Product extends CommonObject
|
||||
$sql.= " WHERE fk_soc = ".$id_fourn;
|
||||
$sql.= " AND ref_fourn = '".$this->db->escape($ref_fourn)."'";
|
||||
$sql.= " AND fk_product != ".$this->id;
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
$sql.= " AND entity IN (".getEntity('productprice', 1).")";
|
||||
|
||||
dol_syslog(get_class($this)."::add_fournisseur", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
@ -2655,7 +2655,7 @@ class Product extends CommonObject
|
||||
else $sql.= " AND (ref_fourn = '' OR ref_fourn IS NULL)";
|
||||
$sql.= " AND quantity = '".$quantity."'";
|
||||
$sql.= " AND fk_product = ".$this->id;
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
$sql.= " AND entity IN (".getEntity('productprice', 1).")";
|
||||
|
||||
dol_syslog(get_class($this)."::add_fournisseur", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
@ -152,7 +152,7 @@ if (empty($reshook))
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorFieldMustBeANumeric",'eeee'), null, 'errors');
|
||||
setEventMessages($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("VATRateForSupplierProduct")), null, 'errors');
|
||||
}
|
||||
if (empty($quantity))
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user