|
|
@@ -0,0 +1,27 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+// this hook offsets the due date of an invoice for add fund using order grace days
|
|
|
+
|
|
|
+if (!defined("WHMCS"))
|
|
|
+ die("This file cannot be accessed directly");
|
|
|
+
|
|
|
+use WHMCS\Database\Capsule;
|
|
|
+function get_grace() {
|
|
|
+ $grace = Capsule::table('tblconfiguration')->where('setting', 'OrderDaysGrace')->first();
|
|
|
+}
|
|
|
+
|
|
|
+add_hook('PreInvoicingGenerateInvoiceItems', 1, function($vars) {
|
|
|
+ $grace = get_grace();
|
|
|
+
|
|
|
+ logModuleCall(
|
|
|
+ 'PreInvoicingGenerateInvoiceItems',
|
|
|
+ __FUNCTION__,
|
|
|
+ $vars,
|
|
|
+ "Debug",
|
|
|
+ $grace
|
|
|
+ );
|
|
|
+
|
|
|
+ return true;
|
|
|
+});
|
|
|
+
|
|
|
+?>
|