Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Items Price HT/TTC not saved properly on orders and invoices when price TTC modified (post creation) #29430

Open
dom-madrid opened this issue Apr 22, 2024 · 2 comments
Labels
Bug This is a bug (something does not work as expected)

Comments

@dom-madrid
Copy link

Bug

When modifying an order or an invoice for a customer by changing price TTC, the amount is copied to the HT filed and the price TTC is being recalculated by adding the VAT to the original amount.

Dolibarr Version

18.0.5 19.0.1

Environment PHP

PHP 8.1.27

Environment Database

MySQL 8.0.36

Steps to reproduce the behavior and expected behavior

Is valid for both orders and invoices (assuming VAT 20% for the example)

Create a new order
Add a new item to the invoice (10 HT, 12 TTC)
Edit the product line
Change the price TTC (12 TTC) to price TTC (7.2 TTC)
New price HT should change from 10 HT to 6 HT

The same holds true if editing a new order/invoice or editing a previously validated order/invoice.
Hovewer when adding a new product line, you can enter either price HT or price TTC and the other price is being correctly calculated. It seems to affect only modifications once the product line is added.

Actual results is
New price HT is being changed to 7.2 HT (from the price TTC 7.2) and price TTC to 8.64

Attached files

No response

@dom-madrid dom-madrid added the Bug This is a bug (something does not work as expected) label Apr 22, 2024
@dom-madrid dom-madrid changed the title Items Price TTC not saved properly on orders and invoices Items Price HT/TTC not saved properly on orders and invoices when price TTC modified (post creation) Apr 22, 2024
@sonikf
Copy link
Contributor

sonikf commented Apr 23, 2024

Duplicate of #27215, #29122 related to #27216

@blftpe
Copy link

blftpe commented May 3, 2024

I have the same issue, just to be more precise it only happens for services, not for products or free products/services:
if you edit a service in the TTC column, when you save the price will be the one you entered+VAT, instead of modifying the HT price.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

3 participants