Skip to content

Commit

Permalink
FIX Dolibarr#30950 Bad ref in supplier invoice created by Rest API fr…
Browse files Browse the repository at this point in the history
…om an invoice template
  • Loading branch information
FlorentPoinsaut committed Sep 13, 2024
1 parent 04ebf52 commit e23eb94
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions htdocs/fourn/class/fournisseur.facture.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,6 @@ public function create($user)
if (! $this->type) {
$this->type = self::TYPE_STANDARD;
}
if (!empty(GETPOST('ref_supplier'))) {
$this->ref_supplier = trim($this->ref_supplier);
} else {
$this->ref_supplier = trim($this->ref_supplier . '_' . ($_facrec->nb_gen_done + 1));
}
$this->note_public = trim($this->note_public);
$this->note_private = trim($this->note_private);
$this->note_private = dol_concatdesc($this->note_private, $langs->trans("GeneratedFromRecurringInvoice", $_facrec->title));
Expand All @@ -499,6 +494,7 @@ public function create($user)

// For recurring invoices, update date and number of last generation of recurring template invoice, before inserting new invoice
if ($_facrec->frequency > 0) {
$this->ref_supplier = trim($this->ref_supplier . '_' . ($_facrec->nb_gen_done + 1));
dol_syslog("This is a recurring invoice so we set date_last_gen and next date_when");
if (empty($_facrec->date_when)) {
$_facrec->date_when = $now;
Expand Down

0 comments on commit e23eb94

Please sign in to comment.