Fix: Log error level
This commit is contained in:
parent
c33207099e
commit
e90e29c201
@ -119,7 +119,7 @@ class Mailing
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
dolibarr_syslog("Mailing::Create ".$this->error, LOG_ERROR);
|
dolibarr_syslog("Mailing::Create ".$this->error, LOG_ERR);
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -147,7 +147,7 @@ class Mailing
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
$this->error=$this->db->lasterror();
|
||||||
dolibarr_syslog("Mailing::Update ".$this->error, LOG_ERROR);
|
dolibarr_syslog("Mailing::Update ".$this->error, LOG_ERR);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -106,7 +106,7 @@ if ($_POST['action'] == 'confirm_valide' && $_POST['confirm'] == 'yes' && $user-
|
|||||||
$remisecheque = new RemiseCheque($db);
|
$remisecheque = new RemiseCheque($db);
|
||||||
$remisecheque->Fetch($_GET["id"]);
|
$remisecheque->Fetch($_GET["id"]);
|
||||||
$result = $remisecheque->Validate($user);
|
$result = $remisecheque->Validate($user);
|
||||||
if ($result == 0)
|
if ($result >= 0)
|
||||||
{
|
{
|
||||||
Header("Location: fiche.php?id=".$remisecheque->id);
|
Header("Location: fiche.php?id=".$remisecheque->id);
|
||||||
exit;
|
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'] == '')
|
if ($user->societe_id == 0 && $remisecheque->statut == 0 && $_GET['action'] == '')
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="fiche.php?id='.$_GET['id'].'&facid='.$objp->facid.'&action=valide">'.$langs->trans('Valid').'</a>';
|
print '<a class="butAction" href="fiche.php?id='.$_GET['id'].'&action=valide">'.$langs->trans('Valid').'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->societe_id == 0 && $remisecheque->statut == 0 && $_GET['action'] == '')
|
if ($user->societe_id == 0 && $remisecheque->statut == 0 && $_GET['action'] == '')
|
||||||
|
|||||||
@ -281,16 +281,18 @@ class RemiseCheque extends CommonObject
|
|||||||
function Validate($user)
|
function Validate($user)
|
||||||
{
|
{
|
||||||
$this->errno = 0;
|
$this->errno = 0;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$num=$this->getNextNumber();
|
$num=$this->getNextNumber();
|
||||||
|
|
||||||
if ($this->errno === 0)
|
if ($this->errno == 0)
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque";
|
||||||
$sql.= " SET statut=1, number='".$num."'";
|
$sql.= " SET statut=1, number='".$num."'";
|
||||||
$sql .= " WHERE rowid = $this->id AND statut=0;";
|
$sql .= " WHERE rowid = $this->id AND statut=0;";
|
||||||
|
|
||||||
|
dolibarr_syslog("RemiseCheque::Validate sql=".$sql, LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ( $resql )
|
if ( $resql )
|
||||||
{
|
{
|
||||||
@ -313,12 +315,13 @@ class RemiseCheque extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->errno === 0)
|
if ($this->errno == 0)
|
||||||
{
|
{
|
||||||
$this->GeneratePdf();
|
$this->GeneratePdf();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->errno === 0)
|
// Commit/Rollback
|
||||||
|
if ($this->errno == 0)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
}
|
}
|
||||||
@ -343,6 +346,8 @@ class RemiseCheque extends CommonObject
|
|||||||
|
|
||||||
// We use +0 to convert varchar to number
|
// We use +0 to convert varchar to number
|
||||||
$sql = "SELECT MAX(number+0) FROM ".MAIN_DB_PREFIX."bordereau_cheque";
|
$sql = "SELECT MAX(number+0) FROM ".MAIN_DB_PREFIX."bordereau_cheque";
|
||||||
|
|
||||||
|
dolibarr_syslog("Remisecheque::getNextNumber sql=".$sql);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -353,7 +358,7 @@ class RemiseCheque extends CommonObject
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->errno = -1034;
|
$this->errno = -1034;
|
||||||
dolibarr_syslog("Remisecheque::Validate Erreur SELECT ($this->errno)");
|
dolibarr_syslog("Remisecheque::Validate Erreur SELECT ($this->errno)", LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
$num++;
|
$num++;
|
||||||
|
|||||||
@ -754,18 +754,18 @@ class BonPrelevement extends CommonObject
|
|||||||
}
|
}
|
||||||
else
|
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";
|
$facture_errors[$fac[0]]="Erreur de RIB societe $fact->socid $soc->nom";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_syslog("Failed to read company", LOG_ERROR);
|
dolibarr_syslog("Failed to read company", LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
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<EFBFBD>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
|
* \return int <0 si ko, 0 si ok
|
||||||
*/
|
*/
|
||||||
function _createSubProduct($user, $idProduct, $entrepot_id, $qty, $type, $price=0)
|
function _createSubProduct($user, $idProduct, $entrepot_id, $qty, $type, $price=0)
|
||||||
@ -179,7 +179,7 @@ class MouvementStock
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_syslog("MouvementStock::_createSubProduct ".$this->error, LOG_ERROR);
|
dolibarr_syslog("MouvementStock::_createSubProduct ".$this->error, LOG_ERR);
|
||||||
$error = -2;
|
$error = -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user