10 changes: 4 additions & 6 deletions htdocs/adherents/class/cotisation.class.php
Expand Up @@ -82,7 +82,7 @@ function create($userid)
$sql.= " '".$this->db->idate($this->datef)."',";
$sql.= " ".$this->amount.",'".$this->db->escape($this->note)."')";

dol_syslog(get_class($this)."::create sql=".$sql);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand All @@ -91,7 +91,6 @@ function create($userid)
else
{
$this->error=$this->db->error();
dol_syslog($this->error, LOG_ERR);
return -1;
}
}
Expand All @@ -113,7 +112,7 @@ function fetch($rowid)
$sql.=" FROM ".MAIN_DB_PREFIX."cotisation";
$sql.=" WHERE rowid=".$rowid;

dol_syslog(get_class($this)."::fetch sql=".$sql);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -168,7 +167,7 @@ function update($user,$notrigger=0)
$sql .= " fk_bank = ".($this->fk_bank ? $this->fk_bank : 'null');
$sql .= " WHERE rowid = ".$this->id;

dol_syslog(get_class($this)."::update sql=".$sql);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand All @@ -183,7 +182,6 @@ function update($user,$notrigger=0)
{
$this->db->rollback();
$this->error=$this->db->error();
dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR);
return -1;
}
}
Expand All @@ -207,7 +205,7 @@ function delete($user)
$this->db->begin();

$sql = "DELETE FROM ".MAIN_DB_PREFIX."cotisation WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::delete sql=".$sql);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down
4 changes: 2 additions & 2 deletions htdocs/adherents/index.php
Expand Up @@ -68,7 +68,7 @@
$sql.= " WHERE t.entity IN (".getEntity().")";
$sql.= " GROUP BY t.rowid, t.libelle, t.cotisation, d.statut";

dol_syslog("index.php::select nb of members by type sql=".$sql, LOG_DEBUG);
dol_syslog("index.php::select nb of members by type", LOG_DEBUG);
$result = $db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -106,7 +106,7 @@
$sql.= " AND t.rowid = d.fk_adherent_type";
$sql.= " GROUP BY d.fk_adherent_type";

dol_syslog("index.php::select nb of uptodate members by type sql=".$sql, LOG_DEBUG);
dol_syslog("index.php::select nb of uptodate members by type", LOG_DEBUG);
$result = $db->query($sql);
if ($result)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/liste.php
Expand Up @@ -158,7 +158,7 @@
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($conf->liste_limit+1, $offset);

dol_syslog("get list sql=".$sql);
dol_syslog("get list", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/stats/byproperties.php
Expand Up @@ -74,7 +74,7 @@
$foundphy=$foundmor=0;

// Define $data array
dol_syslog("Count member sql=".$sql);
dol_syslog("Count member", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/adherents/stats/geo.php
Expand Up @@ -138,7 +138,7 @@
//print $langsen->trans("Country"."FI");exit;

// Define $data array
dol_syslog("Count member sql=".$sql);
dol_syslog("Count member", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/barcode.php
Expand Up @@ -203,7 +203,7 @@
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " ORDER BY code";

dol_syslog("admin/barcode.php sql=".$sql);
dol_syslog("admin/barcode.php", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down
10 changes: 5 additions & 5 deletions htdocs/admin/boxes.php
Expand Up @@ -66,7 +66,7 @@
$sql.= " WHERE param = 'MAIN_BOXES_".$db->escape(GETPOST("pos","alpha"))."' AND value = '1'";
$sql.= " AND entity = ".$conf->entity;
$resql = $db->query($sql);
dol_syslog("boxes.php search fk_user to activate box for sql=".$sql);
dol_syslog("boxes.php search fk_user to activate box for", LOG_DEBUG);
if ($resql)
{
$num = $db->num_rows($resql);
Expand All @@ -93,7 +93,7 @@
{
$nbboxonleft=$nbboxonright=0;
$sql = "SELECT box_order FROM ".MAIN_DB_PREFIX."boxes WHERE position = ".GETPOST("pos","alpha")." AND fk_user = ".$fk_user." AND entity = ".$conf->entity;
dol_syslog("boxes.php activate box sql=".$sql);
dol_syslog("boxes.php activate box", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
Expand All @@ -112,7 +112,7 @@
$sql.= GETPOST("boxid","int").", ".GETPOST("pos","alpha").", '".(($nbboxonleft > $nbboxonright) ? 'B01' : 'A01')."', ".$fk_user.", ".$conf->entity;
$sql.= ")";

dol_syslog("boxes.php activate box sql=".$sql);
dol_syslog("boxes.php activate box", LOG_DEBUG);
$resql = $db->query($sql);
if (! $resql)
{
Expand Down Expand Up @@ -235,7 +235,7 @@
$sql.= " AND b.fk_user=0";
$sql.= " ORDER by b.position, b.box_order";

dol_syslog("Search available boxes sql=".$sql, LOG_DEBUG);
dol_syslog("Search available boxes", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -271,7 +271,7 @@
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " AND LENGTH(box_order) <= 2";

dol_syslog("Execute requests to renumber box order sql=".$sql);
dol_syslog("Execute requests to renumber box order", LOG_DEBUG);
$result = $db->query($sql);
if ($result)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/const.php
Expand Up @@ -233,7 +233,7 @@
elseif ($user->entity || empty($conf->multicompany->enabled)) $sql.= " AND visible = 1";
$sql.= " ORDER BY entity, name ASC";

dol_syslog("Const::listConstant sql=".$sql);
dol_syslog("Const::listConstant", LOG_DEBUG);
$result = $db->query($sql);
if ($result)
{
Expand Down
8 changes: 4 additions & 4 deletions htdocs/admin/dict.php
Expand Up @@ -528,7 +528,7 @@
}
$sql.=",1)";

dol_syslog("actionadd sql=".$sql);
dol_syslog("actionadd", LOG_DEBUG);
$result = $db->query($sql);
if ($result) // Add is ok
{
Expand Down Expand Up @@ -576,7 +576,7 @@
}
$sql.= " WHERE ".$rowidcol." = '".$rowid."'";

dol_syslog("actionmodify sql=".$sql);
dol_syslog("actionmodify", LOG_DEBUG);
//print $sql;
$resql = $db->query($sql);
if (! $resql)
Expand All @@ -599,7 +599,7 @@

$sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'";

dol_syslog("delete sql=".$sql);
dol_syslog("delete", LOG_DEBUG);
$result = $db->query($sql);
if (! $result)
{
Expand Down Expand Up @@ -826,7 +826,7 @@
print '</form>';

// List of available values in database
dol_syslog("htdocs/admin/dict sql=".$sql, LOG_DEBUG);
dol_syslog("htdocs/admin/dict", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/external_rss.php
Expand Up @@ -229,7 +229,7 @@
$sql.=" WHERE file = 'box_external_rss.php'";
$sql.=" ORDER BY note";

dol_syslog("select rss boxes sql=".$sql,LOG_DEBUG);
dol_syslog("select rss boxes", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down
1 change: 0 additions & 1 deletion htdocs/admin/menus/index.php
Expand Up @@ -304,7 +304,6 @@
$sql.= " AND fk_menu >= 0";
$sql.= " ORDER BY m.position, m.rowid"; // Order is position then rowid (because we need a sort criteria when position is same)

dol_syslog("sql=".$sql);
$res = $db->query($sql);
if ($res)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/admin/tools/listevents.php
Expand Up @@ -78,7 +78,7 @@
$sql = "DELETE FROM ".MAIN_DB_PREFIX."events";
$sql.= " WHERE entity = ".$conf->entity;

dol_syslog("listevents purge sql=".$sql);
dol_syslog("listevents purge", LOG_DEBUG);
$resql = $db->query($sql);
if (! $resql)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/barcode/codeinit.php
Expand Up @@ -126,7 +126,7 @@
$sql.=$db->order("datec","ASC");
$sql.=$db->plimit($maxperinit);

dol_syslog("codeinit sql=".$sql, LOG_DEBUG);
dol_syslog("codeinit", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down
8 changes: 4 additions & 4 deletions htdocs/bookmarks/class/bookmark.class.php
Expand Up @@ -65,7 +65,7 @@ function fetch($id)
$sql.= " WHERE rowid = ".$id;
$sql.= " AND entity = ".$conf->entity;

dol_syslog("Bookmark::fetch sql=".$sql, LOG_DEBUG);
dol_syslog("Bookmark::fetch", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -123,7 +123,7 @@ function create()
if ($this->fk_soc) $sql.=",".$this->fk_soc;
$sql.= ")";

dol_syslog("Bookmark::update sql=".$sql, LOG_DEBUG);
dol_syslog("Bookmark::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -173,7 +173,7 @@ function update()
$sql.= " ,position = '".$this->position."'";
$sql.= " WHERE rowid = ".$this->id;

dol_syslog("Bookmark::update sql=".$sql, LOG_DEBUG);
dol_syslog("Bookmark::update", LOG_DEBUG);
if ($this->db->query($sql))
{
return 1;
Expand All @@ -196,7 +196,7 @@ function remove($id)
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark";
$sql .= " WHERE rowid = ".$id;

dol_syslog("Bookmark::remove sql=".$sql, LOG_DEBUG);
dol_syslog("Bookmark::remove", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/cashdesk/class/Facturation.class.php
Expand Up @@ -103,7 +103,7 @@ public function ajoutArticle()
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva";
$sql.= " WHERE rowid = ".$this->tva();

dol_syslog("ajoutArticle sql=".$sql);
dol_syslog("ajoutArticle", LOG_DEBUG);
$resql = $db->query($sql);

if ($resql)
Expand Down
2 changes: 1 addition & 1 deletion htdocs/cashdesk/facturation.php
Expand Up @@ -65,7 +65,7 @@
else $sql.= ")";
$sql.= " ORDER BY label";

dol_syslog("facturation.php sql=".$sql);
dol_syslog("facturation.php", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/cashdesk/facturation_dhtml.php
Expand Up @@ -62,7 +62,7 @@
}
$sql.= " ORDER BY label";

dol_syslog("facturation_dhtml.php sql=".$sql);
dol_syslog("facturation_dhtml.php", LOG_DEBUG);
$result = $db->query($sql);

if ($result)
Expand Down
44 changes: 15 additions & 29 deletions htdocs/categories/class/categorie.class.php
Expand Up @@ -87,7 +87,7 @@ function fetch($id,$label='')
if ($label) $sql.= " WHERE label = '".$this->db->escape($label)."' AND entity=".$conf->entity;;
}

dol_syslog(get_class($this)."::fetch sql=".$sql);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -158,7 +158,7 @@ function create($user='')

$this->db->begin();

dol_syslog(get_class($this).'::create sql='.$sql);
dol_syslog(get_class($this).'::create', LOG_DEBUG);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (";
$sql.= "fk_parent,";
$sql.= " label,";
Expand All @@ -185,7 +185,7 @@ function create($user='')
$sql.= $conf->entity;
$sql.= ")";

dol_syslog(get_class($this).'::create sql='.$sql);
dol_syslog(get_class($this).'::create', LOG_DEBUG);
$res = $this->db->query($sql);
if ($res)
{
Expand Down Expand Up @@ -232,7 +232,6 @@ function create($user='')
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::create error ".$this->error." sql=".$sql, LOG_ERR);
$this->db->rollback();
return -1;
}
Expand Down Expand Up @@ -278,7 +277,7 @@ function update($user='')
$sql .= ", fk_parent = ".$this->fk_parent;
$sql .= " WHERE rowid = ".$this->id;

dol_syslog(get_class($this)."::update sql=".$sql);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
if ($this->db->query($sql))
{

Expand Down Expand Up @@ -346,7 +345,6 @@ function delete($user)
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
$error++;
}
}
Expand All @@ -357,7 +355,6 @@ function delete($user)
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
$error++;
}
}
Expand All @@ -368,7 +365,6 @@ function delete($user)
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
$error++;
}
}
Expand All @@ -379,7 +375,6 @@ function delete($user)
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
$error++;
}
}
Expand All @@ -390,7 +385,6 @@ function delete($user)
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
$error++;
}
}
Expand All @@ -401,7 +395,6 @@ function delete($user)
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
$error++;
}
}
Expand All @@ -414,7 +407,6 @@ function delete($user)
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
$error++;
}
else
Expand Down Expand Up @@ -480,15 +472,15 @@ function add_type($obj,$type)
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_".$type." (fk_categorie, fk_".$column_name.")";
$sql .= " VALUES (".$this->id.", ".$obj->id.")";

dol_syslog(get_class($this).'::add_type sql='.$sql);
dol_syslog(get_class($this).'::add_type', LOG_DEBUG);
if ($this->db->query($sql))
{
if (! empty($conf->global->CATEGORIE_RECURSIV_ADD))
{
$sql = 'SELECT fk_parent FROM '.MAIN_DB_PREFIX.'categorie';
$sql.= " WHERE rowid = ".$this->id;

dol_syslog(get_class($this)."::add_type sql=".$sql);
dol_syslog(get_class($this)."::add_type", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -575,7 +567,7 @@ function del_type($obj,$type)
$sql .= " WHERE fk_categorie = ".$this->id;
$sql .= " AND fk_".$column_name." = ".$obj->id;

dol_syslog(get_class($this).'::del_type sql='.$sql);
dol_syslog(get_class($this).'::del_type', LOG_DEBUG);
if ($this->db->query($sql))
{
// Save object we want to unlink category off into category instance to provide information to trigger
Expand Down Expand Up @@ -626,7 +618,7 @@ function getObjectsInCateg($type)
$sql.= " AND c.fk_categorie = ".$this->id;
$sql.= " AND c.fk_".$field." = o.rowid";

dol_syslog(get_class($this)."::getObjectsInCateg sql=".$sql);
dol_syslog(get_class($this)."::getObjectsInCateg", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand All @@ -641,7 +633,6 @@ function getObjectsInCateg($type)
else
{
$this->error=$this->db->error().' sql='.$sql;
dol_syslog(get_class($this)."::getObjectsInCateg ".$this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -679,13 +670,12 @@ function containsObject($type, $object_id)
}
$sql = "SELECT COUNT(*) as nb FROM " . MAIN_DB_PREFIX . "categorie_" . $category_table;
$sql .= " WHERE fk_categorie = " . $this->id . " AND fk_" . $field . " = " . $object_id;
dol_syslog(get_class($this)."::containsObject sql=".$sql);
dol_syslog(get_class($this)."::containsObject", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
return $this->db->fetch_object($resql)->nb;
} else {
$this->error=$this->db->error().' sql='.$sql;
dol_syslog(get_class($this)."::containsObject ".$this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -737,7 +727,7 @@ private function load_motherof()
$sql.= " WHERE fk_parent != 0";
$sql.= " AND entity IN (".getEntity('category',1).")";

dol_syslog(get_class($this)."::load_motherof sql=".$sql);
dol_syslog(get_class($this)."::load_motherof", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -788,7 +778,7 @@ function get_full_arbo($type,$markafterid=0)
$sql.= " WHERE c.entity IN (".getEntity('category',1).")";
$sql.= " AND c.type = ".$type;

dol_syslog(get_class($this)."::get_full_arbo get category list sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::get_full_arbo get category list", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -982,7 +972,7 @@ function already_exists()
$sql.= " AND c.fk_parent = ".$this->fk_parent;
$sql.= " AND c.label = '".$this->db->escape($this->label)."'";

dol_syslog(get_class($this)."::already_exists sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::already_exists", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand All @@ -1006,7 +996,6 @@ function already_exists()
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::already_exists error ".$this->error." sql=".$sql, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -1145,7 +1134,7 @@ function containing($id,$type,$mode='object')
$sql.= " WHERE ct.fk_categorie = c.rowid AND ct.fk_".$table." = ".$id." AND c.type = ".$typeid;
$sql.= " AND c.entity IN (".getEntity('category',1).")";

dol_syslog(get_class($this).'::containing sql='.$sql);
dol_syslog(get_class($this).'::containing', LOG_DEBUG);
$res = $this->db->query($sql);
if ($res)
{
Expand Down Expand Up @@ -1227,7 +1216,6 @@ function rechercher($id, $nom, $type, $exact = false, $case = false)
else
{
$this->error=$this->db->error().' sql='.$sql;
dol_syslog(get_class($this)."::rechercher ".$this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -1447,11 +1435,10 @@ function setMultiLangs()
$sql2.= " VALUES(".$this->id.",'".$key."','". $this->db->escape($this->label);
$sql2.= "','".$this->db->escape($this->multilangs["$key"]["description"])."')";
}
dol_syslog(get_class($this).'::setMultiLangs sql='.$sql2);
dol_syslog(get_class($this).'::setMultiLangs', LOG_DEBUG);
if (! $this->db->query($sql2))
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this).'::setMultiLangs error='.$this->error, LOG_ERR);
return -1;
}
}
Expand All @@ -1473,11 +1460,10 @@ function setMultiLangs()

// on ne sauvegarde pas des champs vides
if ( $this->multilangs["$key"]["label"] || $this->multilangs["$key"]["description"] || $this->multilangs["$key"]["note"] )
dol_syslog(get_class($this).'::setMultiLangs sql='.$sql2);
dol_syslog(get_class($this).'::setMultiLangs', LOG_DEBUG);
if (! $this->db->query($sql2))
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this).'::setMultiLangs error='.$this->error, LOG_ERR);
return -1;
}
}
Expand Down
18 changes: 7 additions & 11 deletions htdocs/comm/action/class/actioncomm.class.php
Expand Up @@ -202,7 +202,7 @@ function add($user,$notrigger=0)
$sql.= $conf->entity;
$sql.= ")";

dol_syslog(get_class($this)."::add sql=".$sql);
dol_syslog(get_class($this)."::add", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -252,7 +252,6 @@ function add($user,$notrigger=0)
{
$this->db->rollback();
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::add ".$this->error,LOG_ERR);
return -1;
}

Expand Down Expand Up @@ -292,7 +291,7 @@ function fetch($id)
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc";
$sql.= " WHERE a.id=".$id." AND a.fk_action=c.id";

dol_syslog(get_class($this)."::fetch sql=".$sql);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -369,7 +368,7 @@ function delete($notrigger=0)
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm";
$sql.= " WHERE id=".$this->id;

dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$res=$this->db->query($sql);
if ($res < 0) {
$this->error=$this->db->lasterror();
Expand Down Expand Up @@ -415,7 +414,6 @@ function delete($notrigger=0)
{
$this->db->rollback();
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::delete ".$this->error,LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -477,7 +475,7 @@ function update($user,$notrigger=0)
$sql.= ", fk_user_done=".($this->userdone->id > 0 ? "'".$this->userdone->id."'":"null");
$sql.= " WHERE id=".$this->id;

dol_syslog(get_class($this)."::update sql=".$sql);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
if ($this->db->query($sql))
{

Expand Down Expand Up @@ -526,7 +524,6 @@ function update($user,$notrigger=0)
{
$this->db->rollback();
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -558,7 +555,7 @@ static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filte
}
if (! empty($filter)) $sql.= $filter;

dol_syslog(get_class()."::getActions sql=".$sql);
dol_syslog(get_class()."::getActions", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -644,7 +641,7 @@ function info($id)
$sql.= ' FROM '.MAIN_DB_PREFIX.'actioncomm as a';
$sql.= ' WHERE a.id = '.$id;

dol_syslog(get_class($this)."::info sql=".$sql);
dol_syslog(get_class($this)."::info", LOG_DEBUG);
$result=$this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -930,7 +927,7 @@ function build_exportfile($format,$type,$cachedelay,$filename,$filters)
$sql.= " ORDER by datep";
//print $sql;exit;

dol_syslog(get_class($this)."::build_exportfile select events sql=".$sql);
dol_syslog(get_class($this)."::build_exportfile select events", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -976,7 +973,6 @@ function build_exportfile($format,$type,$cachedelay,$filename,$filters)
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::build_exportfile ".$this->db->lasterror(), LOG_ERR);
return -1;
}

Expand Down
4 changes: 2 additions & 2 deletions htdocs/comm/action/class/cactioncomm.class.php
Expand Up @@ -64,7 +64,7 @@ function fetch($id)
if (is_numeric($id)) $sql.= " WHERE id=".$id;
else $sql.= " WHERE code='".$id."'";

dol_syslog(get_class($this)."::fetch sql=".$sql);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -117,7 +117,7 @@ function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0)
if (! empty($excludetype)) $sql.=($active != ''?" AND":" WHERE")." type <> '".$excludetype."'";
$sql.= " ORDER BY module, position";

dol_syslog(get_class($this)."::liste_array sql=".$sql);
dol_syslog(get_class($this)."::liste_array", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down
4 changes: 2 additions & 2 deletions htdocs/comm/action/index.php
Expand Up @@ -445,7 +445,7 @@
$sql.= ' ORDER BY datep';
//print $sql;

dol_syslog("comm/action/index.php sql=".$sql, LOG_DEBUG);
dol_syslog("comm/action/index.php", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -557,7 +557,7 @@
}
$sql.= ' ORDER BY birthday';

dol_syslog("comm/action/index.php sql=".$sql, LOG_DEBUG);
dol_syslog("comm/action/index.php", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/action/listactions.php
Expand Up @@ -182,7 +182,7 @@
$sql.= $db->plimit($limit + 1, $offset);
//print $sql;

dol_syslog("comm/action/listactions.php sql=".$sql);
dol_syslog("comm/action/listactions.php", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/action/rapport/index.php
Expand Up @@ -89,7 +89,7 @@
$sql.= $db->plimit($limit+1,$offset);

//print $sql;
dol_syslog("select sql=".$sql);
dol_syslog("select", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/list.php
Expand Up @@ -149,7 +149,7 @@
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($conf->liste_limit +1, $offset);

dol_syslog('comm/list.php: sql='.$sql,LOG_DEBUG);
dol_syslog('comm/list.php:', LOG_DEBUG);
$result = $db->query($sql);
if ($result)
{
Expand Down
21 changes: 7 additions & 14 deletions htdocs/comm/mailing/class/mailing.class.php
Expand Up @@ -118,7 +118,7 @@ function create($user)
$this->titre = $langs->trans("NoTitle");
}

dol_syslog("Mailing::Create sql=".$sql);
dol_syslog("Mailing::Create", LOG_DEBUG);
$result=$this->db->query($sql);
if ($result)
{
Expand All @@ -131,7 +131,6 @@ function create($user)
else
{
$this->error=$this->db->lasterror();
dol_syslog("Mailing::Create ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
Expand All @@ -141,7 +140,6 @@ function create($user)
else
{
$this->error=$this->db->lasterror();
dol_syslog("Mailing::Create ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
Expand All @@ -166,7 +164,7 @@ function update($user)
$sql .= ", bgimage = '".($this->bgimage?$this->bgimage:null)."'";
$sql .= " WHERE rowid = ".$this->id;

dol_syslog("Mailing::Update sql=".$sql);
dol_syslog("Mailing::Update", LOG_DEBUG);
$result=$this->db->query($sql);
if ($result)
{
Expand All @@ -175,7 +173,6 @@ function update($user)
else
{
$this->error=$this->db->lasterror();
dol_syslog("Mailing::Update ".$this->error, LOG_ERR);
return -1;
}
}
Expand All @@ -201,7 +198,7 @@ function fetch($rowid)
$sql.= " FROM ".MAIN_DB_PREFIX."mailing as m";
$sql.= " WHERE m.rowid = ".$rowid;

dol_syslog(get_class($this)."::fetch sql=".$sql);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result=$this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -334,7 +331,7 @@ function createFromClone($fromid,$option1,$option2)
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles ";
$sql.= " WHERE fk_mailing = ".$fromid;

dol_syslog(get_class($this)."::createFromClone sql=".$sql);
dol_syslog(get_class($this)."::createFromClone", LOG_DEBUG);
$result=$this->db->query($sql);
if ($result)
{
Expand All @@ -357,7 +354,6 @@ function createFromClone($fromid,$option1,$option2)
else
{
$this->error=$this->db->lasterror();
dol_syslog("Mailing::createFromClone ".$this->error, LOG_ERR);
return -1;
}

Expand Down Expand Up @@ -393,15 +389,14 @@ function valid($user)
$sql .= " SET statut = 1, date_valid = '".$this->db->idate($now)."', fk_user_valid=".$user->id;
$sql .= " WHERE rowid = ".$this->id;

dol_syslog("Mailing::valid sql=".$sql, LOG_DEBUG);
dol_syslog("Mailing::valid", LOG_DEBUG);
if ($this->db->query($sql))
{
return 1;
}
else
{
$this->error=$this->db->lasterror();
dol_syslog("Mailing::Valid ".$this->error, LOG_ERR);
return -1;
}
}
Expand All @@ -418,7 +413,7 @@ function delete($rowid)
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing";
$sql.= " WHERE rowid = ".$rowid;

dol_syslog("Mailing::delete sql=".$sql, LOG_DEBUG);
dol_syslog("Mailing::delete", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand All @@ -427,7 +422,6 @@ function delete($rowid)
else
{
$this->error=$this->db->lasterror();
dol_syslog("Mailing::Valid ".$this->error, LOG_ERR);
return -1;
}
}
Expand All @@ -445,7 +439,7 @@ function reset_targets_status($user)
$sql.= " SET statut = 0";
$sql.= " WHERE fk_mailing = ".$this->id;

dol_syslog("Mailing::reset_targets_status sql=".$sql, LOG_DEBUG);
dol_syslog("Mailing::reset_targets_status", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand All @@ -454,7 +448,6 @@ function reset_targets_status($user)
else
{
$this->error=$this->db->lasterror();
dol_syslog("Mailing::Valid ".$this->error, LOG_ERR);
return -1;
}
}
Expand Down
8 changes: 4 additions & 4 deletions htdocs/comm/mailing/fiche.php
Expand Up @@ -173,7 +173,7 @@
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
$sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$object->id;

dol_syslog("fiche.php: select targets sql=".$sql, LOG_DEBUG);
dol_syslog("fiche.php: select targets", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -295,7 +295,7 @@
{
//Update status communication of thirdparty prospect
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT source_id FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE rowid=".$obj->rowid.")";
dol_syslog("fiche.php: set prospect thirdparty status sql=".$sql, LOG_DEBUG);
dol_syslog("fiche.php: set prospect thirdparty status", LOG_DEBUG);
$resql2=$db->query($sql);
if (! $resql2)
{
Expand All @@ -304,7 +304,7 @@

//Update status communication of contact prospect
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm=2 WHERE rowid IN (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."socpeople AS sc INNER JOIN ".MAIN_DB_PREFIX."mailing_cibles AS mc ON mc.rowid=".$obj->rowid." AND mc.source_type = 'contact' AND mc.source_id = sc.rowid)";
dol_syslog("fiche.php: set prospect contact status sql=".$sql, LOG_DEBUG);
dol_syslog("fiche.php: set prospect contact status", LOG_DEBUG);

$resql2=$db->query($sql);
if (! $resql2)
Expand Down Expand Up @@ -363,7 +363,7 @@
}

$sql="UPDATE ".MAIN_DB_PREFIX."mailing SET statut=".$statut." WHERE rowid=".$object->id;
dol_syslog("comm/mailing/fiche.php: update global status sql=".$sql, LOG_DEBUG);
dol_syslog("comm/mailing/fiche.php: update global status", LOG_DEBUG);
$resql2=$db->query($sql);
if (! $resql2)
{
Expand Down
1 change: 0 additions & 1 deletion htdocs/comm/mailing/liste.php
Expand Up @@ -82,7 +82,6 @@
$sql.= $db->plimit($conf->liste_limit +1, $offset);
}

dol_syslog("sql=".$sql);
//print $sql;
$result = $db->query($sql);
if ($result)
Expand Down
43 changes: 12 additions & 31 deletions htdocs/comm/propal/class/propal.class.php
Expand Up @@ -443,7 +443,6 @@ function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $f
else
{
$this->error=$this->db->error();
dol_syslog("Error sql=$sql, error=".$this->error,LOG_ERR);
$this->db->rollback();
return -1;
}
Expand Down Expand Up @@ -597,7 +596,6 @@ function updateline($rowid, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0,
{
$this->error=$this->db->error();
$this->db->rollback();
dol_syslog(get_class($this)."::updateline Error=".$this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -749,7 +747,7 @@ function create($user='', $notrigger=0)
$sql.= ", ".$conf->entity;
$sql.= ")";

dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand All @@ -760,7 +758,7 @@ function create($user='', $notrigger=0)
$this->ref='(PROV'.$this->id.')';
$sql = 'UPDATE '.MAIN_DB_PREFIX."propal SET ref='".$this->ref."' WHERE rowid=".$this->id;

dol_syslog(get_class($this)."::create sql=".$sql);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql) $error++;

Expand Down Expand Up @@ -888,15 +886,13 @@ function create($user='', $notrigger=0)
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::create -2 ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
}
}
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::create -1 ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
Expand Down Expand Up @@ -1075,7 +1071,7 @@ function fetch($rowid,$ref='')
if ($ref) $sql.= " AND p.ref='".$ref."'";
else $sql.= " AND p.rowid=".$rowid;

dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -1226,7 +1222,6 @@ function fetch($rowid,$ref='')
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR);
return -1;
}

Expand All @@ -1246,7 +1241,6 @@ function fetch($rowid,$ref='')
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -1327,7 +1321,7 @@ function valid($user, $notrigger=0)
$sql.= " fk_statut = 1, date_valid='".$this->db->idate($now)."', fk_user_valid=".$user->id;
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";

dol_syslog(get_class($this).'::valid sql='.$sql);
dol_syslog(get_class($this).'::valid', LOG_DEBUG);
if ($this->db->query($sql))
{
if (! $notrigger)
Expand Down Expand Up @@ -1412,7 +1406,7 @@ function set_date($user, $date)
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET datep = '".$this->db->idate($date)."'";
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";

dol_syslog(get_class($this)."::set_date sql=".$sql);
dol_syslog(get_class($this)."::set_date", LOG_DEBUG);
if ($this->db->query($sql) )
{
$this->date = $date;
Expand All @@ -1422,7 +1416,6 @@ function set_date($user, $date)
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::set_date ".$this->error, LOG_ERR);
return -1;
}
}
Expand All @@ -1449,7 +1442,6 @@ function set_echeance($user, $date_fin_validite)
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::set_echeance Erreur SQL".$this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -1602,7 +1594,6 @@ function set_remise_percent($user, $remise)
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::set_remise_percent Error sql=$sql");
return -1;
}
}
Expand Down Expand Up @@ -1637,7 +1628,6 @@ function set_remise_absolue($user, $remise)
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::set_remise_absolue Error sql=$sql");
return -1;
}
}
Expand Down Expand Up @@ -1669,7 +1659,7 @@ function reopen($user, $statut, $note='', $notrigger=0)

$this->db->begin();

dol_syslog(get_class($this)."::reopen sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::reopen", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql) {
$error++; $this->errors[]="Error ".$this->db->lasterror();
Expand Down Expand Up @@ -1995,7 +1985,7 @@ function InvoiceArrayList($id)
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
$sql.= " WHERE rowid IN (".implode(',',$linkedInvoices).")";

dol_syslog(get_class($this)."::InvoiceArrayList sql=".$sql);
dol_syslog(get_class($this)."::InvoiceArrayList", LOG_DEBUG);
$resql=$this->db->query($sql);

if ($resql)
Expand Down Expand Up @@ -2135,31 +2125,27 @@ function delete($user, $notrigger=0)
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
$this->db->rollback();
return 0;
}
}
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
$this->db->rollback();
return -3;
}
}
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
}
}
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
Expand Down Expand Up @@ -2640,7 +2626,7 @@ function getLinesArray()
$sql.= ' WHERE pt.fk_propal = '.$this->id;
$sql.= ' ORDER BY pt.rang ASC, pt.rowid';

dol_syslog(get_class($this).'::getLinesArray sql='.$sql,LOG_DEBUG);
dol_syslog(get_class($this).'::getLinesArray', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -2691,7 +2677,6 @@ function getLinesArray()
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::getLinesArray Error sql=$sql, error=".$this->error,LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -2928,7 +2913,7 @@ function insert($notrigger=0)
$sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null");
$sql.= ')';

dol_syslog(get_class($this).'::insert sql='.$sql, LOG_DEBUG);
dol_syslog(get_class($this).'::insert', LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -2962,7 +2947,6 @@ function insert($notrigger=0)
else
{
$this->error=$this->db->error()." sql=".$sql;
dol_syslog(get_class($this).'::insert Error '.$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
Expand All @@ -2981,7 +2965,7 @@ function delete()
$this->db->begin();

$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".$this->rowid;
dol_syslog("PropaleLigne::delete sql=".$sql, LOG_DEBUG);
dol_syslog("PropaleLigne::delete", LOG_DEBUG);
if ($this->db->query($sql) )
{

Expand Down Expand Up @@ -3013,7 +2997,6 @@ function delete()
else
{
$this->error=$this->db->error()." sql=".$sql;
dol_syslog("PropaleLigne::delete Error ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
Expand Down Expand Up @@ -3092,7 +3075,7 @@ function update($notrigger=0)
$sql.= " , date_end=".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null");
$sql.= " WHERE rowid = ".$this->rowid;

dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -3124,7 +3107,6 @@ function update($notrigger=0)
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::update Error ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
}
Expand All @@ -3147,7 +3129,7 @@ function update_total()
$sql.= ",total_ttc=".price2num($this->total_ttc,'MT')."";
$sql.= " WHERE rowid = ".$this->rowid;

dol_syslog("PropaleLigne::update_total sql=$sql");
dol_syslog("PropaleLigne::update_total", LOG_DEBUG);

$resql=$this->db->query($sql);
if ($resql)
Expand All @@ -3158,7 +3140,6 @@ function update_total()
else
{
$this->error=$this->db->error();
dol_syslog("PropaleLigne::update_total Error ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/prospect/list.php
Expand Up @@ -233,7 +233,7 @@
$sql.= " ORDER BY $sortfield $sortorder, s.nom ASC";
$sql.= $db->plimit($conf->liste_limit+1, $offset);

dol_syslog('comm/prospect/list.php sql='.$sql,LOG_DEBUG);
dol_syslog('comm/prospect/list.php', LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
Expand Down
55 changes: 18 additions & 37 deletions htdocs/commande/class/commande.class.php
Expand Up @@ -232,11 +232,10 @@ function valid($user, $idwarehouse=0)
$sql.= " fk_user_valid = ".$user->id;
$sql.= " WHERE rowid = ".$this->id;

dol_syslog(get_class($this)."::valid() sql=".$sql);
dol_syslog(get_class($this)."::valid()", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql)
{
dol_syslog(get_class($this)."::valid Echec update - 10 - sql=".$sql, LOG_ERR);
dol_print_error($this->db);
$error++;
}
Expand Down Expand Up @@ -355,7 +354,7 @@ function set_draft($user, $idwarehouse=-1)
$sql.= " SET fk_statut = 0";
$sql.= " WHERE rowid = ".$this->id;

dol_syslog(get_class($this)."::set_draft sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::set_draft", LOG_DEBUG);
if ($this->db->query($sql))
{
// If stock is decremented on validate order, we must reincrement it
Expand Down Expand Up @@ -398,7 +397,6 @@ function set_draft($user, $idwarehouse=-1)
{
$this->error=$this->db->error();
$this->db->rollback();
dol_syslog($this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -427,7 +425,7 @@ function set_reopen($user)
$sql.= ' SET fk_statut=1, facture=0';
$sql.= ' WHERE rowid = '.$this->id;

dol_syslog(get_class($this)."::set_reopen sql=".$sql);
dol_syslog(get_class($this)."::set_reopen", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -515,7 +513,6 @@ function cloture($user)
else
{
$this->error=$this->db->lasterror();
dol_syslog($this->error, LOG_ERR);

$this->db->rollback();
return -1;
Expand Down Expand Up @@ -543,7 +540,7 @@ function cancel($idwarehouse=-1)
$sql.= " WHERE rowid = ".$this->id;
$sql.= " AND fk_statut = 1";

dol_syslog(get_class($this)."::cancel sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::cancel", LOG_DEBUG);
if ($this->db->query($sql))
{
// If stock is decremented on validate order, we must reincrement it
Expand Down Expand Up @@ -602,7 +599,6 @@ function cancel($idwarehouse=-1)
{
$this->error=$this->db->error();
$this->db->rollback();
dol_syslog($this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -686,7 +682,7 @@ function create($user, $notrigger=0)
$sql.= ", ".$conf->entity;
$sql.= ")";

dol_syslog(get_class($this)."::create sql=".$sql);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -1352,7 +1348,7 @@ function fetch($id, $ref='', $ref_ext='', $ref_int='')
if ($ref_ext) $sql.= " AND c.ref_ext='".$this->db->escape($ref_ext)."'";
if ($ref_int) $sql.= " AND c.ref_int='".$this->db->escape($ref_int)."'";

dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -1427,13 +1423,11 @@ function fetch($id, $ref='', $ref_ext='', $ref_int='')
else
{
$this->error='Order with id '.$id.' not found sql='.$sql;
dol_syslog(get_class($this).'::fetch '.$this->error);
return 0;
}
}
else
{
dol_syslog(get_class($this).'::fetch Error rowid='.$id, LOG_ERR);
$this->error=$this->db->error();
return -1;
}
Expand Down Expand Up @@ -1536,7 +1530,7 @@ function fetch_lines($only_product=0)
if ($only_product) $sql .= ' AND p.fk_product_type = 0';
$sql .= ' ORDER BY l.rang';

dol_syslog(get_class($this)."::fetch_lines sql=".$sql,LOG_DEBUG);
dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -1601,7 +1595,6 @@ function fetch_lines($only_product=0)
else
{
$this->error=$this->db->error();
dol_syslog('Commande::fetch_lines: Error '.$this->error, LOG_ERR);
return -3;
}
}
Expand Down Expand Up @@ -1663,7 +1656,7 @@ function loadExpeditions($filtre_statut=-1)
$sql.= ' GROUP BY cd.rowid, cd.fk_product';
//print $sql;

dol_syslog(get_class($this)."::loadExpeditions sql=".$sql,LOG_DEBUG);
dol_syslog(get_class($this)."::loadExpeditions", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand All @@ -1681,7 +1674,6 @@ function loadExpeditions($filtre_statut=-1)
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::loadExpeditions ".$this->error,LOG_ERR);
return -1;
}

Expand Down Expand Up @@ -1896,7 +1888,7 @@ function set_remise_absolue($user, $remise)
$sql.= ' SET remise_absolue = '.$remise;
$sql.= ' WHERE rowid = '.$this->id.' AND fk_statut = 0 ;';

dol_syslog(get_class($this)."::set_remise_absolue sql=$sql");
dol_syslog(get_class($this)."::set_remise_absolue", LOG_DEBUG);

if ($this->db->query($sql))
{
Expand Down Expand Up @@ -1928,7 +1920,7 @@ function set_date($user, $date)
$sql.= " SET date_commande = ".($date ? $this->db->idate($date) : 'null');
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";

dol_syslog(get_class($this)."::set_date sql=$sql",LOG_DEBUG);
dol_syslog(get_class($this)."::set_date",LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand All @@ -1938,7 +1930,6 @@ function set_date($user, $date)
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::set_date ".$this->error,LOG_ERR);
return -1;
}
}
Expand All @@ -1963,7 +1954,7 @@ function set_date_livraison($user, $date_livraison)
$sql.= " SET date_livraison = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null');
$sql.= " WHERE rowid = ".$this->id;

dol_syslog(get_class($this)."::set_date_livraison sql=".$sql,LOG_DEBUG);
dol_syslog(get_class($this)."::set_date_livraison", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand All @@ -1973,7 +1964,6 @@ function set_date_livraison($user, $date_livraison)
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::set_date_livraison ".$this->error,LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -2207,7 +2197,6 @@ function set_ref_client($user, $ref_client)
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this).'::set_ref_client Erreur '.$this->error.' - '.$sql, LOG_ERR);
return -2;
}
}
Expand All @@ -2231,7 +2220,7 @@ function classifyBilled()
$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande SET facture = 1';
$sql.= ' WHERE rowid = '.$this->id.' AND fk_statut > 0';

dol_syslog(get_class($this)."::classifyBilled sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::classifyBilled", LOG_DEBUG);
if ($this->db->query($sql))
{
// Appel des triggers
Expand Down Expand Up @@ -2267,7 +2256,6 @@ function classifyBilled()
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::classifyBilled Error ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
Expand Down Expand Up @@ -2474,19 +2462,17 @@ function delete($user, $notrigger=0)
{
// Delete order details
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE fk_commande = ".$this->id;
dol_syslog(get_class($this)."::delete sql=".$sql);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
if (! $this->db->query($sql) )
{
dol_syslog(get_class($this)."::delete error", LOG_ERR);
$error++;
}

// Delete order
$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commande WHERE rowid = ".$this->id;
dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
if (! $this->db->query($sql) )
{
dol_syslog(get_class($this)."::delete error", LOG_ERR);
$error++;
}

Expand Down Expand Up @@ -3025,7 +3011,6 @@ function getLinesArray()
else
{
$this->error=$this->db->error();
dol_syslog("Error sql=$sql, error=".$this->error,LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -3191,7 +3176,7 @@ function delete()

$sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE rowid='".$this->rowid."';";

dol_syslog("OrderLine::delete sql=".$sql);
dol_syslog("OrderLine::delete", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -3230,7 +3215,6 @@ function delete()
else
{
$this->error=$this->db->lasterror();
dol_syslog("OrderLine::delete ".$this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -3315,7 +3299,7 @@ function insert($notrigger=0)
$sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null");
$sql.= ')';

dol_syslog(get_class($this)."::insert sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::insert", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -3357,7 +3341,6 @@ function insert($notrigger=0)
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
}
Expand Down Expand Up @@ -3435,7 +3418,7 @@ function update($notrigger=0)
if (! empty($this->rang)) $sql.= ", rang=".$this->rang;
$sql.= " WHERE rowid = ".$this->rowid;

dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -3475,7 +3458,6 @@ function update($notrigger=0)
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::update Error ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
}
Expand Down Expand Up @@ -3503,7 +3485,7 @@ function update_total()
$sql.= ",total_ttc='".price2num($this->total_ttc)."'";
$sql.= " WHERE rowid = ".$this->rowid;

dol_syslog("OrderLine::update_total sql=$sql");
dol_syslog("OrderLine::update_total", LOG_DEBUG);

$resql=$this->db->query($sql);
if ($resql)
Expand All @@ -3514,7 +3496,6 @@ function update_total()
else
{
$this->error=$this->db->error();
dol_syslog("OrderLine::update_total Error ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/compta/bank/account.php
Expand Up @@ -241,7 +241,7 @@
$sql.= " AND ba.entity = ".$conf->entity;
$sql.= $sql_rech;

dol_syslog("account.php count transactions - sql=".$sql, LOG_DEBUG);
dol_syslog("account.php count transactions -", LOG_DEBUG);
$result=$db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -485,7 +485,7 @@
$sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day
$sql.= $db->plimit($limitsql, 0);

dol_syslog("account.php get transactions - sql=".$sql, LOG_DEBUG);
dol_syslog("account.php get transactions -", LOG_DEBUG);
$result = $db->query($sql);
if ($result)
{
Expand Down
3 changes: 0 additions & 3 deletions htdocs/compta/bank/categ.php
Expand Up @@ -52,7 +52,6 @@
$sql.= ", ".$conf->entity;
$sql.= ")";

dol_syslog("sql=".$sql);
$result = $db->query($sql);
if (!$result)
{
Expand All @@ -73,7 +72,6 @@
$sql.= " WHERE rowid = '".GETPOST('categid')."'";
$sql.= " AND entity = ".$conf->entity;

dol_syslog("sql=".$sql);
$result = $db->query($sql);
if (!$result)
{
Expand All @@ -92,7 +90,6 @@
$sql.= " WHERE rowid = '".GETPOST('categid')."'";
$sql.= " AND entity = ".$conf->entity;

dol_syslog("sql=".$sql);
$result = $db->query($sql);
if (!$result)
{
Expand Down
36 changes: 15 additions & 21 deletions htdocs/compta/bank/class/account.class.php
Expand Up @@ -147,7 +147,7 @@ function add_url_line($line_id, $url_id, $url, $label, $type)
$sql.= ", '".$type."'";
$sql.= ")";

dol_syslog(get_class($this)."::add_url_line sql=".$sql);
dol_syslog(get_class($this)."::add_url_line", LOG_DEBUG);
if ($this->db->query($sql))
{
$rowid = $this->db->last_insert_id(MAIN_DB_PREFIX."bank_url");
Expand All @@ -156,7 +156,6 @@ function add_url_line($line_id, $url_id, $url, $label, $type)
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::add_url_line ".$this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -190,7 +189,7 @@ function get_url($fk_bank='', $url_id='', $type='')
}
$sql.= " ORDER BY type, label";

dol_syslog(get_class($this)."::get_url sql=".$sql);
dol_syslog(get_class($this)."::get_url", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -303,7 +302,7 @@ function addline($date, $oper, $label, $amount, $num_chq, $categorie, $user, $em
$sql.= ", ".($banque?"'".$this->db->escape($banque)."'":"null");
$sql.= ")";

dol_syslog(get_class($this)."::addline sql=".$sql);
dol_syslog(get_class($this)."::addline", LOG_DEBUG);
if ($this->db->query($sql))
{
$rowid = $this->db->last_insert_id(MAIN_DB_PREFIX."bank");
Expand Down Expand Up @@ -331,7 +330,6 @@ function addline($date, $oper, $label, $amount, $num_chq, $categorie, $user, $em
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::addline ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
}
Expand Down Expand Up @@ -407,7 +405,7 @@ function create()
$sql.= ", ".$this->country_id;
$sql.= ")";

dol_syslog(get_class($this)."::create sql=".$sql);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -440,7 +438,6 @@ function create()
if (! $resql)
{
$this->error=$this->db->lasterror();
dol_syslog($this->error, LOG_ERR);
return -3;
}
}
Expand All @@ -451,12 +448,10 @@ function create()
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
{
$this->error=$langs->trans("ErrorBankLabelAlreadyExists");
dol_syslog($this->error, LOG_ERR);
return -1;
}
else {
$this->error=$this->db->error()." sql=".$sql;
dol_syslog($this->error, LOG_ERR);
return -2;
}
}
Expand Down Expand Up @@ -517,7 +512,7 @@ function update($user='')
$sql.= " WHERE rowid = ".$this->id;
$sql.= " AND entity = ".$conf->entity;

dol_syslog(get_class($this)."::update sql=".$sql);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -574,7 +569,7 @@ function update_bban($user='')
$sql.= " WHERE rowid = ".$this->id;
$sql.= " AND entity = ".$conf->entity;

dol_syslog(get_class($this)."::update_bban sql=$sql");
dol_syslog(get_class($this)."::update_bban", LOG_DEBUG);

$result = $this->db->query($sql);
if ($result)
Expand Down Expand Up @@ -621,7 +616,7 @@ function fetch($id,$ref='')
if ($id) $sql.= " AND ba.rowid = ".$id;
if ($ref) $sql.= " AND ba.ref = '".$this->db->escape($ref)."'";

dol_syslog(get_class($this)."::fetch sql=".$sql);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -696,7 +691,7 @@ function delete()
$sql.= " WHERE rowid = ".$this->rowid;
$sql.= " AND entity = ".$conf->entity;

dol_syslog(get_class($this)."::delete sql=".$sql);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result) {
return 1;
Expand Down Expand Up @@ -1096,7 +1091,7 @@ function fetch($rowid,$ref='',$num='')
else if ($ref) $sql.= " AND b.rowid='".$this->db->escape($ref)."'";
else $sql.= " AND b.rowid=".$rowid;

dol_syslog(get_class($this)."::fetch sql=".$sql);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -1171,12 +1166,12 @@ function delete($user=0)
}

$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid=".$this->rowid;
dol_syslog(get_class($this)."::delete sql=".$sql);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$result = $this->db->query($sql);
if (! $result) $nbko++;

$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank WHERE rowid=".$this->rowid;
dol_syslog(get_class($this)."::delete sql=".$sql);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$result = $this->db->query($sql);
if (! $result) $nbko++;

Expand Down Expand Up @@ -1213,7 +1208,7 @@ function delete_urls($user=0)
$this->db->begin();

$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=".$this->rowid;
dol_syslog(get_class($this)."::delete_urls sql=".$sql);
dol_syslog(get_class($this)."::delete_urls", LOG_DEBUG);
$result = $this->db->query($sql);
if (! $result) $nbko++;

Expand Down Expand Up @@ -1247,7 +1242,7 @@ function update($user,$notrigger=0)
$sql.= " dateo='".$this->db->idate($this->dateo)."'";
$sql.= " WHERE rowid = ".$this->rowid;

dol_syslog(get_class($this)."::update sql=".$sql);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand All @@ -1258,7 +1253,6 @@ function update($user,$notrigger=0)
{
$this->db->rollback();
$this->error=$this->db->error();
dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR);
return -1;
}
}
Expand All @@ -1281,7 +1275,7 @@ function update_conciliation($user,$cat)
$sql.= ", fk_user_rappro = ".$user->id;
$sql.= " WHERE rowid = ".$this->id;

dol_syslog(get_class($this)."::update_conciliation sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::update_conciliation", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand All @@ -1295,7 +1289,7 @@ function update_conciliation($user,$cat)
$sql.= ", ".$cat;
$sql.= ")";

dol_syslog(get_class($this)."::update_conciliation sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::update_conciliation", LOG_DEBUG);
$resql = $this->db->query($sql);

// No error check. Can fail if category already affected
Expand Down
9 changes: 4 additions & 5 deletions htdocs/compta/bank/class/bankcateg.class.php
Expand Up @@ -84,7 +84,7 @@ function create($user, $notrigger=0)

$this->db->begin();

dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }

Expand Down Expand Up @@ -142,7 +142,7 @@ function fetch($id)
$sql.= " WHERE t.rowid = ".$id;
$sql.= " AND t.entity = ".$conf->entity;

dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand All @@ -160,7 +160,6 @@ function fetch($id)
else
{
$this->error="Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -192,7 +191,7 @@ function update($user=0, $notrigger=0)

$this->db->begin();

dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }

Expand Down Expand Up @@ -249,7 +248,7 @@ function delete($user, $notrigger=0)

$this->db->begin();

dol_syslog(get_class($this)."::delete sql=".$sql);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }

Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/bank/ligne.php
Expand Up @@ -175,7 +175,7 @@
else $sql.=", rappro = ".$rappro;
$sql.= " WHERE rowid = ".$rowid;

dol_syslog("ligne.php sql=".$sql, LOG_DEBUG);
dol_syslog("ligne.php", LOG_DEBUG);
$result = $db->query($sql);
if ($result)
{
Expand Down
5 changes: 2 additions & 3 deletions htdocs/compta/bank/releve.php
Expand Up @@ -189,7 +189,7 @@
$sql.= " AND b.fk_account = ".$acct->id;
$sql.= " ORDER BY b.num_releve DESC";

dol_syslog("htdocs/compta/bank/releve.php sql=".$sql);
dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
Expand All @@ -211,7 +211,7 @@
$sql.= " AND b.fk_account = ".$acct->id;
$sql.= " ORDER BY b.num_releve ASC";

dol_syslog("htdocs/compta/bank/releve.php sql=".$sql);
dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -277,7 +277,6 @@
$sql.= " AND b.fk_account = ba.rowid";
$sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day

dol_syslog("sql=".$sql);
$result = $db->query($sql);
if ($result)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/bank/search.php
Expand Up @@ -145,7 +145,7 @@
$sql.= $db->plimit($limit+1,$offset);
//print $sql;

dol_syslog('compta/bank/search.php:: sql='.$sql);
dol_syslog('compta/bank/search.php::', LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/charges/index.php
Expand Up @@ -207,7 +207,7 @@
//$sql.= $db->plimit($limit+1,$offset);
//print $sql;

dol_syslog("compta/charges/index.php: select payment sql=".$sql);
dol_syslog("compta/charges/index.php: select payment", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down
12 changes: 6 additions & 6 deletions htdocs/compta/deplacement/class/deplacement.class.php
Expand Up @@ -120,7 +120,7 @@ function create($user)
$sql.= ", ".($this->fk_soc > 0? $this->fk_soc : "null");
$sql.= ")";

dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -203,7 +203,7 @@ function update($user)
$sql .= " , fk_projet = ".($this->fk_project>0?$this->fk_project:0);
$sql .= " WHERE rowid = ".$this->id;

dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand All @@ -230,7 +230,7 @@ function fetch($id)
$sql.= " FROM ".MAIN_DB_PREFIX."deplacement";
$sql.= " WHERE rowid = ".$id;

dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result = $this->db->query($sql);
if ( $result )
{
Expand Down Expand Up @@ -271,7 +271,7 @@ function delete($id)

$sql = "DELETE FROM ".MAIN_DB_PREFIX."deplacement WHERE rowid = ".$id;

dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -381,7 +381,7 @@ function listOfTypes($active=1)
$sql.= " FROM ".MAIN_DB_PREFIX."c_type_fees";
$sql.= " WHERE active = ".$active;

dol_syslog(get_class($this)."::listOfTypes sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::listOfTypes", LOG_DEBUG);
$result = $this->db->query($sql);
if ( $result )
{
Expand Down Expand Up @@ -415,7 +415,7 @@ function info($id)
$sql.= ' FROM '.MAIN_DB_PREFIX.'deplacement as c';
$sql.= ' WHERE c.rowid = '.$id;

dol_syslog(get_class($this).'::info sql='.$sql);
dol_syslog(get_class($this).'::info', LOG_DEBUG);
$result = $this->db->query($sql);

if ($result)
Expand Down
10 changes: 3 additions & 7 deletions htdocs/compta/dons/class/don.class.php
Expand Up @@ -354,7 +354,7 @@ function create($user)
$sql.= ", '".$this->db->escape($this->phone_mobile)."'";
$sql.= ")";

dol_syslog("Don::create sql=".$sql, LOG_DEBUG);
dol_syslog("Don::create", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -414,7 +414,7 @@ function update($user)
$sql .= ",fk_statut=".$this->statut;
$sql .= " WHERE rowid = $this->id";

dol_syslog("Don::update sql=".$sql);
dol_syslog("Don::update", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -478,7 +478,7 @@ function fetch($rowid,$ref='')
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as cp ON cp.id = d.fk_paiement";
$sql.= " WHERE d.rowid = ".$rowid." AND d.entity = ".$conf->entity;

dol_syslog(get_class($this)."::fetch sql=".$sql);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -535,7 +535,6 @@ function valid_promesse($rowid, $userid)

$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 1, fk_user_valid = $userid WHERE rowid = $rowid AND fk_statut = 0";

dol_syslog("sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -571,7 +570,6 @@ function set_paye($rowid, $modepaiement='')
}
$sql .= " WHERE rowid = $rowid AND fk_statut = 1";

dol_syslog("sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -603,7 +601,6 @@ function set_encaisse($rowid)

$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 3 WHERE rowid = $rowid AND fk_statut = 2";

dol_syslog("sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -633,7 +630,6 @@ function set_cancel($rowid)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = -1 WHERE rowid = ".$rowid;

dol_syslog("sql=".$sql);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down
8 changes: 2 additions & 6 deletions htdocs/compta/facture/class/facture-rec.class.php
Expand Up @@ -216,7 +216,7 @@ function fetch($rowid)
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = f.rowid AND el.targettype = 'facture'";
$sql.= ' WHERE f.rowid='.$rowid;

dol_syslog("FactureRec::Fetch rowid=".$rowid." sql=".$sql, LOG_DEBUG);
dol_syslog("FactureRec::Fetch rowid=".$rowid."", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -269,7 +269,6 @@ function fetch($rowid)
if ($result < 0)
{
$this->error=$this->db->error();
dol_syslog('Facture::Fetch Error '.$this->error, LOG_ERR);
return -3;
}
return 1;
Expand All @@ -284,7 +283,6 @@ function fetch($rowid)
else
{
$this->error=$this->db->error();
dol_syslog('Facture::Fetch Error '.$this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -359,7 +357,6 @@ function fetch_lines()
else
{
$this->error=$this->db->error();
dol_syslog('Facture::fetch_lines: Error '.$this->error, LOG_ERR);
return -3;
}
}
Expand Down Expand Up @@ -497,7 +494,7 @@ function addline($desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0,
$sql.= ", ".$rang;
$sql.= ", ".$special_code.")";

dol_syslog(get_class($this)."::addline sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::addline", LOG_DEBUG);
if ($this->db->query($sql))
{
$this->id=$facid;
Expand All @@ -507,7 +504,6 @@ function addline($desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0,
else
{
$this->error=$this->db->lasterror();
dol_syslog("FactureRec::addline sql=".$this->error, LOG_ERR);
return -1;
}
}
Expand Down
68 changes: 28 additions & 40 deletions htdocs/compta/facture/class/facture.class.php
Expand Up @@ -263,7 +263,7 @@ function create($user,$notrigger=0,$forceduedate=0)
$sql.= ",".$this->mode_reglement_id;
$sql.= ", '".$this->db->idate($datelim)."', '".$this->modelpdf."')";

dol_syslog(get_class($this)."::create sql=".$sql);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand All @@ -273,7 +273,7 @@ function create($user,$notrigger=0,$forceduedate=0)
$this->ref='(PROV'.$this->id.')';
$sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET facnumber='".$this->ref."' WHERE rowid=".$this->id;

dol_syslog(get_class($this)."::create sql=".$sql);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql) $error++;

Expand Down Expand Up @@ -516,7 +516,6 @@ function create($user,$notrigger=0,$forceduedate=0)
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::create error ".$this->error." sql=".$sql, LOG_ERR);
$this->db->rollback();
return -1;
}
Expand Down Expand Up @@ -846,7 +845,7 @@ function fetch($rowid, $ref='', $ref_ext='', $ref_int='')
if ($ref_ext) $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'";
if ($ref_int) $sql.= " AND f.ref_int='".$this->db->escape($ref_int)."'";

dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -915,7 +914,6 @@ function fetch($rowid, $ref='', $ref_ext='', $ref_int='')
if ($result < 0)
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR);
return -3;
}
return 1;
Expand All @@ -930,7 +928,6 @@ function fetch($rowid, $ref='', $ref_ext='', $ref_int='')
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR);
return -1;
}
}
Expand All @@ -956,7 +953,7 @@ function fetch_lines()
$sql.= ' WHERE l.fk_facture = '.$this->id;
$sql.= ' ORDER BY l.rang';

dol_syslog(get_class($this).'::fetch_lines sql='.$sql, LOG_DEBUG);
dol_syslog(get_class($this).'::fetch_lines', LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -1016,7 +1013,6 @@ function fetch_lines()
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this).'::fetch_lines '.$this->error,LOG_ERR);
return -3;
}
}
Expand Down Expand Up @@ -1089,7 +1085,7 @@ function update($user=0, $notrigger=0)

$this->db->begin();

dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql) {
$error++; $this->errors[]="Error ".$this->db->lasterror();
Expand Down Expand Up @@ -1311,11 +1307,10 @@ function delete($rowid=0, $notrigger=0, $idwarehouse=-1)
$sql.= ' SET fk_facture = NULL, fk_facture_line = NULL';
$sql.= ' WHERE fk_facture_line IN ('.join(',',$list_rowid_det).')';

dol_syslog(get_class($this)."::delete sql=".$sql);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
if (! $this->db->query($sql))
{
$this->error=$this->db->error()." sql=".$sql;
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
$this->db->rollback();
return -5;
}
Expand Down Expand Up @@ -1344,9 +1339,15 @@ function delete($rowid=0, $notrigger=0, $idwarehouse=-1)

// Delete invoice line
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facturedet WHERE fk_facture = '.$rowid;

dol_syslog(get_class($this)."::delete", LOG_DEBUG);

if ($this->db->query($sql) && $this->delete_linked_contact())
{
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture WHERE rowid = '.$rowid;

dol_syslog(get_class($this)."::delete", LOG_DEBUG);

$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -1384,23 +1385,20 @@ function delete($rowid=0, $notrigger=0, $idwarehouse=-1)
else
{
$this->error=$this->db->lasterror()." sql=".$sql;
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
$this->db->rollback();
return -6;
}
}
else
{
$this->error=$this->db->lasterror()." sql=".$sql;
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
$this->db->rollback();
return -4;
}
}
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
}
Expand Down Expand Up @@ -1432,7 +1430,7 @@ function set_paid($user,$close_code='',$close_note='')
if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'";
$sql.= ' WHERE rowid = '.$this->id;

dol_syslog(get_class($this)."::set_paid sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::set_paid", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -1488,7 +1486,7 @@ function set_unpaid($user)
$sql.= ' SET paye=0, fk_statut=1, close_code=null, close_note=null';
$sql.= ' WHERE rowid = '.$this->id;

dol_syslog(get_class($this)."::set_unpaid sql=".$sql);
dol_syslog(get_class($this)."::set_unpaid", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -1702,11 +1700,10 @@ function validate($user, $force_number='', $idwarehouse=0)
}
$sql.= ' WHERE rowid = '.$this->id;

dol_syslog(get_class($this)."::validate sql=".$sql);
dol_syslog(get_class($this)."::validate", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql)
{
dol_syslog(get_class($this)."::validate Echec update - 10 - sql=".$sql, LOG_ERR);
dol_print_error($this->db);
$error++;
}
Expand Down Expand Up @@ -1841,7 +1838,7 @@ function set_draft($user,$idwarehouse=-1)
$sql.= " SET fk_statut = 0";
$sql.= " WHERE rowid = ".$this->id;

dol_syslog(get_class($this)."::set_draft sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::set_draft", LOG_DEBUG);
$result=$this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -2076,7 +2073,6 @@ function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $f
else
{
$this->error=$this->db->error();
dol_syslog("Error sql=$sql, error=".$this->error,LOG_ERR);
$this->db->rollback();
return -1;
}
Expand Down Expand Up @@ -2256,12 +2252,11 @@ function deleteline($rowid)
$sql.= ' SET fk_facture_line = NULL';
$sql.= ' WHERE fk_facture_line = '.$rowid;

dol_syslog(get_class($this)."::deleteline sql=".$sql);
dol_syslog(get_class($this)."::deleteline", LOG_DEBUG);
$result = $this->db->query($sql);
if (! $result)
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::deleteline Error ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
Expand Down Expand Up @@ -2351,7 +2346,7 @@ function set_remise_absolue($user, $remise)
$sql.= ' WHERE rowid = '.$this->id;
$sql.= ' AND fk_statut = 0';

dol_syslog(get_class($this)."::set_remise_absolue sql=$sql");
dol_syslog(get_class($this)."::set_remise_absolue", LOG_DEBUG);

if ($this->db->query($sql))
{
Expand Down Expand Up @@ -2396,7 +2391,7 @@ function getListOfPayments($filtertype='')
$sql.= ' AND p.fk_paiement = t.id';
if ($filtertype) $sql.=" AND t.code='PRE'";

dol_syslog(get_class($this)."::getListOfPayments sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::getListOfPayments", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -2742,7 +2737,7 @@ function list_replacable_invoices($socid=0)
if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid;
$sql.= " ORDER BY f.facnumber";

dol_syslog(get_class($this)."::list_replacable_invoices sql=$sql");
dol_syslog(get_class($this)."::list_replacable_invoices", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand All @@ -2758,7 +2753,6 @@ function list_replacable_invoices($socid=0)
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::list_replacable_invoices ".$this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -2792,7 +2786,7 @@ function list_qualified_avoir_invoices($socid=0)
if ($socid > 0) $sql.=" AND f.fk_soc = ".$socid;
$sql.= " ORDER BY f.facnumber";

dol_syslog(get_class($this)."::list_qualified_avoir_invoices sql=".$sql);
dol_syslog(get_class($this)."::list_qualified_avoir_invoices", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand All @@ -2814,7 +2808,6 @@ function list_qualified_avoir_invoices($socid=0)
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::list_avoir_invoices ".$this->error, LOG_ERR);
return -1;
}
}
Expand All @@ -2841,7 +2834,7 @@ function demande_prelevement($user)
$sql.= ' WHERE fk_facture = '.$this->id;
$sql.= ' AND traite = 0';

dol_syslog(get_class($this)."::demande_prelevement sql=".$sql);
dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -2872,7 +2865,7 @@ function demande_prelevement($user)
$sql .= ",'".$bac->number."'";
$sql .= ",'".$bac->cle_rib."')";

dol_syslog(get_class($this)."::demande_prelevement sql=".$sql);
dol_syslog(get_class($this)."::demande_prelevement", LOG_DEBUG);
if ($this->db->query($sql))
{
return 1;
Expand Down Expand Up @@ -3190,7 +3183,7 @@ function getLinesArray()
$sql.= ' WHERE l.fk_facture = '.$this->id;
$sql.= ' ORDER BY l.rang ASC, l.rowid';

dol_syslog(get_class($this).'::getLinesArray sql='.$sql,LOG_DEBUG);
dol_syslog(get_class($this).'::getLinesArray',LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -3240,7 +3233,6 @@ function getLinesArray()
else
{
$this->error=$this->db->error();
dol_syslog("Error sql=".$sql.", error=".$this->error,LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -3504,7 +3496,7 @@ function insert($notrigger=0)
$sql.= " ".price2num($this->total_localtax2);
$sql.= ')';

dol_syslog(get_class($this)."::insert sql=".$sql);
dol_syslog(get_class($this)."::insert", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -3591,7 +3583,6 @@ function insert($notrigger=0)
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
}
Expand Down Expand Up @@ -3671,7 +3662,7 @@ function update($user='',$notrigger=0)
if (! empty($this->rang)) $sql.= ", rang=".$this->rang;
$sql.= " WHERE rowid = ".$this->rowid;

dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -3706,7 +3697,6 @@ function update($user='',$notrigger=0)
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::update Error ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
}
Expand All @@ -3726,7 +3716,7 @@ function delete()
$this->db->begin();

$sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".$this->rowid;
dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
if ($this->db->query($sql) )
{
// Appel des triggers
Expand All @@ -3749,7 +3739,6 @@ function delete()
else
{
$this->error=$this->db->error()." sql=".$sql;
dol_syslog(get_class($this)."::delete Error ".$this->error, LOG_ERR);
$this->db->rollback();
return -1;
}
Expand Down Expand Up @@ -3778,7 +3767,7 @@ function update_total()
$sql.= ",total_ttc=".price2num($this->total_ttc)."";
$sql.= " WHERE rowid = ".$this->rowid;

dol_syslog(get_class($this)."::update_total sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::update_total", LOG_DEBUG);

$resql=$this->db->query($sql);
if ($resql)
Expand All @@ -3789,7 +3778,6 @@ function update_total()
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this)."::update_total Error ".$this->error, LOG_ERR);
$this->db->rollback();
return -2;
}
Expand Down
12 changes: 5 additions & 7 deletions htdocs/compta/facture/class/paymentterm.class.php
Expand Up @@ -119,7 +119,7 @@ function create($user, $notrigger=0)

$this->db->begin();

dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }

Expand Down Expand Up @@ -185,7 +185,7 @@ function fetch($id)
$sql.= " FROM ".MAIN_DB_PREFIX."c_payment_term as t";
$sql.= " WHERE t.rowid = ".$id;

dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -213,7 +213,6 @@ function fetch($id)
else
{
$this->error="Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
return -1;
}
}
Expand All @@ -235,7 +234,7 @@ function getDefaultId()
$sql.= " FROM ".MAIN_DB_PREFIX."c_payment_term as t";
$sql.= " WHERE t.code = 'RECEP'";

dol_syslog(get_class($this)."::getDefaultId sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::getDefaultId", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand All @@ -250,7 +249,6 @@ function getDefaultId()
else
{
$this->error="Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::getDefaultId ".$this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -301,7 +299,7 @@ function update($user=0, $notrigger=0)

$this->db->begin();

dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }

Expand Down Expand Up @@ -357,7 +355,7 @@ function delete($user, $notrigger=0)

$this->db->begin();

dol_syslog(get_class($this)."::delete sql=".$sql);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }

Expand Down
1 change: 0 additions & 1 deletion htdocs/compta/journal/purchasesjournal.php
Expand Up @@ -117,7 +117,6 @@
// TODO Find a better trick to avoid problem with some mysql installations
if (in_array($db->type, array('mysql', 'mysqli'))) $db->query('SET SQL_BIG_SELECTS=1');

dol_syslog("sql=".$sql);
$result = $db->query($sql);
if ($result)
{
Expand Down
1 change: 0 additions & 1 deletion htdocs/compta/journal/sellsjournal.php
Expand Up @@ -121,7 +121,6 @@
// TODO Find a better trick to avoid problem with some mysql installations
if (in_array($db->type, array('mysql', 'mysqli'))) $db->query('SET SQL_BIG_SELECTS=1');

dol_syslog("sql=".$sql);
$result = $db->query($sql);
if ($result)
{
Expand Down
14 changes: 5 additions & 9 deletions htdocs/compta/localtax/class/localtax.class.php
Expand Up @@ -95,7 +95,7 @@ function create($user)
$sql.= " '".$this->fk_user_modif."'";
$sql.= ")";

dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand All @@ -113,7 +113,6 @@ function create($user)
else
{
$this->error="Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -152,12 +151,11 @@ function update($user=0, $notrigger=0)
$sql.= " fk_user_modif='".$this->fk_user_modif."'";
$sql.= " WHERE rowid=".$this->id;

dol_syslog(get_class($this)."::update sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql)
{
$this->error="Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::update ".$this->error, LOG_ERR);
return -1;
}

Expand Down Expand Up @@ -202,7 +200,7 @@ function fetch($id)
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON t.fk_bank = b.rowid";
$sql.= " WHERE t.rowid = ".$id;

dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -232,7 +230,6 @@ function fetch($id)
else
{
$this->error="Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR);
return -1;
}
}
Expand All @@ -253,12 +250,11 @@ function delete($user)
$sql = "DELETE FROM ".MAIN_DB_PREFIX."localtax";
$sql.= " WHERE rowid=".$this->id;

dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql)
{
$this->error="Error ".$this->db->lasterror();
dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR);
return -1;
}

Expand Down Expand Up @@ -488,7 +484,7 @@ function addPayment($user)
$sql.=", '".$user->id."', NULL";
$sql.= ")";

dol_syslog(get_class($this)."::addPayment sql=".$sql);
dol_syslog(get_class($this)."::addPayment", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down
23 changes: 10 additions & 13 deletions htdocs/compta/paiement/cheque/class/remisecheque.class.php
Expand Up @@ -73,7 +73,7 @@ function fetch($id,$ref='')
if ($id) $sql.= " AND bc.rowid = ".$id;
if ($ref) $sql.= " AND bc.number = '".$this->db->escape($ref)."'";

dol_syslog("RemiseCheque::fetch sql=".$sql, LOG_DEBUG);
dol_syslog("RemiseCheque::fetch", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -155,7 +155,7 @@ function create($user, $account_id, $limit, $toRemise)
$sql.= ", ''";
$sql.= ")";

dol_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG);
dol_syslog("RemiseCheque::Create", LOG_DEBUG);
$resql = $this->db->query($sql);
if ( $resql )
{
Expand All @@ -172,7 +172,7 @@ function create($user, $account_id, $limit, $toRemise)
$sql.= " SET number='(PROV".$this->id.")'";
$sql.= " WHERE rowid='".$this->id."';";

dol_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG);
dol_syslog("RemiseCheque::Create", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql)
{
Expand All @@ -192,7 +192,7 @@ function create($user, $account_id, $limit, $toRemise)
$sql.= " AND b.fk_account='".$account_id."'";
if ($limit) $sql.= $this->db->plimit($limit);

dol_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG);
dol_syslog("RemiseCheque::Create", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -225,7 +225,7 @@ function create($user, $account_id, $limit, $toRemise)
$sql.= " SET fk_bordereau = ".$this->id;
$sql.= " WHERE rowid = ".$lineid;

dol_syslog("RemiseCheque::Create sql=".$sql, LOG_DEBUG);
dol_syslog("RemiseCheque::Create", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql)
{
Expand All @@ -250,7 +250,6 @@ function create($user, $account_id, $limit, $toRemise)
$this->errno = -1;
$this->error=$this->db->lasterror();
$this->errno=$this->db->lasterrno();
dol_syslog("RemiseCheque::Create Error ".$this->error, LOG_ERR);
}

if (! $this->errno && ! empty($conf->global->MAIN_DISABLEDRAFTSTATUS))
Expand Down Expand Up @@ -351,7 +350,7 @@ function validate($user)
$sql.= " AND entity = ".$conf->entity;
$sql.= " AND statut = 0";

dol_syslog("RemiseCheque::Validate sql=".$sql, LOG_DEBUG);
dol_syslog("RemiseCheque::Validate", LOG_DEBUG);
$resql = $this->db->query($sql);
if ( $resql )
{
Expand Down Expand Up @@ -410,7 +409,7 @@ function getNextNumber()
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " AND number not like '(%'";

dol_syslog("Remisecheque::getNextNumber sql=".$sql);
dol_syslog("Remisecheque::getNextNumber", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -510,7 +509,7 @@ function generatePdf($model, $outputlangs)
$sql.= " AND bc.entity = ".$conf->entity;
$sql.= " ORDER BY b.dateo ASC, b.rowid ASC";

dol_syslog("RemiseCheque::generatePdf sql=".$sql, LOG_DEBUG);
dol_syslog("RemiseCheque::generatePdf", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -705,7 +704,7 @@ function set_date($user, $date)
$sql.= " SET date_bordereau = ".($date ? $this->db->idate($date) : 'null');
$sql.= " WHERE rowid = ".$this->id;

dol_syslog("RemiseCheque::set_date sql=$sql",LOG_DEBUG);
dol_syslog("RemiseCheque::set_date", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand All @@ -715,7 +714,6 @@ function set_date($user, $date)
else
{
$this->error=$this->db->error();
dol_syslog("RemiseCheque::set_date ".$this->error,LOG_ERR);
return -1;
}
}
Expand All @@ -740,7 +738,7 @@ function set_number($user, $number)
$sql.= " SET number = '".$number."'" ;
$sql.= " WHERE rowid = ".$this->id;

dol_syslog("RemiseCheque::set_number sql=$sql",LOG_DEBUG);
dol_syslog("RemiseCheque::set_number", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand All @@ -750,7 +748,6 @@ function set_number($user, $number)
else
{
$this->error=$this->db->error();
dol_syslog("RemiseCheque::set_number ".$this->error,LOG_ERR);
return -1;
}
}
Expand Down
1 change: 0 additions & 1 deletion htdocs/compta/paiement/cheque/fiche.php
Expand Up @@ -609,7 +609,6 @@
$sql.= " AND b.fk_bordereau = ".$object->id;
$sql.= " ORDER BY $sortfield $sortorder";

dol_syslog("sql=".$sql);
$resql = $db->query($sql);
if ($resql)
{
Expand Down
22 changes: 9 additions & 13 deletions htdocs/compta/paiement/class/paiement.class.php
Expand Up @@ -81,7 +81,7 @@ function fetch($id)
$sql.= ' WHERE p.fk_paiement = c.id';
$sql.= ' AND p.rowid = '.$id;

dol_syslog(get_class($this)."::fetch sql=".$sql);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result = $this->db->query($sql);

if ($result)
Expand Down Expand Up @@ -161,7 +161,7 @@ function create($user,$closepaidinvoices=0)
$sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, datec, datep, amount, fk_paiement, num_paiement, note, fk_user_creat)";
$sql.= " VALUES (".$conf->entity.", '".$this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$totalamount."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($this->note)."', ".$user->id.")";

dol_syslog(get_class($this)."::Create insert paiement sql=".$sql);
dol_syslog(get_class($this)."::Create insert paiement", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand All @@ -177,7 +177,7 @@ function create($user,$closepaidinvoices=0)
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiement_facture (fk_facture, fk_paiement, amount)';
$sql .= ' VALUES ('.$facid.', '. $this->id.', \''.$amount.'\')';

dol_syslog(get_class($this).'::Create Amount line '.$key.' insert paiement_facture sql='.$sql);
dol_syslog(get_class($this).'::Create Amount line '.$key.' insert paiement_facture', LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -235,7 +235,6 @@ function create($user,$closepaidinvoices=0)
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this).'::Create insert paiement_facture error='.$this->error, LOG_ERR);
$error++;
}
}
Expand All @@ -256,7 +255,6 @@ function create($user,$closepaidinvoices=0)
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this).'::Create insert paiement error='.$this->error, LOG_ERR);
$error++;
}

Expand Down Expand Up @@ -559,7 +557,7 @@ function update_fk_bank($id_bank)
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' set fk_bank = '.$id_bank;
$sql.= ' WHERE rowid = '.$this->id;

dol_syslog(get_class($this).'::update_fk_bank sql='.$sql);
dol_syslog(get_class($this).'::update_fk_bank', LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -587,7 +585,7 @@ function update_date($date)
$sql.= " SET datep = '".$this->db->idate($date)."'";
$sql.= " WHERE rowid = ".$this->id;

dol_syslog(get_class($this)."::update_date sql=".$sql);
dol_syslog(get_class($this)."::update_date", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand All @@ -598,7 +596,6 @@ function update_date($date)
else
{
$this->error='Error -1 '.$this->db->error();
dol_syslog(get_class($this)."::update_date ".$this->error, LOG_ERR);
return -2;
}
}
Expand All @@ -619,7 +616,7 @@ function update_num($num)
$sql.= " SET num_paiement = '".$this->db->escape($num)."'";
$sql.= " WHERE rowid = ".$this->id;

dol_syslog(get_class($this)."::update_num sql=".$sql);
dol_syslog(get_class($this)."::update_num", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand All @@ -629,7 +626,6 @@ function update_num($num)
else
{
$this->error='Error -1 '.$this->db->error();
dol_syslog(get_class($this)."::update_num ".$this->error, LOG_ERR);
return -2;
}
}
Expand All @@ -645,7 +641,7 @@ function valide()
{
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET statut = 1 WHERE rowid = '.$this->id;

dol_syslog(get_class($this).'::valide sql='.$sql);
dol_syslog(get_class($this).'::valide', LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
Expand All @@ -669,7 +665,7 @@ function info($id)
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p';
$sql.= ' WHERE p.rowid = '.$id;

dol_syslog(get_class($this).'::info sql='.$sql);
dol_syslog(get_class($this).'::info', LOG_DEBUG);
$result = $this->db->query($sql);

if ($result)
Expand Down Expand Up @@ -732,7 +728,7 @@ function getBillsArray($filter='')
else
{
$this->error=$this->db->error();
dol_syslog(get_class($this).'::getBillsArray Error '.$this->error.' - sql='.$sql);
dol_syslog(get_class($this).'::getBillsArray Error '.$this->error.' -', LOG_DEBUG);
return -1;
}
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/payment_sc/fiche.php
Expand Up @@ -211,7 +211,7 @@
$sql.= ' AND f.entity = '.$conf->entity;
$sql.= ' AND pf.rowid = '.$paiement->id;

dol_syslog("compta/payment_sc/fiche.php sql=".$sql);
dol_syslog("compta/payment_sc/fiche.php", LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
Expand Down
17 changes: 7 additions & 10 deletions htdocs/compta/prelevement/class/bonprelevement.class.php
Expand Up @@ -279,7 +279,7 @@ function fetch($rowid)
$sql.= " WHERE p.rowid = ".$rowid;
$sql.= " AND p.entity = ".$conf->entity;

dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$result=$this->db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -314,7 +314,6 @@ function fetch($rowid)
}
else
{
dol_syslog(get_class($this)."::Fetch Erreur sql=".$sql, LOG_ERR);
return -2;
}
}
Expand Down Expand Up @@ -557,8 +556,6 @@ function set_infotrans($user, $date, $method)
}
else
{
dol_syslog(get_class($this)."::set_infotrans Erreur 1", LOG_ERR);
dol_syslog($this->db->error());
$error++;
}

Expand Down Expand Up @@ -705,6 +702,7 @@ function NbFactureAPrelever($banque=0,$agence=0)
//if ($banque) $sql.= " AND sr.code_banque = '".$conf->global->PRELEVEMENT_CODE_BANQUE."'";
//if ($agence) $sql.= " AND sr.code_guichet = '".$conf->global->PRELEVEMENT_CODE_GUICHET."'";

dol_syslog(get_class($this)."::SommeAPrelever");
$resql = $this->db->query($sql);

if ( $resql )
Expand All @@ -718,7 +716,6 @@ function NbFactureAPrelever($banque=0,$agence=0)
else
{
$this->error=get_class($this)."::SommeAPrelever Erreur -1 sql=".$this->db->error();
dol_syslog($this->error, LOG_ERR);
return -1;
}
}
Expand Down Expand Up @@ -779,7 +776,7 @@ function Create($banque=0, $agence=0, $mode='real')
//if ($banque) $sql.= " AND sr.code_banque = '".$conf->global->PRELEVEMENT_CODE_BANQUE."'";
//if ($agence) $sql.= " AND sr.code_guichet = '".$conf->global->PRELEVEMENT_CODE_GUICHET."'";

dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::Create", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
Expand Down Expand Up @@ -896,7 +893,7 @@ function Create($banque=0, $agence=0, $mode='real')
$sql.= " WHERE ref LIKE '".$ref."%'";
$sql.= " AND entity = ".$conf->entity;

dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::Create", LOG_DEBUG);
$resql = $this->db->query($sql);

if ($resql)
Expand All @@ -922,7 +919,7 @@ function Create($banque=0, $agence=0, $mode='real')
$sql.= ", '".$this->db->idate($now)."'";
$sql.= ")";

dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::Create", LOG_DEBUG);
$resql = $this->db->query($sql);

if ($resql)
Expand Down Expand Up @@ -983,7 +980,7 @@ function Create($banque=0, $agence=0, $mode='real')
$sql.= ", fk_prelevement_bons = ".$prev_id;
$sql.= " WHERE rowid = ".$fac[1];

dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::Create", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql)
{
Expand Down Expand Up @@ -1040,7 +1037,7 @@ function Create($banque=0, $agence=0, $mode='real')
$sql.= " WHERE rowid = ".$prev_id;
$sql.= " AND entity = ".$conf->entity;

dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG);
dol_syslog(get_class($this)."::Create", LOG_DEBUG);
$resql=$this->db->query($sql);
if (! $resql)
{
Expand Down
18 changes: 9 additions & 9 deletions htdocs/compta/resultat/clientfourn.php
Expand Up @@ -190,7 +190,7 @@
$sql.= " GROUP BY s.nom, s.rowid";
$sql.= " ORDER BY s.nom, s.rowid";

dol_syslog("get customer invoices sql=".$sql);
dol_syslog("get customer invoices", LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
Expand Down Expand Up @@ -235,7 +235,7 @@
$sql.= " GROUP BY nom, idp";
$sql.= " ORDER BY nom";

dol_syslog("get old customer payments not linked to invoices sql=".$sql);
dol_syslog("get old customer payments not linked to invoices", LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
Expand Down Expand Up @@ -320,7 +320,7 @@

$subtotal_ht = 0;
$subtotal_ttc = 0;
dol_syslog("get suppliers invoices sql=".$sql);
dol_syslog("get suppliers invoices", LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
Expand Down Expand Up @@ -401,7 +401,7 @@
$sql.= " GROUP BY c.libelle, c.id";
$sql.= " ORDER BY c.libelle, c.id";

dol_syslog("get social contributions deductible=0 sql=".$sql);
dol_syslog("get social contributions deductible=0", LOG_DEBUG);
$result=$db->query($sql);
$subtotal_ht = 0;
$subtotal_ttc = 0;
Expand Down Expand Up @@ -478,7 +478,7 @@
$sql.= " ORDER BY c.libelle, c.id";
}

dol_syslog("get social contributions deductible=1 sql=".$sql);
dol_syslog("get social contributions deductible=1", LOG_DEBUG);
$result=$db->query($sql);
$subtotal_ht = 0;
$subtotal_ttc = 0;
Expand Down Expand Up @@ -564,7 +564,7 @@
$sql.= " GROUP BY dm";
$sql.= " ORDER BY dm";

dol_syslog("get vat to pay sql=".$sql);
dol_syslog("get vat to pay", LOG_DEBUG);
$result=$db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -609,7 +609,7 @@
$sql.= " GROUP BY dm";
$sql.= " ORDER BY dm";

dol_syslog("get vat received back sql=".$sql);
dol_syslog("get vat received back", LOG_DEBUG);
$result=$db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -653,7 +653,7 @@
$sql.= " GROUP BY dm";
$sql.= " ORDER BY dm";

dol_syslog("get vat really paid sql=".$sql);
dol_syslog("get vat really paid", LOG_DEBUG);
$result=$db->query($sql);
if ($result) {
$num = $db->num_rows($result);
Expand Down Expand Up @@ -694,7 +694,7 @@
$sql.= " GROUP BY dm";
$sql.= " ORDER BY dm";

dol_syslog("get vat really received back sql=".$sql);
dol_syslog("get vat really received back", LOG_DEBUG);
$result=$db->query($sql);
if ($result) {
$num = $db->num_rows($result);
Expand Down
18 changes: 9 additions & 9 deletions htdocs/compta/resultat/index.php
Expand Up @@ -123,7 +123,7 @@
$sql.= " ORDER BY dm";

//print $sql;
dol_syslog("get customers invoices sql=".$sql);
dol_syslog("get customers invoices", LOG_DEBUG);
$result=$db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -157,7 +157,7 @@
$sql.= " GROUP BY dm";
$sql.= " ORDER BY dm";

dol_syslog("get old customers payments not linked to invoices sql=".$sql);
dol_syslog("get old customers payments not linked to invoices", LOG_DEBUG);
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
Expand Down Expand Up @@ -208,7 +208,7 @@
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
$sql.= " GROUP BY dm";

dol_syslog("get suppliers invoices sql=".$sql);
dol_syslog("get suppliers invoices", LOG_DEBUG);
$result=$db->query($sql);
if ($result)
{
Expand Down Expand Up @@ -249,7 +249,7 @@
$sql.= " AND f.entity = ".$conf->entity;
$sql.= " GROUP BY dm";

dol_syslog("get vat to pay sql=".$sql);
dol_syslog("get vat to pay", LOG_DEBUG);
$result=$db->query($sql);
if ($result) {
$num = $db->num_rows($result);
Expand Down Expand Up @@ -280,7 +280,7 @@
$sql.= " AND f.entity = ".$conf->entity;
$sql.= " GROUP BY dm";

dol_syslog("get vat to receive back sql=".$sql);
dol_syslog("get vat to receive back", LOG_DEBUG);
$result=$db->query($sql);
if ($result) {
$num = $db->num_rows($result);
Expand Down Expand Up @@ -311,7 +311,7 @@
$sql.= " AND t.entity = ".$conf->entity;
$sql.= " GROUP BY dm";

dol_syslog("get vat really paid sql=".$sql);
dol_syslog("get vat really paid", LOG_DEBUG);
$result=$db->query($sql);
if ($result) {
$num = $db->num_rows($result);
Expand Down Expand Up @@ -340,7 +340,7 @@
$sql.= " AND t.entity = ".$conf->entity;
$sql.= " GROUP BY dm";

dol_syslog("get vat really received back sql=".$sql);
dol_syslog("get vat really received back", LOG_DEBUG);
$result=$db->query($sql);
if ($result) {
$num = $db->num_rows($result);
Expand Down Expand Up @@ -390,7 +390,7 @@
$sql.= " AND cs.entity = ".$conf->entity;
$sql.= " GROUP BY c.libelle, dm";

dol_syslog("get social contributions deductible=0 sql=".$sql);
dol_syslog("get social contributions deductible=0 ", LOG_DEBUG);
$result=$db->query($sql);
if ($result) {
$num = $db->num_rows($result);
Expand Down Expand Up @@ -440,7 +440,7 @@
$sql.= " AND cs.entity = ".$conf->entity;
$sql.= " GROUP BY c.libelle, dm";

dol_syslog("get social contributions paid deductible=1 sql=".$sql);
dol_syslog("get social contributions paid deductible=1", LOG_DEBUG);
$result=$db->query($sql);
if ($result) {
$num = $db->num_rows($result);
Expand Down