Update facture.class.php

This commit is contained in:
ptibogxiv 2019-09-29 15:45:41 +02:00 committed by GitHub
parent 5a096972c0
commit 2e8b99606e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2146,8 +2146,8 @@ class Facture extends CommonInvoice
if (! $close_code) $sql.= ', paye=1';
if ($close_code) $sql.= ", close_code='".$this->db->escape($close_code)."'";
if ($close_note) $sql.= ", close_note='".$this->db->escape($close_note)."'";
$sql.= ', fk_user_cloture = '.$user->id;
$sql.= ", date_cloture = '".$this->db->idate($now)."'";
$sql.= ', fk_user_closing = '.$user->id;
$sql.= ", date_closing = '".$this->db->idate($now)."'";
$sql.= ' WHERE rowid = '.$this->id;
$resql = $this->db->query($sql);
@ -2200,7 +2200,7 @@ class Facture extends CommonInvoice
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture';
$sql.= ' SET paye=0, fk_statut='.self::STATUS_VALIDATED.', close_code=null, close_note=null';
$sql.= ' date_cloture as datecloture,';
$sql.= ' date_closing as dateclosing,';
$sql.= ' fk_user_author, fk_user_valid, fk_user_cloture';
$sql.= ' WHERE rowid = '.$this->id;
@ -3527,8 +3527,8 @@ class Facture extends CommonInvoice
public function info($id)
{
$sql = 'SELECT c.rowid, datec, date_valid as datev, tms as datem,';
$sql.= ' date_cloture as datecloture,';
$sql.= ' fk_user_author, fk_user_valid, fk_user_cloture';
$sql.= ' date_closing as dateclosing,';
$sql.= ' fk_user_author, fk_user_valid, fk_user_closing';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture as c';
$sql.= ' WHERE c.rowid = '.$id;
@ -3551,17 +3551,17 @@ class Facture extends CommonInvoice
$vuser->fetch($obj->fk_user_valid);
$this->user_validation = $vuser;
}
if ($obj->fk_user_cloture)
if ($obj->fk_user_closing)
{
$cluser = new User($this->db);
$cluser->fetch($obj->fk_user_cloture);
$this->user_cloture = $cluser;
$cluser->fetch($obj->fk_user_closing);
$this->user_closing = $cluser;
}
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
$this->date_validation = $this->db->jdate($obj->datev);
$this->date_cloture = $this->db->jdate($obj->datecloture);
$this->date_closing = $this->db->jdate($obj->dateclosing);
}
$this->db->free($result);
}