Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


WHMCS auto delete overdue invoices hook
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

WHMCS auto delete overdue invoices hook

Does anyone have or can anyone write a WHMCS hook to auto delete overdue invoices older than 100 days in WHMCS? I'd like to run the hook as a daily cron job. Thank you!

Comments

  • PM me.

  • BharatBBharatB Member, Patron Provider

    I can , is it paid or do you need the code written free ?

  • So how many overdue invoices do you have?It seems like a manual job of 2-3 minutes you need to do every month or something.

  • This is a sample hook:

     <?php
     
     function hook_create_forum_account($vars) {
     
         $firstname = $vars['firstname'];
         $lastname = $vars['lastname'];
         $email = $vars['email'];
     
         # Run code to create remote forum account here...
     
     }
     
     add_hook("ClientAdd",1,"hook_create_forum_account");
     
     ?>
    

    That's all it is, and I don't need it that much so I'm not going to pay anything for it. I just wanted to know if the community already had something or had enough experience to write a hook out. I have a couple hundred invoices, and it would be nice to not have to go in there and do it myself.

  • LeonardCLeonardC Member
    edited December 2014
    UPDATE `tblinvoices` SET `status` = 'Cancelled' WHERE `duedate` <= DATE_SUB(CURDATE(), INTERVAL 100 DAY) AND `status` = 'Unpaid'</pre>
    
  • dccdcc Member, Host Rep
  • Mahfuz_SS_EHLMahfuz_SS_EHL Host Rep, Veteran

    Sent PM @PetaByet

Sign In or Register to comment.