From 7f59def98bb01c6dffa57442ce9a560083d6b1ca Mon Sep 17 00:00:00 2001 From: "geoffrey.girard" Date: Wed, 22 Jan 2014 10:44:23 +0100 Subject: [PATCH] Correction trigger on update product buyprice --- htdocs/fourn/class/fournisseur.product.class.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 1f622103b09..a54b2bc2ce5 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -199,9 +199,7 @@ class ProductFournisseur extends Product dol_syslog(get_class($this).'::update_buyprice sql='.$sql); $resql = $this->db->query($sql); if ($resql) - { - $this->db->commit(); - + { // Appel des triggers include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); $interface=new Interfaces($this->db); @@ -211,7 +209,16 @@ class ProductFournisseur extends Product $error++; $this->errors=$interface->errors; } - return 0; + if (empty($error)) + { + $this->db->commit(); + return 0; + } + else + { + $this->db->rollback(); + return 1; + } } else {