Automatic Payments, Overpayments and Credit in WHMCS
The Problem with Overpayments
We wrote a lot about the billing lacks of WHMCS. In this article we focus on the long-standing issue with overpayments in WHMCS. Be advised that this topic is pretty complex and annoying not only to experience but also to explain.
If you are a complete beginner in WHMCS, you might think that overpayments happen very rarely but in reality the occur pretty frequently, especially if you're using some kind of automatic payments such as PayPal subscriptions.
Let's suppose the average customer is placing an order for a domain. It's not rocket science.
It's 2020, VAT rate is 22% and he registers a domain for 12.20 € (10 € + 2.20 € VAT)
|He pays the resulting invoice creating a subscription payment with PayPal|
A year later WHMCS notifies the customers that the domain is expiring soon. He immediately renews it as he doesn't want to risk losing it. In doing so, he forgets about the automatic payment
PayPal subscription is programmed to pay 12.20 € on domain's expiration date. When the overpayment occurs, WHMCS realizes the invoice is already paid hence the subscription payment is credited to customer's account
We can all agree that turning overpayments into credit is a good idea as it allows customer to use this credit for subsequent renewals and new orders, but there's more than one problem.
As far as we know, in most countries you are required to issue invoices immediatelly after receiving the payment. Some countries allow to postpone the issuing for a certain period of time (usually not more than 1 month). Overpayments are no exception.
According to WHMCS' logic, one should wait for the credit being used to receive the actual invoice. But what if the customer has no other service? It will take 12 months for the invoice. You can't postpone invoicing this long.
The direct consequence of postponing invoicing for credited amounts, is that the invoice could be issued in a different fiscal year. In our example the customer paid in 2021 but he's forced to wait 2022 to receive the invoice for the overpayment.
This originates an accounting nightmare for both you and the customer. How is him supposed to record expenses for overpayments made in 2021 if you don't give him any document with fiscal value?
Updating Previously Issued Invoice
Let's add exact dates to the equation:
- Manual payment sent on 01/09/2021
- Overpayment arrived on 01/10/2021
When the first payment is received, WHMCS issues the invoice as normal. Let's say invoice number is #2021-500. Then arrives the overpayment that WHMCS inexplicably adds to the previous invoice changing dates and amounts.
Preserving invoice datails is critical as invoices and credit notes have fiscal value but WHMCS has a different opinion. You'll end up having weird invoice numbers as follows.
Invoice numbering is no longer sequential since WHMCS moves the "overpaid" invoice from 01/09/2020 to 01/10/2020. In doing so, it also changes invoice amount from 12.20 € to 24.40 €. This surely leaves your accountant speachless.
We've seen it happening a lot also with invoices jumping from one year to another recursively as long as the overpayment still occur. Invoices can move from 2012 to 2013, 2014, 2015 etc. It took us quite a lot to figure out the source of the problem.
Changes to VAT Rate
Things get worse in case there are changes to VAT rates and you apply tax on credit for add funds invoices.
To date, in 2021 we received two payments of 12.20 € including 2.20 € of VAT at 22% and the invoice for the overpayment still needs to be issued. Let's suppose the invoice is issued next year when VAT rate changes to 21%.
The outcome is that WHMCS charges the VAT rate of 2022 for a payment received in 2021.
The Solution: Invoicing Overpayments
Such a complex problem can be solved by enabling Addons > Billing Extension > Settings > Billing Preferences > Invoice Overpayments in Billing Extension. When the module detects an overpayment it does the following:
- It doesn't let WHMCS to mess up invoices
- Determines if the overpayment is occurring on a proforma or an invoice
In fact overpayments can even occur when customers pay you more than what was due in a single transaction. In this case the module bills the overpayment in the same document as you can see from the screenshot below.
On the contrary if it's the case of automatic payments, the payment is billed by issuing a new and separate invoice.
We remind you that the overpayment is still credited in customer's account.