Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[POS2] Restaurantsminorhave not tried2021-05-11 16:552021-07-30 09:22
ReporterplujanView Statuspublic 
Assigned Toagonzalez 
PrioritynormalResolutionopenFixed in Version
StatusacknowledgedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo

0046621: [21Q2] [Restaurants] Updating the quantity of a split menu does not behave as for a split line

DescriptionWhen 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.
Steps To ReproduceScenario 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.
TagsNo tags attached.
Attached Filespng file icon Split-Increase-Store.png [^] (57,506 bytes) 2021-05-11 16:55

png file icon Split-Increase-Restaurant.png [^] (56,568 bytes) 2021-05-11 16:55

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
agonzalez (developer)
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 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 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.
dmiguelez (developer)
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

- Issue History
Date Modified Username Field Change
2021-05-11 16:55 plujan New Issue
2021-05-11 16:55 plujan Assigned To => Retail
2021-05-11 16:55 plujan File Added: Split-Increase-Store.png
2021-05-11 16:55 plujan Resolution time => 1624485600
2021-05-11 16:55 plujan Triggers an Emergency Pack => No
2021-05-11 16:55 plujan File Added: Split-Increase-Restaurant.png
2021-05-12 09:57 guilleaer Status new => acknowledged
2021-07-14 13:01 dmiguelez Resolution time 1624485600 => 1638313200
2021-07-28 13:13 dmiguelez Assigned To Retail => agonzalez
2021-07-29 18:01 agonzalez Note Added: 0130882
2021-07-30 09:20 dmiguelez Resolution time 1638313200 =>
2021-07-30 09:20 dmiguelez Type defect => design defect
2021-07-30 09:22 dmiguelez Note Added: 0130888

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker