Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.27k stars 2.73k forks source link

No VAT in Takepos / generated invoices by Takepos #30389

Open Zimputer opened 2 months ago

Zimputer commented 2 months ago

Bug

When selecting a product, the price in Takepos is the same with and without VAT. Somehow, it uses a VAT of 0 percent. When digging through the code, I couldn't find any obvious place where this originates. The VAT set at the price of the product should be used.

Here is the view in takepos: image

Invoices work without a problem.

Dolibarr Version

19.0.2

Environment PHP

No response

Environment Database

No response

Steps to reproduce the behavior and expected behavior

Add product in Takepos from the dolibarr products.

Attached files

dolibarr.log

Zimputer commented 1 month ago

Found the solution to the problem:

The function get_default_tva(), sets the VAT rate according to the customer. Since we used a generic customer with no country assigned to this customer, the default VAT = 0. This is following this rule: VATRULE 6: Otherwise the VAT proposed by default=0. End of rule.

Changing the country of this generic user solves the problem. This can be marked as not a bug, but maybe leave this for other people encountering the same issue.