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:
commit
714236a1ec
2 changed files with 9 additions and 10 deletions
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue