The VAT of a customer price is not applied
You entered a customer price with 10% VAT, and the proposal line comes out at 20%. Where the VAT rate offered on a line comes from, and how to get the right one.
You use customer prices. On a product at 20%, you created a price of €10 for one customer, with 10% VAT. You add this product to a proposal for this customer: the price is indeed €10, but the line’s VAT is 20%.
It is not a forgotten setting. Dolibarr applies the amount of the customer price, but not its VAT.
What happens
When you choose a product in a line, the form asks the server for the price and the VAT rate to offer. The server does find the customer price, with its VAT. But right after, it recomputes the rate according to the general tax rules, and this computation does not know the customer price. This recomputed rate is the one offered on the line.
For a seller and a customer in the same country, this rate is the one on the product card. Two practical consequences:
- A product at 0% makes the form offer 0%. If lines come out at 0% for no apparent reason, look at the product cards first.
- The rate is saved on the line when the line is added. Correcting the product card afterwards does not correct lines already entered.
To find products for sale at 0% or without a rate (adapt the llx_ prefix if needed):
SELECT rowid, ref, label, tva_tx FROM llx_product
WHERE tosell = 1 AND (tva_tx IS NULL OR tva_tx = 0);
The solutions
- Put the right rate on the product card. If this product must always be at 10%, it is its default VAT that must change. New lines then use it.
- Correct the rate on the line. The offered rate is only a suggestion: you can change it in the list before adding the line, or edit the line afterwards. It is the only solution if the same product really must have different rates depending on the customer.
How this was verified
- On 20.0.4 and 24.0.1 test instances, seller and customer in France: product at 20%, customer price at €10 and 10%. The form offers €10 and 20%, and the line is saved that way. The server response does contain the VAT of the customer price (10), then the offered rate (20).
- In 24.0.1: a product at 0% makes the form offer 0%. With the product’s VAT changed to 10%, the new line comes out at 10% and the existing lines stay at 20%. A line corrected by hand moves to 10%.
- In the code, from 20.0.4 to 24.0.2 and in the development branch, the line form always asks for this recomputation.
If the rates still make no sense
If your lines come out with rates you cannot explain, the €90 diagnosis is about looking at your setup with you for one hour, then giving you in writing the cause and what the fix would cost.