Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/24/2020 in Posts

  1. Wanted to follow up with the solution I used. Thanks so much for pointing me in the right direction @Jono! I moved a variation of my the code to the CreateInvoices.php page (core/Automation/Tasks/Task/CreateInvoices.php) and that has worked perfectly (so far). In case anyone else was curious what I did ... I added an if statement after "private function process() {" that blocked the creation of the invoices on weekends. The invoice for the service is still created, but pushed until a later day. It didn't alter the service renewal dates, it simply altered when the invoice was created/sent. No guarantee it will work for anyone else, or that it won't have unintended consequences, but it seems to work perfectly for what I needed. Thanks again @Jono and @Paul for the help! private function process() { // Don't process renewal invoices if it is Saturday, Sunday or Christmas if ((date('N') >= 6) || (strtotime(date('Y-12-25')) == strtotime(date('Y-m-d'))) ) { $output = ""; } else { // Create invoices for renewing services $this->createRenewingServiceInvoices(); // Create recurring invoices $this->createRecurringInvoices(); } }
    1 point
×
×
  • Create New...