Skip to content

Conversation

@lemathou
Copy link
Member

@lemathou lemathou commented Sep 6, 2024

FIX

When updating an order line with a TTC price, the pu_ht is stored as TTC and the TTC has double TTC, and so, when creating and invoice, the prices are also different
So, I disabled the bad variable affectation.

@hregis
Copy link
Contributor

hregis commented Sep 6, 2024

@lemathou i don't have this problem ! you have external modules ?

@lemathou
Copy link
Member Author

lemathou commented Sep 6, 2024

I have modules, I will try with a fresh install, but I see that the order::lineupdate is the only case (of line update) where the pu_ttc is put into the suprice, instead of the the pu_ht, as it is in the invoices and propales.

@lemathou
Copy link
Member Author

lemathou commented Sep 6, 2024

When I update an order product line and I put 10€ in the TTC unit price, with qty=1, it stores 10€ in the HT unit price, 12€ in the TTC unit price, and 10€ in the total... this is not consistent

@lemathou
Copy link
Member Author

lemathou commented Sep 6, 2024

@lemathou i don't have this problem ! you have external modules ?

I confirm I have the problem without external modules. With v.19.0.2.
@hregis Can you check again and confirm ?
I should suggest to merge it to v19. Maybe an older version...

@hregis
Copy link
Contributor

hregis commented Sep 6, 2024

@lemathou yes the problem exists in v19 ! but not in develop branch...
$subprice = $pu_ttc; is ok if price_base_type is TTC... the problem is not your fix !

@lemathou lemathou changed the base branch from develop to 19.0 September 6, 2024 16:00
@lemathou
Copy link
Member Author

lemathou commented Sep 6, 2024

@lemathou yes the problem exists in v19 ! but not in develop branch... $subprice = $pu_ttc; is ok if price_base_type is TTC... the problem is not your fix !

@hregis OK I switched to v19. But, I don't understand ...

$subprice = $pu_ttc; is ok if price_base_type is TTC... the problem is not your fix !

@hregis I am not sure to understand your answear correctly, but I see that :

in the v.19 we have :

$subprice = $pu_ttc;
...
$this->line->subprice       = $subprice;

and this is not working even if price_base_type is TTC

otherwise, in the develop, we have :

$this->line->subprice       = $pu_ht;

and this is working

So, doing $subprice = $pu_ht; in the v19 fixes the bug, non ?

@hregis
Copy link
Contributor

hregis commented Sep 6, 2024

@lemathou ok i understand, your rights... you can see this PR, same fix from develop branch : #30887

@lemathou
Copy link
Member Author

lemathou commented Sep 6, 2024

@hregis OK Thanks, I simplified the PR as it is in the develop, as you did !
I am quite a newbie in PRs...

@eldy eldy merged commit b8ea770 into Dolibarr:19.0 Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants