SIELOnline / acumulus-for-WHMCS

WHMCS add-on module that connects your WHMCS Service to Acumulus
GNU General Public License v3.0
2 stars 1 forks source link

Module not properly adding VAT in Acumulus #5

Closed dqos closed 1 year ago

dqos commented 1 year ago

We currently run this module for years without any major problems. Now we are preparing to switch to Proforma invoicing, so we spun up a new WHMCS instance (8.7.0) with the latest Acumulus module.

We have a customer account with country set to Germany (thus VAT is 19%). Then we create an invoice in WHMCS for this customer, it includes 19% VAT properly. Then when the module pushes it to Acumulus, it's imported WITHOUT VAT, it's added as BTW-0%, which is incorrect unless there is a VAT number for this customer.

We are still investigating, but this also happens with non-proforma invoicing.

dqos commented 1 year ago

This is probably caused by an incorrect VAT determination here: https://github.com/SIELOnline/acumulus-for-WHMCS/blob/main/acumulus_connect_functions.php#L494

In our example, the customer is from Germany, but filled in a dummy company name WITHOUT VAT number. The module still threats it as VAT reversed, which is NOT allowed. I think we should check only the VAT number (there are also businesses without a company name, but with a VAT number).

I will keep investigating this and find a fix.

fietserwin commented 1 year ago

Ideally, the applied vat rate should be stored with each order line. This, because the way I interpret the current tax rules, you may charge Dutch vat instead of EU vat if you stay below the €10.000,- threshold, be it physical goods or digital services. See https://www.belastingdienst.nl/wps/wcm/connect/bldcontentnl/belastingdienst/zakelijk/btw/zakendoen_met_het_buitenland/goederen_en_diensten_naar_andere_eu_landen/btw_berekenen_bij_diensten/wijziging_in_digitale_diensten_vanaf_2015/wijziging_in_digitale_diensten_vanaf_2015.

In addition: even if a vat number only (without company name) would suffice, Acumulus requires both the company name and vat number, so the module should follow that rule as well. Acumulus requires this because legally, invoices with reversed vat must contain the name and vat number of a vat liable client.

NB: The Acumulus modules for the different web shops have their own support channels, for whmcs this is whmcs at acumulus dot nl. Therefore, normally I will not react to issues and comments on github. However, considering the effort you put into this issue, you merited an answer., so thanks for your research. I will change the proposed fix to require both company name and vat id and commit it as such. As we have plans to rewrite the whmcs module on top of the libAcumulus library, the current version will not receive further maintenance other than bug fixes like this.

dqos commented 1 year ago

@fietserwin Sure! Acumulus requires this because legally, invoices with reversed vat must contain the name and vat number of a vat liable client. this is incorrect. In EU there are cases that natural persons have a VAT number and not a company name. I also tested this PR with our dev instance and Acumulus, and it works.

So in order to do it properly, I would suggest that if this is a customer with only a VAT number and no company name, then set the Firstname+Lastname as the company name in Acumulus (this is also the correct way).

Anyway, it works for us now, looking forward to the new module as the current one is pure chaos 😄

dqos commented 1 year ago

Also, if communication about this module is only through email then please adjust permissions in this repository or make it read-only. E.g. disable issue tracking.