move_fund_invoice_due_date.php 576 B

123456789101112131415161718192021222324252627
  1. <?php
  2. // this hook offsets the due date of an invoice for add fund using order grace days
  3. if (!defined("WHMCS"))
  4. die("This file cannot be accessed directly");
  5. use WHMCS\Database\Capsule;
  6. function get_grace() {
  7. $grace = Capsule::table('tblconfiguration')->where('setting', 'OrderDaysGrace')->first();
  8. }
  9. add_hook('PreInvoicingGenerateInvoiceItems', 1, function($vars) {
  10. $grace = get_grace();
  11. logModuleCall(
  12. 'PreInvoicingGenerateInvoiceItems',
  13. __FUNCTION__,
  14. $vars,
  15. "Debug",
  16. $grace
  17. );
  18. return true;
  19. });
  20. ?>