Merge pull request #26062 from fappels/18_fix_mass_bill_reception
Fix do not close reception if already closed.
This commit is contained in:
commit
e70d381bc7
1 changed files with 10 additions and 1 deletions
|
|
@ -1530,6 +1530,12 @@ class Reception extends CommonObject
|
|||
|
||||
$error = 0;
|
||||
|
||||
// Protection
|
||||
if ($this->statut == Reception::STATUS_CLOSED) {
|
||||
dol_syslog(get_class($this)."::Already in closed status", LOG_WARNING);
|
||||
return 0;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'reception SET fk_statut='.self::STATUS_CLOSED;
|
||||
|
|
@ -1664,7 +1670,10 @@ class Reception extends CommonObject
|
|||
|
||||
$this->db->begin();
|
||||
|
||||
$this->setClosed();
|
||||
if ($this->statut == Reception::STATUS_VALIDATED) {
|
||||
// do not close if already closed
|
||||
$this->setClosed();
|
||||
}
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'reception SET billed=1';
|
||||
$sql .= " WHERE rowid = ".((int) $this->id).' AND fk_statut > 0';
|
||||
|
|
|
|||
Loading…
Reference in a new issue