Openbravo Issue Tracking System - POS2
View Issue Details
0050634POS2Corepublic2022-10-25 16:272022-11-30 07:36
hbrasme 
ranjith_qualiantech_com 
highmajoralways
closedfixed 
5
22Q3 
 
No
0050634: [PROMO] The price adjustment discount has different behavior if a % or an amount is defined
The price adjustment discount type has a different behavior depend on if the defined discount is a % or an amount. See image 'User Cases Comparation'.
 
User Case 1 (% + isMul=No) and User Case 3 (Amt + isMul=No) → same behaviour where there are several lines in the ticket, the discount is splitted by line.

User Case 2 (% + isMul=Yes) and User Case 4 (Amt + isMul=Yes) → different behaviour where there are several lines in the ticket

- For User Case 2 → The double of the defined discount is applied per each line. KO

- For User Case 4 → The discount is splitted by line. OK
Create two PriceAdjustment Promotions:
*User Case 2 (% + isMul=Yes)
*User Case 4 (Amt + isMul=Yes)


On the POS2
*Create a ticket for which the User Case 2 applies in several lines --> The double of the defined discount is applied per each line.
*Create a ticket for which the User Case 4 applies in several lines --> the discount is spplited by line.


Steps to reproduce in livebuilds
Backoffice
1) Create discount with type "Price Adjustment", Discount % as "10", Is Multiple as "checked", Units per package as "2"
POS
1) Add 4 Products.
2) Discount is correct applied - OK
3) Split receipt line into 4 lines
4) Discount is not correct applied - KO
Same problem will occur for ungrouped products
The price adjustment discount type must work in the same way regardless a % discount or an amount discount will be defined in both cases:
*Is Multiple=Yes
*Is Multiple=No
FASH
png User Cases Comparation.png (214,697) 2022-10-27 16:20
https://issues.openbravo.com/file_download.php?file_id=17731&type=bug
png
Issue History
2022-10-25 16:27hbrasmeNew Issue
2022-10-25 16:27hbrasmeAssigned To => Triage Platform Base
2022-10-25 16:27hbrasmeFile Added: 2141 - Result Grouped Product.png
2022-10-25 16:27hbrasmeTriggers an Emergency Pack => No
2022-10-25 16:27hbrasmeFile Added: 2141 - Result Split Product.png
2022-10-25 16:34rafarodaTag Attached: FASH
2022-10-25 17:29avicentePrioritynormal => high
2022-10-25 17:36avicenteIssue Monitored: avicente
2022-10-26 08:43hbrasmeNote Added: 0142586
2022-10-27 15:42avicenteSummary[PROMO] - Advantages - No split of the discount amount if several quantities of the same item => [PROMO] The price adjustment discount has different behavior if a % or an amount is defined
2022-10-27 15:42avicenteDescription Updatedbug_revision_view_page.php?rev_id=25003#r25003
2022-10-27 15:42avicenteSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=25005#r25005
2022-10-27 15:42avicenteProposed Solution updated
2022-10-27 16:20avicenteDescription Updatedbug_revision_view_page.php?rev_id=25006#r25006
2022-10-27 16:20avicenteSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=25007#r25007
2022-10-27 16:20avicenteFile Added: User Cases Comparation.png
2022-10-27 16:35marvintmAssigned ToTriage Platform Base => Triage Omni OMS
2022-10-31 10:24avicenteNote Deleted: 0142586
2022-10-31 10:24avicenteFile Deleted: 2141 - Result Split Product.png
2022-10-31 10:24avicenteFile Deleted: 2141 - Result Grouped Product.png
2022-11-02 09:46marvintmAssigned ToTriage Omni OMS => Retail
2022-11-02 11:03ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2022-11-02 11:03ranjith_qualiantech_comStatusnew => scheduled
2022-11-09 13:50ranjith_qualiantech_comSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=25082#r25082
2022-11-09 13:52hgbotNote Added: 0143304
2022-11-30 07:36hgbotResolutionopen => fixed
2022-11-30 07:36hgbotStatusscheduled => closed
2022-11-30 07:36hgbotNote Added: 0144236
2022-11-30 07:36hgbotFixed in Version => RR23Q1
2022-11-30 07:36hgbotNote Added: 0144237

Notes
(0143304)
hgbot   
2022-11-09 13:52   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/71 [^]
(0144236)
hgbot   
2022-11-30 07:36   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/71 [^]
(0144237)
hgbot   
2022-11-30 07:36   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts [^]
Changeset: 750022ee8483de1dec962153413fa92e5079a084
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 30-11-2022 06:36:19
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/commit/750022ee8483de1dec962153413fa92e5079a084 [^]

Fixed ISSUE-50634: Discount Amount should be updated based on chunks of discount
* If discount is configured with multiple unit per package,
  then discount amount should be updated with number of packages applied

---
M web/org.openbravo.retail.discounts/app/model/business-logic/discounts-engine/engine/rules/price-adjustment-discount.js
---