NEW : Suspend facture rec when nb gen max is reached (#31623)
This commit is contained in:
parent
e98402ab64
commit
fd094638dd
1 changed files with 9 additions and 0 deletions
|
|
@ -2003,6 +2003,15 @@ class FactureRec extends CommonInvoice
|
|||
$this->date_when = $date;
|
||||
if ($increment_nb_gen_done > 0) {
|
||||
$this->nb_gen_done++;
|
||||
|
||||
if (getDolGlobalInt('MAIN_SUSPEND_FACTURE_REC_ON_MAX_GEN_REACHED') && $this->isMaxNbGenReached()) {
|
||||
$resSuspend = $this->setValueFrom('suspended', 1);
|
||||
|
||||
if ($resSuspend <= 0) {
|
||||
dol_syslog(__METHOD__ . '::setValueFrom Error : ' . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$notrigger) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue