Sorry for being a bit cryptic but the argument we are discussing is immensely complex. From time to time you can read about some sides of this story directly on the forum of WHMCS (Problem VAT calculation, WHMCS causing tax evasion) or in their feature requests area.
- Tax Type: Inclusive
- Tax Rate: 22%
- Amount: 14 €
- Subtotal: 11.48 €
- 22% Tax: 2.52 €
- Total Due: 14 €
According to the law of many countries, this value must be approximated to 2.53 €. It may seem not a serious question but this is an underpayment of tax. Most Revenue Agencies for an amount of 11.48 € expect a tax of 2.53 €. This is tax evasion. And if we sum 11.48 + 2.53 we get 14.01 that is wrong too.
Imagine how this problem can become gigantic if you generate thousand of invoices per year. Not to mention that the right combination of amounts, tax rates, coupuon codes, overpayments, credit usage (...) can be enough to cause this issue.
The customer applied 6 euro of credit on which he has already paid VAT at the moment of uploading funds to his account. We can't make him pay VAT twice therefore tax line should be recalculated to 0.80 euro (20% of subtotal minus credit). Sadly this can't be done at this stage for reasons we described earlier.
All the numbers on invoice will be corrected only at the moment the invoice becomes paid. This is the first downside that you have to accept. The second one is that the customer will still be asked to pay the wrong amount (6 euro) instead of the right one (4.8 euro) but don't panic. Billing Extension will automatically refund the amount that was not due (1.2 euro) directly on credit balance. Below you can see the corrected version of the invoice.
If you don't like this workaround keep in mind that there's no other possible solution other than not applying tax to add funds invoices. If the law of your country doesn't allow you to do so, then disable Add Funds entirely.