Openbravo Issue Tracking System - Retail Modules
View Issue Details
0042310Retail ModulesDiscounts and Promotionspublic2019-10-28 12:302019-11-28 17:25
inaki_garcia 
ranjith_qualiantech_com 
highminoralways
closedfixed 
5
main 
RR19Q4RR19Q4 
marvintm
No
0042310: [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.
blocks defect 0042131 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 
Issue History
2019-11-18 15:23marvintmTypedefect => backport
2019-11-18 15:23marvintmTarget Version => RR19Q4
2019-11-28 10:47hgbotCheckin
2019-11-28 10:47hgbotNote Added: 0115929
2019-11-28 10:47hgbotStatusscheduled => resolved
2019-11-28 10:47hgbotResolutionopen => fixed
2019-11-28 10:47hgbotFixed in SCM revision => http://code.openbravo.com/retail/backports/3.0RR19Q4/org.openbravo.retail.discounts/rev/1481db46664610a506098e5ac5f08690b3419a24 [^]
2019-11-28 10:47hgbotCheckin
2019-11-28 10:47hgbotNote Added: 0115930
2019-11-28 17:25marvintmReview Assigned To => marvintm
2019-11-28 17:25marvintmStatusresolved => closed
2019-11-28 17:25marvintmFixed in Version => RR19Q4

Notes
(0115929)
hgbot   
2019-11-28 10:47   
Repository: retail/backports/3.0RR19Q4/org.openbravo.retail.discounts
Changeset: 1481db46664610a506098e5ac5f08690b3419a24
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Thu Nov 28 15:17:10 2019 +0530
URL: http://code.openbravo.com/retail/backports/3.0RR19Q4/org.openbravo.retail.discounts/rev/1481db46664610a506098e5ac5f08690b3419a24 [^]

Fixed issue 42310 : 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
---
(0115930)
hgbot   
2019-11-28 10:47   
Repository: retail/backports/3.0RR19Q4/pi-mobile
Changeset: 3bbb4cbb6987103e4748defa9ebdc21028a5b3e3
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Fri Nov 22 18:44:16 2019 +0530
URL: http://code.openbravo.com/retail/backports/3.0RR19Q4/pi-mobile/rev/3bbb4cbb6987103e4748defa9ebdc21028a5b3e3 [^]

Verifies issue 42310 : 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
---