Skip to content
Snippets Groups Projects
Commit e90e29c2 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Log error level

parent c3320709
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
......
......@@ -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 '<a class="butAction" href="fiche.php?id='.$_GET['id'].'&amp;facid='.$objp->facid.'&amp;action=valide">'.$langs->trans('Valid').'</a>';
print '<a class="butAction" href="fiche.php?id='.$_GET['id'].'&amp;action=valide">'.$langs->trans('Valid').'</a>';
}
if ($user->societe_id == 0 && $remisecheque->statut == 0 && $_GET['action'] == '')
......
......@@ -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++;
......
......@@ -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);
}
}
}
......
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment