Openbravo Issue Tracking System - POS2
View Issue Details
0046514POS2POSpublic2021-05-05 13:422021-05-18 09:59
ebecerra 
prakashmurugesan88 
normalcriticalhave not tried
closedfixed 
5
 
 
No
0046514: JIRA 1868 - Menu prices load from main prices list
In the POS2 when select a menu, the prices used is the main price list for the store, not be used the schema's prices.
Log in the backoffice.

Go to organization window.

Open an organization, and navigate to the price list by default.

Set a price for a menu.

Go to back to the organization window.

Select a schema, navigate to it's price list (different from the default one) and put a different price for the same menu.

Log in the new POS

Change the schema to the one that we have changed the price.

Check that the price showing is the one in the default pricelist and not the one of the schema pricelist.
 
Takeaway
depends on backport 0046523TAP closed prakashmurugesan88 Menu prices load from main prices list 
png 1.png (39,809) 2021-05-05 13:42
https://issues.openbravo.com/file_download.php?file_id=15645&type=bug
png

png 2.png (42,463) 2021-05-05 13:42
https://issues.openbravo.com/file_download.php?file_id=15646&type=bug
png

png 3.png (163,700) 2021-05-05 13:43
https://issues.openbravo.com/file_download.php?file_id=15647&type=bug
png

png 4.png (124,847) 2021-05-05 13:43
https://issues.openbravo.com/file_download.php?file_id=15648&type=bug
png
Issue History
2021-05-05 13:42ebecerraNew Issue
2021-05-05 13:42ebecerraAssigned To => Retail
2021-05-05 13:42ebecerraFile Added: 1.png
2021-05-05 13:42ebecerraTriggers an Emergency Pack => No
2021-05-05 13:42ebecerraFile Added: 2.png
2021-05-05 13:43ebecerraFile Added: 3.png
2021-05-05 13:43ebecerraFile Added: 4.png
2021-05-05 13:48javietxeTag Attached: Takeaway
2021-05-05 13:52javietxeSeveritymajor => critical
2021-05-05 13:52javietxeSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=22452#r22452
2021-05-05 17:15guilleaerStatusnew => scheduled
2021-05-05 17:15guilleaerStatusscheduled => acknowledged
2021-05-06 12:00guilleaerResolution time => 1620424800
2021-05-06 15:49dmiguelezNote Added: 0127861
2021-05-10 05:41prakashmurugesan88Assigned ToRetail => prakashmurugesan88
2021-05-10 05:41prakashmurugesan88Statusacknowledged => scheduled
2021-05-11 15:07jmelinNote Added: 0127993
2021-05-13 08:35hgbotNote Added: 0128055
2021-05-14 13:17hgbotNote Added: 0128126
2021-05-14 17:32jmelinSummaryMenu prices load from main prices list => JIRA 1868 - Menu prices load from main prices list
2021-05-18 09:59hgbotNote Added: 0128294
2021-05-18 09:59hgbotNote Added: 0128295
2021-05-18 09:59hgbotNote Added: 0128296
2021-05-18 09:59hgbotNote Added: 0128297
2021-05-18 09:59hgbotResolutionopen => fixed
2021-05-18 09:59hgbotStatusscheduled => closed
2021-05-18 09:59hgbotNote Added: 0128298
2021-05-18 09:59hgbotNote Added: 0128299

Notes
(0127861)
dmiguelez   
2021-05-06 15:49   
There are several places in the restaurants modules in which the price and the taxes are not taken into account the Schema:

grep -ri "product.standardPrice" .
./components/MenuWizard/MenuWizardProductKeymapLayout/MenuWizardProductButton/MenuWizardProductButton.jsx: currentProduct.additionalCostProduct.standardPrice
./model/food-menu/GetMenuTaxesInfo.js: const amount = product.standardPrice + additionalCost;
./model/ticket/actions/AddProductActionPreparation.js: foundProduct.additionalCost = mcp.additionalCostProduct.standardPrice;
./model/ticket/actions/AddProductActionPreparation.js: additionalCostProduct.standardPrice
./model/ticket/actions/AddProductActionPreparation.js: ? additionalCostProduct.standardPrice
./model/ticket/actions/AddProductActionPreparation.js: menuUnitPrice: menuDefinition.product.standardPrice,
./model/ticket/actions/InitMenu.js: const initialMenuPrice = menuDefinition.product.standardPrice;
./model/ticket/actions/__test__/InitMenu.test.js: menuUnitPrice: SimpleMenu.product.standardPrice,
./model/user-interface/user-actions/AddProductToMenu.js: additionalCostProduct.standardPrice
./model/user-interface/user-actions/AddProductToMenu.js: return additionalCostProduct.standardPrice;
                                                                                                                                                           grep -ri "product.taxCategory" .
./model/food-menu/GetMenuTaxesInfo.js: taxCategory: product.taxCategory

This should be fixed by:
- Create a generic function to retrieve the product price based on the schema
  - This method should be very similar to the existing one getSchemaProductPrices
- Use this method to retrieve the proper price
- Use the schema product price to set the correct price or tax if available or use the default if not
(0127993)
jmelin   
2021-05-11 15:07   
I don't know if it's directly related but the product extra cost is not available on POS.
(0128055)
hgbot   
2021-05-13 08:35   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.restaurant/-/merge_requests/33 [^]
(0128126)
hgbot   
2021-05-14 13:17   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/455 [^]
(0128294)
hgbot   
2021-05-18 09:59   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 7f0e04714f0923453289a5dca873547692775bf6
Author: Prakash M <prakash@qualiantech.com>
Date: 2021-05-18T11:06:03+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/7f0e04714f0923453289a5dca873547692775bf6 [^]

Related to BUG-46514: Moved getSchemaProductPrices to common utils file

---
M web-jspack/org.openbravo.pos2/src/components/ProductButton/ProductPopover/__test__/ProductPopover.test.jsx
M web-jspack/org.openbravo.pos2/src/components/ProductButton/ProductPopoverPrice/ProductPopoverPrice.jsx
M web-jspack/org.openbravo.pos2/src/components/ProductKeymap/__test__/ProductKeymap.test.jsx
M web-jspack/org.openbravo.pos2/src/model/ticket/TicketUtils.js
R web-jspack/org.openbravo.pos2/src/components/ProductKeymap/GetSchemaProductPrices.js
---
(0128295)
hgbot   
2021-05-18 09:59   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/455 [^]
(0128296)
hgbot   
2021-05-18 09:59   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 5547cda2af57f28579e699caaaaa2c7936769884
Author: Prakash M <prakash@qualiantech.com>
Date: 2021-05-18T11:06:03+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/5547cda2af57f28579e699caaaaa2c7936769884 [^]

Related to BUG-46514: Moved getSchemaProductPrices to common utils file

---
M web-jspack/org.openbravo.pos2/src/components/ProductKeymap/GetProductKeymapInfo.js
---
(0128297)
hgbot   
2021-05-18 09:59   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 3958f79c40ad76cdd659632daed25bbb23d761f9
Author: Prakash M <prakash@qualiantech.com>
Date: 2021-05-18T13:17:21+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/3958f79c40ad76cdd659632daed25bbb23d761f9 [^]

Related to BUG-46514: Moved getSchemaProductPrices to common utils file

---
M web-jspack/org.openbravo.pos2/src/components/ProductButton/ProductPopover/__test__/ProductPopover.test.jsx
M web-jspack/org.openbravo.pos2/src/components/ProductButton/ProductPopoverPrice/ProductPopoverPrice.jsx
M web-jspack/org.openbravo.pos2/src/components/ProductKeymap/GetProductKeymapInfo.js
M web-jspack/org.openbravo.pos2/src/components/ProductKeymap/__test__/ProductKeymap.test.jsx
M web-jspack/org.openbravo.pos2/src/model/ticket/TicketUtils.js
R web-jspack/org.openbravo.pos2/src/components/ProductKeymap/GetSchemaProductPrices.js
---
(0128298)
hgbot   
2021-05-18 09:59   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.restaurant [^]
Changeset: a67aa826800f21d93f51f8bc2456d2cba12c0551
Author: Prakash M <prakash@qualiantech.com>
Date: 2021-05-18T13:10:33+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.restaurant/-/commit/a67aa826800f21d93f51f8bc2456d2cba12c0551 [^]

Fixed BUG-46514: Fixes schema price not applied for menu products

---
A web-jspack/org.openbravo.pos2.restaurant/src/model/ticket/actions/InitMenuActionPreparation.js
A web-jspack/org.openbravo.pos2.restaurant/src/model/ticket/actions/__test__/InitMenuActionPreparation.test.js
A web-jspack/org.openbravo.pos2.restaurant/src/model/user-interface/actions/UpdateMenuActionPreparation.js
M web-jspack/org.openbravo.pos2.restaurant/src/components/MenuWizard/MenuWizardProductKeymapLayout/MenuWizardProductButton/MenuWizardProductButton.jsx
M web-jspack/org.openbravo.pos2.restaurant/src/model/ticket/TicketExtension.js
M web-jspack/org.openbravo.pos2.restaurant/src/model/ticket/actions/AddProductActionPreparation.js
M web-jspack/org.openbravo.pos2.restaurant/src/model/ticket/actions/__test__/AddProductActionPreparation.test.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/user-actions/AddProductToMenu.js
M web-jspack/org.openbravo.pos2.restaurant/src/ob-init.js
---
(0128299)
hgbot   
2021-05-18 09:59   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2.restaurant/-/merge_requests/33 [^]