Openbravo Issue Tracking System - POS2
View Issue Details
0046621POS2Restaurantspublic2021-05-11 16:552021-10-20 16:26
plujan 
Retail 
normalminorhave not tried
acknowledgedopen 
5
 
 
No
0046621: [21Q2] [Restaurants] Updating the quantity of a split menu does not behave as for a split line
When increasing the quantity of a line, while in Store, the behaviour is the expected one. But when working with menus the updated line is not the selected one.
Scenario A: Store
Add an Avalanche Transceiver to a blank ticket
Update the quantity to two
Split the line in two lines
In the first line (the one left selected after the split) use the "+" button to increase the quantity. Notice that, as expected, the selected line has now a Qty of 2, while the below line remains with 1 (see attached screenshot)

Scenario B: Restaurants
Add a Simple Menu to a blank ticket
Fill the foods to complete the menu
Update the quantity to two
Split the line in two
In the first line (the one left selected after the split) use the "+" button to increase the quantity. Notice that this time a new copy of the line is added, leaving in total three lines with one menu each.
Increase the quantity again and notice that now the last added line (not the one that is selected) quantity is increased to two, while the other two lines remain with one. See attached screenshot.
No tags attached.
png Split-Increase-Store.png (57,506) 2021-05-11 16:55
https://issues.openbravo.com/file_download.php?file_id=15697&type=bug
png

png Split-Increase-Restaurant.png (56,568) 2021-05-11 16:55
https://issues.openbravo.com/file_download.php?file_id=15698&type=bug
png
Issue History
2021-05-11 16:55plujanNew Issue
2021-05-11 16:55plujanAssigned To => Retail
2021-05-11 16:55plujanFile Added: Split-Increase-Store.png
2021-05-11 16:55plujanResolution time => 1624485600
2021-05-11 16:55plujanTriggers an Emergency Pack => No
2021-05-11 16:55plujanFile Added: Split-Increase-Restaurant.png
2021-05-12 09:57guilleaerStatusnew => acknowledged
2021-07-14 13:01dmiguelezResolution time1624485600 => 1638313200
2021-07-28 13:13dmiguelezAssigned ToRetail => agonzalez
2021-07-29 18:01agonzalezNote Added: 0130882
2021-07-30 09:20dmiguelezResolution time1638313200 =>
2021-07-30 09:20dmiguelezTypedefect => design defect
2021-07-30 09:22dmiguelezNote Added: 0130888
2021-10-20 16:26guilleaerAssigned Toagonzalez => Retail

Notes
(0130882)
agonzalez   
2021-07-29 18:01   
While reviewing, the following points has been found:

* The cause of the problem:
This issue is being caused by the splitMenuWithDifferentItems method, contained on the AddProductActionPreparation.js file of the
org.openbravo.pos2.restaurant module, in the line 856.

This method will be executed before the Ticket.addProduct is executed, and it looks for a ticket line with the same information
than the passed on the attrs properties of the payload. If no line is found, the property "createNewLine" is appended into
the attrs property, making the AddProduct action to create a new line.

For looking this ticket line, the method getTicketMenuLineWithSameInformation is being used (imported from GetTicketLineMenuWithSameInformation.js in pos2.restaurant module), and this method, while looking the ticket line that
contains the same information, will check if the ticketLine is a splitted line or not.

The main cause of the problem is that, once a ticket line is being splitted, the splitline is set to true, making the method
getTicketMenuLineWithSameInformation to return undefined because a condition is performed when retrieving the line. This causes
the AddProduct action preparation to add a new line when increasing the quantity instead of increasing the quantity of the
currently selected line.

I think another approach should be followed to retrieve the line being edited, instead of checking other lines that contains the same information.
(0130888)
dmiguelez   
2021-07-30 09:22   
Based on the description provided by the developer this issue has been categorized as Design Defect.

Having to find the line that is being edited by looking among all the lines which is the one with the proper parameters is not the correct behavior as it can lead to several problems in the future, others more important than this one (maybe related to discounts or taxes)

When editing the line, the system should know exactly which line is being managed