Openbravo Issue Tracking System - POS2
View Issue Details
0047727POS2Restaurantspublic2021-09-21 10:452021-10-18 09:34
AugustoMauch 
jorge-garcia 
normalminorhave not tried
closedfixed 
5
 
 
AugustoMauch
No
0047727: Improvements on GetTicketMenuLineWithSameInformation
The web-jspack/org.openbravo.pos2.restaurant/src/model/food-menu/GetTicketLineMenuWithSameInformation.js is in charge of, given a ticket and a menu (with menu items), determining if they are equivalent. This is used for instance to decide whether to add a menu in a new ticket line, or to merge into an existing one.

The way this check is done makes it difficult to maintain. Each time a new relevant property is added to the menu items (i.e. product configuration), someone has to remember to update GetTicketLineMenuWithSameInformation to take into account the new info.

There are already two relevant properties that are not being taken into account:
- schema (at menu level)
- product configuration (at menu and menu item level)

In this issue, we should either:
- Update getTicketMenuLineWithSameInformation to take into account the missing relevant properties, or
- Change the way the comparison is done to make maintenance easier (i.e. to check by default the equality of all the properties (doing a deep object comparison), excluding only the irrelevant properties (i.e. order line ID).
- See implementation of https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.restaurant/-/blob/master/web-jspack/org.openbravo.pos2.restaurant/src/model/food-menu/GetTicketLineMenuWithSameInformation.js [^]
No tags attached.
Issue History
2021-09-21 10:45AugustoMauchNew Issue
2021-09-21 10:45AugustoMauchAssigned To => Retail
2021-09-21 10:45AugustoMauchTriggers an Emergency Pack => No
2021-09-21 12:54jorge-garciaStatusnew => scheduled
2021-09-21 12:54jorge-garciaAssigned ToRetail => jorge-garcia
2021-09-22 16:07hgbotNote Added: 0131977
2021-09-23 08:43jorge-garciaReview Assigned To => AugustoMauch
2021-10-18 09:34hgbotResolutionopen => fixed
2021-10-18 09:34hgbotStatusscheduled => closed
2021-10-18 09:34hgbotNote Added: 0132382
2021-10-18 09:34hgbotNote Added: 0132383

Notes
(0131977)
hgbot   
2021-09-22 16:07   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.restaurant/-/merge_requests/79 [^]
(0132382)
hgbot   
2021-10-18 09:34   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.restaurant [^]
Changeset: 9bcf74bd453dd639de8becb65e2c4709f365c869
Author: Jorge Garcia <jorge.garcia@openbravo.com>
Date: 2021-10-07T18:24:26+02:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.restaurant/-/commit/9bcf74bd453dd639de8becb65e2c4709f365c869 [^]

Fixed ISSUE-47727: Improve GetTicketLineMenuWithSameInformation to be configurable

In configuration, it is possible to define the relevant properties to check to conclude
two menu lines are the same

---
A web-jspack/org.openbravo.pos2.restaurant/src/model/food-menu/GetTicketMenuLineInfoChecks.js
A web-jspack/org.openbravo.pos2.restaurant/src/model/food-menu/TicketLineMenuHeaderInfo.config.json
A web-jspack/org.openbravo.pos2.restaurant/src/model/food-menu/TicketLineMenuItemInfo.config.json
A web-jspack/org.openbravo.pos2.restaurant/src/model/food-menu/__mock__/Config/MockTicketLineMenuHeaderInfo.config.json
A web-jspack/org.openbravo.pos2.restaurant/src/model/food-menu/__mock__/Config/MockTicketLineMenuItemInfo.config.json
M web-jspack/org.openbravo.pos2.restaurant/src/application-window/MainWindowHooks.js
M web-jspack/org.openbravo.pos2.restaurant/src/model/food-menu/GetTicketLineMenuWithSameInformation.js
M web-jspack/org.openbravo.pos2.restaurant/src/model/food-menu/__test__/GetTicketLineMenuWithSameInformation.test.js
M web-jspack/org.openbravo.pos2.restaurant/src/model/food-menu/best-deal/addMenuToTicket.js
M web-jspack/org.openbravo.pos2.restaurant/src/model/food-menu/best-deal/discoverMenus.js
M web-jspack/org.openbravo.pos2.restaurant/src/model/ticket/actions/UpdateMenuPostActionHook.js
M web-jspack/org.openbravo.pos2.restaurant/src/model/user-interface/__test__/AddProductToMenu.test.js
M web-jspack/org.openbravo.pos2.restaurant/src/model/user-interface/__test__/SetMenuItemNote.test.js
M web-jspack/org.openbravo.pos2.restaurant/src/model/user-interface/user-actions/AddProductToMenu.js
M web-jspack/org.openbravo.pos2.restaurant/src/model/user-interface/user-actions/SetMenuItemNote.js
M web-jspack/org.openbravo.pos2.restaurant/src/ob-init.js
---
(0132383)
hgbot   
2021-10-18 09:34   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.restaurant/-/merge_requests/79 [^]