diff --git a/htdocs/comm/mailing/mailing.class.php b/htdocs/comm/mailing/mailing.class.php
index 55d67c91b51..a050ae3ac8d 100644
--- a/htdocs/comm/mailing/mailing.class.php
+++ b/htdocs/comm/mailing/mailing.class.php
@@ -119,7 +119,7 @@ class Mailing
else
{
$this->error=$this->db->lasterror();
- dolibarr_syslog("Mailing::Create ".$this->error, LOG_ERROR);
+ dolibarr_syslog("Mailing::Create ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
@@ -147,7 +147,7 @@ class Mailing
else
{
$this->error=$this->db->lasterror();
- dolibarr_syslog("Mailing::Update ".$this->error, LOG_ERROR);
+ dolibarr_syslog("Mailing::Update ".$this->error, LOG_ERR);
return -1;
}
}
diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php
index c3bb99c2744..860ee29e02a 100644
--- a/htdocs/compta/paiement/cheque/fiche.php
+++ b/htdocs/compta/paiement/cheque/fiche.php
@@ -106,7 +106,7 @@ if ($_POST['action'] == 'confirm_valide' && $_POST['confirm'] == 'yes' && $user-
$remisecheque = new RemiseCheque($db);
$remisecheque->Fetch($_GET["id"]);
$result = $remisecheque->Validate($user);
- if ($result == 0)
+ if ($result >= 0)
{
Header("Location: fiche.php?id=".$remisecheque->id);
exit;
@@ -421,7 +421,7 @@ if ($user->societe_id == 0 && sizeof($accounts) == 1 && $_GET['action'] == 'new'
if ($user->societe_id == 0 && $remisecheque->statut == 0 && $_GET['action'] == '')
{
- print ''.$langs->trans('Valid').'';
+ print ''.$langs->trans('Valid').'';
}
if ($user->societe_id == 0 && $remisecheque->statut == 0 && $_GET['action'] == '')
diff --git a/htdocs/compta/paiement/cheque/remisecheque.class.php b/htdocs/compta/paiement/cheque/remisecheque.class.php
index 0b0f1c76097..03229397b7d 100644
--- a/htdocs/compta/paiement/cheque/remisecheque.class.php
+++ b/htdocs/compta/paiement/cheque/remisecheque.class.php
@@ -281,16 +281,18 @@ class RemiseCheque extends CommonObject
function Validate($user)
{
$this->errno = 0;
+
$this->db->begin();
$num=$this->getNextNumber();
- if ($this->errno === 0)
+ if ($this->errno == 0)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque";
$sql.= " SET statut=1, number='".$num."'";
$sql .= " WHERE rowid = $this->id AND statut=0;";
+ dolibarr_syslog("RemiseCheque::Validate sql=".$sql, LOG_DEBUG);
$resql = $this->db->query($sql);
if ( $resql )
{
@@ -313,12 +315,13 @@ class RemiseCheque extends CommonObject
}
}
- if ($this->errno === 0)
+ if ($this->errno == 0)
{
$this->GeneratePdf();
}
- if ($this->errno === 0)
+ // Commit/Rollback
+ if ($this->errno == 0)
{
$this->db->commit();
}
@@ -343,6 +346,8 @@ class RemiseCheque extends CommonObject
// We use +0 to convert varchar to number
$sql = "SELECT MAX(number+0) FROM ".MAIN_DB_PREFIX."bordereau_cheque";
+
+ dolibarr_syslog("Remisecheque::getNextNumber sql=".$sql);
$resql = $this->db->query($sql);
if ($resql)
{
@@ -353,7 +358,7 @@ class RemiseCheque extends CommonObject
else
{
$this->errno = -1034;
- dolibarr_syslog("Remisecheque::Validate Erreur SELECT ($this->errno)");
+ dolibarr_syslog("Remisecheque::Validate Erreur SELECT ($this->errno)", LOG_ERR);
}
$num++;
diff --git a/htdocs/compta/prelevement/bon-prelevement.class.php b/htdocs/compta/prelevement/bon-prelevement.class.php
index 949688d23e8..d0fe39b2e68 100644
--- a/htdocs/compta/prelevement/bon-prelevement.class.php
+++ b/htdocs/compta/prelevement/bon-prelevement.class.php
@@ -754,18 +754,18 @@ class BonPrelevement extends CommonObject
}
else
{
- dolibarr_syslog("Erreur de RIB societe $fact->socid $soc->nom", LOG_ERROR);
+ dolibarr_syslog("Erreur de RIB societe $fact->socid $soc->nom", LOG_ERR);
$facture_errors[$fac[0]]="Erreur de RIB societe $fact->socid $soc->nom";
}
}
else
{
- dolibarr_syslog("Failed to read company", LOG_ERROR);
+ dolibarr_syslog("Failed to read company", LOG_ERR);
}
}
else
{
- dolibarr_syslog("Impossible de lire la facture", LOG_ERROR);
+ dolibarr_syslog("Impossible de lire la facture", LOG_ERR);
}
}
}
diff --git a/htdocs/product/stock/mouvementstock.class.php b/htdocs/product/stock/mouvementstock.class.php
index d5c6bea3583..63f0d070d37 100644
--- a/htdocs/product/stock/mouvementstock.class.php
+++ b/htdocs/product/stock/mouvementstock.class.php
@@ -151,7 +151,7 @@ class MouvementStock
/**
- * \brief Cr�e un mouvement en base pour tous les sous-produits
+ * \brief Create movement in databse for all subproducts
* \return int <0 si ko, 0 si ok
*/
function _createSubProduct($user, $idProduct, $entrepot_id, $qty, $type, $price=0)
@@ -179,7 +179,7 @@ class MouvementStock
}
else
{
- dolibarr_syslog("MouvementStock::_createSubProduct ".$this->error, LOG_ERROR);
+ dolibarr_syslog("MouvementStock::_createSubProduct ".$this->error, LOG_ERR);
$error = -2;
}