Skip to content

Commit

Permalink
Correction trigger on update product buyprice
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrey.girard committed Jan 22, 2014
1 parent 8729790 commit 7f59def
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions htdocs/fourn/class/fournisseur.product.class.php
Expand Up @@ -199,9 +199,7 @@ function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $avai
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);
Expand All @@ -211,7 +209,16 @@ function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn, $avai
$error++; $this->errors=$interface->errors;
}

return 0;
if (empty($error))
{
$this->db->commit();
return 0;
}
else
{
$this->db->rollback();
return 1;
}
}
else
{
Expand Down

0 comments on commit 7f59def

Please sign in to comment.