Jump to content

Determining the source of an invoice.


aperture

Recommended Posts

Hi,

I am looking for a way to determine the source of a new invoice. That being is the new invoice generated by a client action, like ordering a service. Or if it simply is generated by billing.

Testing the InvoiceCreated hook for invoiceID gives us the new invoice number. However it is not possible to check this invoiceID against database tables. This seems to be because the invoice has yet to be finalized. Else we could have checked if the invoiceID was located in both tblorders.invoiceid and tblinvoices.id. Any match on both tables would indicate it was an order, and should there only be a match in tblinvoices.id it would be simply billing.

Next we have the source variable, there it seems to be mainly autogen being used. I did check the classdoc for Invoice, there we have a runCreationHooks method with a String $source parameter, with 4 possible options: 'adminarea', 'api', 'autogen' or 'clientarea'. Now the whmcs hook InvoiceCreated states that the only values it will return are one of 'adminarea', 'api', 'autogen' or 'clientarea'.

Does anyone have any tips, or have you perhaps dealt with this issue and found a way?

Link to comment
Share on other sites

  • 3 weeks later...

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.

×
×
  • 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