From dd1c5ce3d833fb86222a450000bb64daad7175d7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Jun 2014 15:03:11 +0200 Subject: [PATCH 1/2] Fix: Missing commit --- .../class/fournisseur.commande.class.php | 48 +++++++++++-------- 1 file changed, 29 insertions(+), 19 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 0a0067f1105..6d0edce5a65 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -390,9 +390,9 @@ class CommandeFournisseur extends CommonOrder include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('ORDER_SUPPLIER_VALIDATE',$this,$user,$langs,$conf); - if ($result < 0) - { - $error++; + if ($result < 0) + { + $error++; $this->errors=$interface->errors; $this->db->rollback(); return -1; @@ -749,7 +749,7 @@ class CommandeFournisseur extends CommonOrder } else { - $this->db->rollback(); + $this->db->rollback(); return -1; } } @@ -780,34 +780,44 @@ class CommandeFournisseur extends CommonOrder $error=0; - dol_syslog(get_class($this)."::refuse"); $result = 0; if ($user->rights->fournisseur->commande->approuver) { $this->db->begin(); - + $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur SET fk_statut = 9"; - $sql .= " WHERE rowid = ".$this->id; - - if ($this->db->query($sql)) + $sql.= " WHERE rowid = ".$this->id; + + dol_syslog(get_class($this)."::refuse sql=".$sql); + $resql=$this->db->query($sql); + + if ($resql) { $result = 0; $this->log($user, 9, time()); - if ($error == 0) + if (! $error) { // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('ORDER_SUPPLIER_REFUSE',$this,$user,$langs,$conf); - if ($result < 0) - { + if ($result < 0) + { $error++; $this->errors=$interface->errors; - $this->db->rollback(); } // Fin appel triggers } + + if (! $error) + { + $this->db->commit(); + } + else + { + $this->db->rollback(); + } } else { @@ -821,7 +831,7 @@ class CommandeFournisseur extends CommonOrder { dol_syslog(get_class($this)."::refuse Not Authorized"); } - return $result ; + return $result; } /** @@ -1052,7 +1062,7 @@ class CommandeFournisseur extends CommonOrder include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('ORDER_SUPPLIER_CREATE',$this,$user,$langs,$conf); - if ($result < 0) + if ($result < 0) { $error++; $this->errors=$interface->errors; @@ -1305,8 +1315,8 @@ class CommandeFournisseur extends CommonOrder include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result=$interface->run_triggers('LINEORDER_SUPPLIER_CREATE',$this,$user,$langs,$conf); - if ($result < 0) - { + if ($result < 0) + { $error++; $this->errors=$interface->errors; $this->db->rollback(); @@ -1377,7 +1387,7 @@ class CommandeFournisseur extends CommonOrder $interface=new Interfaces($this->db); $result=$interface->run_triggers('LINEORDER_SUPPLIER_DISPATCH',$this,$user,$langs,$conf); if ($result < 0) - { + { $error++; $this->errors=$interface->errors; $this->db->rollback(); @@ -1442,7 +1452,7 @@ class CommandeFournisseur extends CommonOrder { $sql = "DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseurdet WHERE rowid = ".$idligne; $resql=$this->db->query($sql); - + //TODO: Add trigger for deleted line dol_syslog(get_class($this)."::deleteline sql=".$sql); if ($resql) From 198a8d40f7f95cd6b15d283170d6398d7b2883ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 29 Jun 2014 13:53:07 +0200 Subject: [PATCH 2/2] Fix: Missing translation --- htdocs/compta/facture/fiche-rec.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 61385ed5f89..11e2e91b1e9 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $langs->load('bills'); +$langs->load('compta'); +$langs->load('products'); // Security check $id=(GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int'));