Add trigger "SUPPLIER_PRODUCT_BUYPRICE_DELETE" for frounisseur.product remove_product_fournisseur_price()
This commit is contained in:
parent
9a1ec900bd
commit
ca8c1adf55
@ -121,7 +121,7 @@ class ProductFournisseur extends Product
|
|||||||
*/
|
*/
|
||||||
function remove_product_fournisseur_price($rowid)
|
function remove_product_fournisseur_price($rowid)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf, $user;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
@ -132,8 +132,21 @@ class ProductFournisseur extends Product
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
// Call trigger
|
||||||
return 1;
|
$result=$this->call_trigger('SUPPLIER_PRODUCT_BUYPRICE_DELETE',$user);
|
||||||
|
if ($result < 0) $error++;
|
||||||
|
// End call triggers
|
||||||
|
|
||||||
|
if (empty($error))
|
||||||
|
{
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -95,9 +95,14 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
if ($rowid)
|
if ($rowid)
|
||||||
{
|
{
|
||||||
$result=$object->remove_product_fournisseur_price($rowid);
|
|
||||||
$action = '';
|
$action = '';
|
||||||
setEventMessage($langs->trans("PriceRemoved"));
|
$result=$product->remove_product_fournisseur_price($rowid);
|
||||||
|
if($result > 0){
|
||||||
|
setEventMessage($langs->trans("PriceRemoved"));
|
||||||
|
}else{
|
||||||
|
$error++;
|
||||||
|
setEventMessages($product->error, $product->errors, 'errors');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user