Openbravo Issue Tracking System - POS2
View Issue Details
0049875POS2POSpublic2022-07-24 20:592024-01-15 15:54
cberner 
Triage Platform Base 
normalmajorhave not tried
closedunable to reproduce 
5
 
 
No
0049875: Setting distinct price and then completing a product configuration step, will reset the value after finishing it
This is a bug with product configuration, it seems is using old state and returning it, changing the previously modified price if done so.

Gif is provided to illustrate the issue.

After further investigation, we saw that the problem comes from the updateProductModifiersExtraPrice function, which on addProductConfiguration action will recalculate the product modifiers extra prices and change the line price. It does it by taking the base product amount/price, which is incorrect, it should take into account line price.

We propose another solution on the Proposed Solution part of this issue.
1. Login WebPOS
2. Add a GPS Mini product to the ticket
3. Click on the line and Price Modification, change the value to something else
4. Finish the service configuration process, the price is reset

This can also be reproduced out of the configuration step:
1. Add a GPS Handheld
2. Modify its price
3. Click on Edit Services and finish the step

Price is wrongly reset to the original value, instead of the modified one.
We propose recalculating the price of product modifier just in two cases, when the action to add a product modifier or remove one is done, we recalculate the price, but only if there are new or less product modifiers(right now is executed each time any product configuration is done, and doesn't matter if it is a product modifier or another type of product configuration, like beeper).

This should be done by running it inside the addProductConfiguration action, and taking into account the previous state, which we preserve and can check. If in the previous state we had more or less product modifiers, we recalculate it using the ticketline amount/price by adding or subtracting the proper amount corresponding to the added/removed product modifiers with extra price.

We propose also recalculating the price on SetPrice action as a posthook, by first setting the new price, and then adding all the modifers with extra price to the final price, and setting the final amount of the ticketline to that(price user set + extra modifiers prices).
No tags attached.
gif price modification changes original value.gif (680,336) 2022-07-24 20:59
https://issues.openbravo.com/file_download.php?file_id=17336&type=bug
Issue History
2022-07-24 20:59cbernerNew Issue
2022-07-24 20:59cbernerAssigned To => Retail
2022-07-24 20:59cbernerFile Added: price modification changes original value.gif
2022-07-24 20:59cbernerTriggers an Emergency Pack => No
2022-07-24 20:59cbernerAssigned ToRetail => cberner
2022-07-24 20:59cbernerStatusnew => acknowledged
2022-08-05 11:40cbernerDescription Updatedbug_revision_view_page.php?rev_id=24592#r24592
2022-08-05 11:40cbernerProposed Solution updated
2022-08-11 13:48cbernerAssigned Tocberner => Triage Platform Base
2024-01-15 15:54cbernerStatusacknowledged => scheduled
2024-01-15 15:54asier_perezNote Added: 0159317
2024-01-15 15:54asier_perezStatusscheduled => closed
2024-01-15 15:54asier_perezResolutionopen => unable to reproduce

Notes
(0159317)
asier_perez   
2024-01-15 15:54   
The issue is no longer reproducible.