Openbravo Issue Tracking System - Retail Modules
View Issue Details
0045445Retail ModulesDiscounts and Promotionspublic2020-10-28 18:002020-11-16 07:37
ngarcia 
ranjith_qualiantech_com 
urgentmajoralways
closedfixed 
5
RR20Q3 
RR20Q3.2RR20Q3.2 
marvintm
No
0045445: [Save Removed Tickets] Screen get frozen when trying to delete a line with a manual discount
[Save Removed Tickets] Screen get frozen when trying to delete a line with a manual discount

It is reproduced in 20Q3 but not in PI
In the backoffice:
   Set the Web POS Save Removed Tickets preference to Y
   Create a new record in Discounts And Promotions window:
      Organization: *
      Discount Promotion Type: User Defined Percentage
      Starting date: today
      Apply Next Discount/Promotion: Y
      Included...: All excluding defined
      Percentage: 20
      Allow to Apply in Negative Lines: Y
      Log out and log in

In the POS:
   Create a new ticket
   Add Adhesive body warmers product to it
   Add the previously created discount and Apply to all lines
   Try to delete the line and check the screen is locked (grey)

The log shows:

Uncaught dodivide(): Divide by 0
D @ BigDecimal-all-1.0.3.min.js:14
v @ BigDecimal-all-1.0.3.min.js:14
div @ 24ba54b2459bf10d1c792e3d526e56ca.js:1302
div @ 24ba54b2459bf10d1c792e3d526e56ca.js:1312
pushDiscountAndUpdate @ 24ba54b2459bf10d1c792e3d526e56ca.js:2407
addDiscount @ 24ba54b2459bf10d1c792e3d526e56ca.js:2406
(anonymous) @ 24ba54b2459bf10d1c792e3d526e56ca.js:2491
executeDiscountCalculation @ 24ba54b2459bf10d1c792e3d526e56ca.js:2491
calculateDiscounts @ 24ba54b2459bf10d1c792e3d526e56ca.js:2383
(anonymous) @ 24ba54b2459bf10d1c792e3d526e56ca.js:2363
OB.Discounts.applyDiscounts @ 24ba54b2459bf10d1c792e3d526e56ca.js:2363
calculateLocal @ 24ba54b2459bf10d1c792e3d526e56ca.js:5426
(anonymous) @ 24ba54b2459bf10d1c792e3d526e56ca.js:5434
callbackExecutor @ 24ba54b2459bf10d1c792e3d526e56ca.js:1320
executeHooks @ 24ba54b2459bf10d1c792e3d526e56ca.js:1320
OB.Discounts.Pos.calculateDiscounts @ 24ba54b2459bf10d1c792e3d526e56ca.js:5434
calculateReceipt @ 24ba54b2459bf10d1c792e3d526e56ca.js:2621
postDeleteLine @ 24ba54b2459bf10d1c792e3d526e56ca.js:2664
_deleteLines @ 24ba54b2459bf10d1c792e3d526e56ca.js:2682
(anonymous) @ 24ba54b2459bf10d1c792e3d526e56ca.js:2684
(anonymous) @ 24ba54b2459bf10d1c792e3d526e56ca.js:2709
callbackExecutor @ 24ba54b2459bf10d1c792e3d526e56ca.js:1320
executeHooks @ 24ba54b2459bf10d1c792e3d526e56ca.js:1320
deleteLineOnceChecked @ 24ba54b2459bf10d1c792e3d526e56ca.js:2694
_deleteLine @ 24ba54b2459bf10d1c792e3d526e56ca.js:2718
_deleteLines @ 24ba54b2459bf10d1c792e3d526e56ca.js:2684


   
No tags attached.
blocks defect 0045328 closed ranjith_qualiantech_com [Save Removed Tickets] Screen get frozen when trying to delete a line with a manual discount 
Issue History
2020-11-16 06:44marvintmTypedefect => backport
2020-11-16 06:44marvintmTarget Version => RR20Q3.2
2020-11-16 06:46ranjith_qualiantech_comStatusscheduled => acknowledged
2020-11-16 06:47ranjith_qualiantech_comStatusacknowledged => scheduled
2020-11-16 07:03hgbotResolutionopen => fixed
2020-11-16 07:03hgbotStatusscheduled => resolved
2020-11-16 07:03hgbotFixed in Version => RR20Q3.2
2020-11-16 07:03hgbotNote Added: 0124393
2020-11-16 07:37marvintmReview Assigned To => marvintm
2020-11-16 07:37marvintmStatusresolved => closed

Notes
(0124393)
hgbot   
2020-11-16 07:03   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts [^]
Changeset: 752a742c98a426e48e9f6e40d9ce4c7f18aa595a
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2020-11-16T11:32:52+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/commit/752a742c98a426e48e9f6e40d9ce4c7f18aa595a [^]

Fixed ISSUE-45445: Discounts should not be calculated if line qty is zero
* With Save Removed Ticket Pref. is enabled, discount should not be caluculated for the line since line qty will be zero when deleting it

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