NEW : Suspend facture rec when nb gen max is reached (#31623)

This commit is contained in:
atm-irvine 2024-10-29 20:41:01 +01:00 committed by GitHub
parent e98402ab64
commit fd094638dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {