Merge pull request #29203 from rycks/16_move_trigger_to_facture

move BILLREC_CREATEBILL to facture because of ui actions
This commit is contained in:
Laurent Destailleur 2024-04-03 02:29:12 +02:00 committed by GitHub
commit 714236a1ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 10 deletions

View file

@ -1391,16 +1391,6 @@ class FactureRec extends CommonInvoice
$error++;
}
}
if (!$error && !$notrigger) {
// Call trigger
$result = $facturerec->call_trigger('BILLREC_CREATEBILL', $user);
if ($result < 0) {
$this->errors = $facturerec->errors;
$this->error = $facturerec->error;
$error++;
}
// End call triggers
}
} else {
$error++;
$this->error = "Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity."\n";

View file

@ -1090,9 +1090,18 @@ class Facture extends CommonInvoice
if ($result < 0) {
$error++;
}
//special case for recurring invoices, moved from facture-rec.class.php
if (!$error && $this->fac_rec > 0) {
$result = $this->call_trigger('BILLREC_CREATEBILL', $user);
if ($result < 0) {
$error++;
}
}
// End call triggers
}
if (!$error) {
$this->db->commit();
return $this->id;