Since WHMCS can't calculate different tax categories per product (tax A and tax B on product X and tax A only on Product Y) we would need to be able to take over the tax calculation or be able to modify it to comply with local tax regulations.
See:
https://requests.whmcs.com/topic/specify-second-level-tax-on-specific-products-pst-is-not-charged-on-every-product-in-bcI don't quite know the existing hook flow for invoice creation, so I don't know if a hook like AfterInvoicingGenerateInvoiceItems, InvoiceCreation, PreInvoicingGenerateInvoiceItems or UpdateInvoiceTotal can be used and modified in a way that we can pass back the new tax values (and maybe even names).
We would need the client information for the invoice and all line items including late fees finalized so we can take all that and calculate the proper taxes so that we can pass the taxes to use back to WHMCS. It should be the last call so that nothing will modify the invoice at a later point in the flow.
This should also be available for the ordering process in the frontend so that whenever WHMCS displays a total with taxes these can be modified ahead of the display so that the proper taxes can be shown to the customers as well as apply to invoice/quote modifications in the admin section.
In a nutshell: we want to be able to replace the built-in tax calculation of WHMCS with our own and need all the access the built-in system has.
Mark Krieger
4 Comments
Login to post a comment.
Or if different products have completely different tax rates, which I read some other jurisdictions have problems with.
We may be able to calculate an averaged rate and apply it, but that would look very odd on the invoices since the tax rate is displayed.
And in multiple discussions with WHMCS support over the years, nobody pointed to this hook!
Thank you so much!
Now - the hook would still help with calculation when placing an order - or do you have a secret way there as well?
...and I don't seem to be getting e-mail notifications here. I am subscribed but saw your post just by chance since I never got an e-mail, so please don't take it the wrong way that it took so long to reply.
How about naming it "InvoiceCreationFinalized"?