Openbravo Issue Tracking System - POS2
View Issue Details
0051848POS2POSpublic2023-03-14 10:562023-04-03 15:30
prakashmurugesan88 
prakashmurugesan88 
normalmajoralways
closedfixed 
5
 
23Q3 
gorka_gil
No
0051848: Js Error occurs on selecting discount in Gift Reminder Notification
Js Error occurs on selecting discount in Gift Reminder Notification

Issue occurs when gift product configured in Discount and Promotion is not available in the Store

For example in the video Product "TOTEBAGBELIE Unique TU" is not available in the price list of the Store
Configure Buy X Gift Y discount with 2 gift products with 1 gift product included in pricelist of the store and another not included in price list.

Now try to add the product so that Gift Reminder Notification is shown for the discount.

In following code it tries to fetch gift product details from db,
https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/blob/master/web-jspack/org.openbravo.pos2/src/components/Discounts/FeaturedDiscount/FeaturedDiscountProductSelection/FeaturedDiscountProductSelection.jsx#L36 [^]

https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/blob/master/web-jspack/org.openbravo.pos2/src/components/Discounts/FeaturedDiscount/FeaturedDiscountProductSelection/FeaturedDiscountProductSelection.jsx#L107 [^]

In given scenario though 2 gift products are configured but only one gift product is returned from BO

Therefore in following line it filters gift products based on gift product configuration and gift product info from BO,
https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/blob/master/web-jspack/org.openbravo.pos2/src/components/Discounts/FeaturedDiscount/FeaturedDiscountProductSelection/FeaturedDiscountProductSelectionDialogContent/FeaturedDiscountProductSelectionDialogContent.jsx#L25 [^]

Here it iterates 2 items for both product in configuration as return productList as below,
productList = [{Object}, null]
Here for product info not received from db, it returns null.


Therefore in following line it throws error for the null product,
https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/blob/master/web-jspack/org.openbravo.pos2/src/components/Discounts/FeaturedDiscount/FeaturedDiscountProductSelection/FeaturedDiscountProductSelectionDialogContent/FeaturedDiscountProductSelectionDialogContent.jsx#L32 [^]
No tags attached.
related to defect 0052139 closed ranjith_qualiantech_com [Promo] -Buy X Get Y => display in gift pop up to improve 
Issue History
2023-03-14 10:56prakashmurugesan88New Issue
2023-03-14 10:56prakashmurugesan88Assigned To => prakashmurugesan88
2023-03-14 10:56prakashmurugesan88Triggers an Emergency Pack => No
2023-03-14 11:02prakashmurugesan88Note Added: 0147518
2023-03-14 11:02prakashmurugesan88Statusnew => scheduled
2023-03-30 07:18prakashmurugesan88Steps to Reproduce Updatedbug_revision_view_page.php?rev_id=25794#r25794
2023-03-30 07:20prakashmurugesan88Steps to Reproduce Updatedbug_revision_view_page.php?rev_id=25795#r25795
2023-04-03 15:28hgbotResolutionopen => fixed
2023-04-03 15:28hgbotStatusscheduled => resolved
2023-04-03 15:28hgbotFixed in Version => 23Q3
2023-04-03 15:28hgbotNote Added: 0148203
2023-04-03 15:29gorka_gilReview Assigned To => gorka_gil
2023-04-03 15:29gorka_gilStatusresolved => closed
2023-04-03 15:30gorka_gilFixed in SCM revision => https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/7afc65886d9d7da9c80e25d4455e4bda1bb6065e [^]
2023-04-17 17:02rafarodaRelationship addedrelated to 0052139

Notes
(0147518)
prakashmurugesan88   
2023-03-14 11:02   
Created following Merge Request,
https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/1590 [^]
(0148203)
hgbot   
2023-04-03 15:28   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 7afc65886d9d7da9c80e25d4455e4bda1bb6065e
Author: Prakash M <prakash@qualiantech.com>
Date: 03-04-2023 13:28:35
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/7afc65886d9d7da9c80e25d4455e4bda1bb6065e [^]

Fixed ISSUE-51848: Fixed js error in gift reminder notification

* Issue occurs when gift product configured is not available for the store

---
M web-jspack/org.openbravo.pos2/src/components/Discounts/FeaturedDiscount/FeaturedDiscountProductSelection/FeaturedDiscountProductSelectionDialogContent/FeaturedDiscountProductSelectionDialogContent.jsx
---