Openbravo Issue Tracking System - Retail Modules
View Issue Details
0042131Retail ModulesDiscounts and Promotionspublic2019-10-28 12:302019-11-28 17:25
inaki_garcia 
ranjith_qualiantech_com 
highminoralways
closedfixed 
5
main 
RR20Q1 
marvintm
No
0042131: [19Q4] [UX] "Buy X and pay Y of same product" discount line item with "2x" is shown duplicated on POS when splitting in lines
When creating a ticket with a product eligible for a "Buy X and pay Y of same product" and splitting it into two or more lines with the "Split lines" feature, the description item with the discount that appears in the original line can appear to be duplicate and
not correctly represent the discounts per line, although the discount amounts are correctly calculated. This is better described in the steps to reproduce and in the screenshot attachment below.

This is a user experience issue in which to keep an eye on and to reflect upon as on how the discounts are to be shown: either all of the discounts appear for a single line in representation of the lines in which the same product item is split into, or the
discounts appear individually per-line as the global count of said product increases and fulfills the discount condition. This becomes specially relevant for the upcoming more elaborate functionalities, such as the Restaurants module, where discounts in a multiple
ticket situation will need to be clear for the user.
PRECONDITION: the "Discounts and Promotions" module must be installed

-- In the Backend (ERP)
0. Log in ERP as Group -Admin-The White Valley Group
1. Go to Discounts and Promotions window
2. Create new record
 - Header tab
   * Discount type: Buy X pay Y of same product
   * Name: 3 x 2 Bottles
   * Starting date: today's date
   * Included Products: Only those defined
   * X Units: 3
   * Y Units: 2
  - Products subtab
   * Product: Bottle 1 L

-- In the Web POS
0. Log in the POS as user "vallblanca"
1. Add 3 units of the "Bottle 1 L" product item to the ticket. Notice that the "-- 3 x 2 Bottles" line description item will appear in the line
2. Click on the newly created ticket line, and click on the "Split" option in the line description pane. Click "Apply" button in the "Split" popup that appears. Notice that the discount now appears in the 2nd ticket line
3. Change the quantity for the first line to 5 units.
NOTICE that the two lines show "-- (2x) 3 x 2 Bottles" line description item, which is incorrect in reference to the single 3x2 discount that each line has. Either said line description item should appear for the 2nd line, or the original "-- 3 x 2 Bottles"
description for each of the lines. The discounts are correctly calculated and applied to the ticket.
No tags attached.
depends on backport 0042310RR19Q4 closed ranjith_qualiantech_com [19Q4] [UX] "Buy X and pay Y of same product" discount line item with "2x" is shown duplicated on POS when splitting in lines 
jpg discount-multiplier-duplicate.jpg (206,048) 2019-10-28 12:30
https://issues.openbravo.com/file_download.php?file_id=13449&type=bug
jpg
Issue History
2019-10-28 12:30inaki_garciaNew Issue
2019-10-28 12:30inaki_garciaAssigned To => Retail
2019-10-28 12:30inaki_garciaFile Added: discount-multiplier-duplicate.jpg
2019-10-28 12:30inaki_garciaTriggers an Emergency Pack => No
2019-10-28 12:31inaki_garciaDescription Updatedbug_revision_view_page.php?rev_id=19564#r19564
2019-10-28 12:32inaki_garciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=19566#r19566
2019-10-28 17:32inaki_garciaSummary[19Q4] [UX] "Buy X and pay Y of same product" discount line item incorrectly displayed when splitting in lines => [19Q4] [UX] "Buy X and pay Y of same product" discount line item incorrectly displayed on POS when splitting in lines
2019-10-28 17:40inaki_garciaSummary[19Q4] [UX] "Buy X and pay Y of same product" discount line item incorrectly displayed on POS when splitting in lines => [19Q4] [UX] "Buy X and pay Y of same product" discount line item with "2x" is shown duplicated on POS when splitting in lines
2019-10-31 17:26inaki_garciaIssue cloned0042168
2019-11-13 10:32ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2019-11-13 10:32ranjith_qualiantech_comStatusnew => scheduled
2019-11-18 15:23marvintmStatusscheduled => acknowledged
2019-11-18 15:23marvintmStatusacknowledged => scheduled
2019-11-22 14:14hgbotCheckin
2019-11-22 14:14hgbotNote Added: 0115773
2019-11-22 14:14hgbotStatusscheduled => resolved
2019-11-22 14:14hgbotResolutionopen => fixed
2019-11-22 14:14hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/277fd7837f2d749d0348a8a1960c55d1669ca552 [^]
2019-11-22 14:14hgbotCheckin
2019-11-22 14:14hgbotNote Added: 0115774
2019-11-28 17:25marvintmReview Assigned To => marvintm
2019-11-28 17:25marvintmStatusresolved => closed
2019-11-28 17:25marvintmFixed in Version => RR20Q1

Notes
(0115773)
hgbot   
2019-11-22 14:14   
Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: 277fd7837f2d749d0348a8a1960c55d1669ca552
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Fri Nov 22 18:43:52 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/277fd7837f2d749d0348a8a1960c55d1669ca552 [^]

Fixed issue 42131 : Chunks should be updated with available line qty

* When line is split with discount applied, chunks should be updated
  with minimum of chunks and line available qty

---
M web/org.openbravo.retail.discounts/js/discountsengine/common/rules/buy-x-pay-y-different-products-discount.js
---
(0115774)
hgbot   
2019-11-22 14:14   
Repository: tools/automation/pi-mobile
Changeset: a731f392963a96f3e60e17c16e8dcc4eca7ba9e2
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Fri Nov 22 18:44:16 2019 +0530
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/a731f392963a96f3e60e17c16e8dcc4eca7ba9e2 [^]

Verifies issue 42131 : Modified Automated Tests

---
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/I30542_BuyXPayYDiffProd_Lowest.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/I30542_BuyXPayYDiffProd_MostExpensive.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/MultiPromotions_BuyXPayYDiffProducts_LowestI.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/MultiPromotions_BuyXPayYDiffProducts_MostExpensiveI.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/splitline/SplitLineWithAutomaticPromoBuyXPayYDiffProd2.java
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/I42131_VerifyBuyXGiftYDiscountWithSplitLines.java
---