Jump to content

DailyCronJob hook


rebuke

Recommended Posts

At present it seems the DailyCronJob hook is called *after* WHMCS has done its normal daily cron stuff. Does anybody know if it's possible to get it called *before* this happens, or if there's another undocumented hook or whatever?

 

Basically what I'm trying to do is add a billable item set to appear on next invoice, such that when WHMCS generates the invoice it will automagically have the item on it (this is for VoIP call charges, which are a very variable amount etc).

 

I could do it by having a separate cron job that kicks off something that uses e.g. the API and ensure that runs before the WHMCS cron job, but that seems a bit of an ugly solution to me that's liable to go wrong...

Link to comment
Share on other sites

I was just looking at that as an option - do you know if it's possible to use an API function from within an action hook (in a nice way - obviously I could just stick a CURL request in or whatever, but that seems mad), as using the UpdateInvoice API would seem the 'nicest' way to add an item to the invoice (since it will then presumably handle updating the totals etc for me rather than having to manipulate lots of SQL tables etc)?

 

The other option I looked at was creating a module that has an UpdateUsage function, but even that appears to be called *after* the invoices have been generated...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated