Openbravo Issue Tracking System - POS2
View Issue Details
0053490POS2POSpublic2023-09-19 12:572023-10-20 14:14
guillermogil 
ranjith_qualiantech_com 
highmajoralways
closedfixed 
5
 
 
No
0053490: User defined percentage raises an error when applied
User defined percentage raises an error when applied.
When applying it raises the following error message:
POS2.js:108 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'scale')
    at e.toBigDecimal (POS2.js:108:13)
    at e.div (POS2.js:128:19)
    at POS2.js:43282:23
    at Array.forEach (<anonymous>)
    at e.executeDiscountCalculation (POS2.js:43279:24)
    at e.calculateDiscounts (POS2.js:39390:12)
    at POS2.js:38741:11
    at Array.forEach (<anonymous>)
    at OB.Discounts.applyDiscounts (POS2.js:38735:19)
    at OB.Discounts.Pos.applyDiscounts (POS2.js:37927:36)
- Create a User Defined Percentage discount in the backoffice
- Login on POS
- Add a product
- Select the line
- Go to Discounts
- Click on your newly created discount
Error is raised
No tags attached.
png Screenshot from 2023-09-19 12-53-54.png (182,679) 2023-09-19 12:57
https://issues.openbravo.com/file_download.php?file_id=18966&type=bug
png
Issue History
2023-09-19 12:57guillermogilNew Issue
2023-09-19 12:57guillermogilAssigned To => Retail
2023-09-19 12:57guillermogilFile Added: Screenshot from 2023-09-19 12-53-54.png
2023-09-19 12:57guillermogilTriggers an Emergency Pack => No
2023-09-19 12:59ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2023-09-25 07:38ranjith_qualiantech_comStatusnew => scheduled
2023-10-04 08:01hgbotNote Added: 0155438
2023-10-20 14:14hgbotResolutionopen => fixed
2023-10-20 14:14hgbotStatusscheduled => closed
2023-10-20 14:14hgbotFixed in Version => RR24Q1
2023-10-20 14:14hgbotNote Added: 0156129
2023-10-20 14:14hgbotNote Added: 0156130

Notes
(0155438)
hgbot   
2023-10-04 08:01   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/120 [^]
(0156129)
hgbot   
2023-10-20 14:14   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts [^]
Changeset: ba80e9ceb8ce0a933b2d8ed604d8bb957a6e2d3e
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 03-10-2023 15:15:13
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/commit/ba80e9ceb8ce0a933b2d8ed604d8bb957a6e2d3e [^]

Fixed ISSUE-53490: Discount amount should be 0 by default for manual discounts
* If manual discount amount is not configured,
  then default value "0" should be used for discount calculation

---
M web/org.openbravo.retail.discounts/app/model/business-logic/discounts-engine/engine/rules/manual-amount-promotions-discount.js
M web/org.openbravo.retail.discounts/app/model/business-logic/discounts-engine/engine/rules/manual-linefinalprice-promotions-discount.js
M web/org.openbravo.retail.discounts/app/model/business-logic/discounts-engine/engine/rules/manual-percentage-promotions-discount.js
---
(0156130)
hgbot   
2023-10-20 14:14   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/120 [^]