Skip to content

Commit

Permalink
Merge pull request #529 from ATM-Consulting/backport_suspend_facture_rec
Browse files Browse the repository at this point in the history
Backport  17.0 PR Dolibarr#31623 : Suspend facture rec when nb gen max is rea…
  • Loading branch information
atm-lena authored Oct 30, 2024
2 parents b32b8af + 09e22a1 commit cec08a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog_Koesio.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Backported from 17.0 :
- Backport 17.0 PR #31623 : Suspend facture rec when nb gen max is reached - *2024-10-29*
- Backport 21.0 PR #31463 : Tab to see generated invoices on recurring
supplier or customer invoice cards - *2024-10-23*
- Backport 17.0 PR #31445 : Follow ExtraFields between model invoice and classic invoice - *2024-10-18*
10 changes: 10 additions & 0 deletions htdocs/compta/facture/class/facture-rec.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,16 @@ public function setNextDate($date, $increment_nb_gen_done = 0, $notrigger = 0)
$this->date_when = $date;
if ($increment_nb_gen_done > 0) {
$this->nb_gen_done++;

// Backport 17.0 #31623
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) {
Expand Down

0 comments on commit cec08a9

Please sign in to comment.