Clean code
This commit is contained in:
parent
0408d123ec
commit
b32ffdbbb9
@ -152,6 +152,8 @@ class RemiseCheque extends CommonObject
|
|||||||
|
|
||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
|
dol_syslog("RemiseCheque::Create start", LOG_DEBUG);
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bordereau_cheque (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bordereau_cheque (";
|
||||||
@ -178,7 +180,6 @@ class RemiseCheque extends CommonObject
|
|||||||
$sql.= ", ''";
|
$sql.= ", ''";
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
|
|
||||||
dol_syslog("RemiseCheque::Create", LOG_DEBUG);
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ( $resql )
|
if ( $resql )
|
||||||
{
|
{
|
||||||
@ -195,7 +196,6 @@ class RemiseCheque extends CommonObject
|
|||||||
$sql.= " SET ref='(PROV".$this->id.")'";
|
$sql.= " SET ref='(PROV".$this->id.")'";
|
||||||
$sql.= " WHERE rowid=".$this->id."";
|
$sql.= " WHERE rowid=".$this->id."";
|
||||||
|
|
||||||
dol_syslog("RemiseCheque::Create", LOG_DEBUG);
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (! $resql)
|
if (! $resql)
|
||||||
{
|
{
|
||||||
@ -242,13 +242,12 @@ class RemiseCheque extends CommonObject
|
|||||||
if($linetoremise==$lineid) $checkremise=true;
|
if($linetoremise==$lineid) $checkremise=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($checkremise==true)
|
if ($checkremise)
|
||||||
{
|
{
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."bank";
|
||||||
$sql.= " SET fk_bordereau = ".$this->id;
|
$sql.= " SET fk_bordereau = ".$this->id;
|
||||||
$sql.= " WHERE rowid = ".$lineid;
|
$sql.= " WHERE rowid = ".$lineid;
|
||||||
|
|
||||||
dol_syslog("RemiseCheque::Create", LOG_DEBUG);
|
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if (!$resql)
|
if (!$resql)
|
||||||
{
|
{
|
||||||
@ -284,11 +283,13 @@ class RemiseCheque extends CommonObject
|
|||||||
if (! $this->errno)
|
if (! $this->errno)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
dol_syslog("RemiseCheque::Create end", LOG_DEBUG);
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
|
dol_syslog("RemiseCheque::Create end", LOG_DEBUG);
|
||||||
return $this->errno;
|
return $this->errno;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user