From c377350c357615b381ef29b677e4f2c58e623a32 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Dec 2018 16:09:12 +0100 Subject: [PATCH] Update facture-rec.class.php --- htdocs/compta/facture/class/facture-rec.class.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index fed1ca8c79c..23d30f0ad32 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1006,15 +1006,12 @@ class FactureRec extends CommonInvoice { global $conf, $langs, $db, $user, $hookmanager; - $error=0; $nb_create=0; // Load translation files required by the page $langs->loadLangs(array("main","bills")); - $hookmanager->initHooks(array('createrecurringinvoices')); - $now = dol_now(); $tmparray=dol_getdate($now); $today = dol_mktime(23,59,59,$tmparray['mon'],$tmparray['mday'],$tmparray['year']); // Today is last second of current day @@ -1035,7 +1032,7 @@ class FactureRec extends CommonInvoice 'restrictioninvoiceid' => $restrictioninvoiceid, 'forcevalidation' => $forcevalidation, ); - $reshook = $hookmanager->executeHooks('writeSQL', $parameters, $sql); // note that $sql might be modified by hooks + $reshook = $hookmanager->executeHooks('beforeCreationOfRecurringInvoices', $parameters, $sql); // note that $sql might be modified by hooks $resql = $db->query($sql); if ($resql) @@ -1136,7 +1133,7 @@ class FactureRec extends CommonInvoice 'facturerec' => $facturerec, // it's an object which PHP passes by "reference", so modifiable by hooks. 'this' => $this, // it's an object which PHP passes by "reference", so modifiable by hooks. ); - $reshook = $hookmanager->executeHooks('generatedInvoice', $parameters, $facture); // note: $facture can be modified by hooks (warning: $facture can be null) + $reshook = $hookmanager->executeHooks('afterCreationOfRecurringInvoice', $parameters, $facture); // note: $facture can be modified by hooks (warning: $facture can be null) $i++; }