Openbravo Issue Tracking System - Retail Modules
View Issue Details
0045465Retail ModulesDiscounts and Promotionspublic2020-11-19 16:532020-11-23 06:57
AugustoMauch 
ranjith_qualiantech_com 
highmajoralways
closedfixed 
5
 
RR21Q1 
No
0045465: Web Pos still does not apply correctly the "Ending Date" of a discount or promotion
This issue is a continuation of https://issues.openbravo.com/view.php?id=44635 [^]

Web Pos does not apply correctly the Starting date and Ending date filters of a discount if those filters include timezone information, which has already happened in clients that don't have any customizations that affects this functionality.

For instance:
new Date(new Date('2013-06-01T00:00:00+01:00').toISOString().split('T')[0])
returns
Fri May 31 2013 02:00:00 GMT+0200 (Central European Summer Time)

This is wrong, in the backend it was defined as 2013-06-01, but now in frontend has been converted to 2013-31-05

To fix it, just remove the time part before invoking the toISOString function:

new Date(new Date('2013-06-01T00:00:00+01:00'.split('T')[0]).toISOString())
Sat Jun 01 2013 02:00:00 GMT+0200 (Central European Summer Time)"
Same steps as described for issue 44635 make this issue reproducible in the client production and test server.

Backend:
1. Configure a new discount, for example: Variable Discount per Total Amount
2. Set Ending Date = today.

Web POS:
1. Open a new till with date = today.
2. Add a product
3. Try to add the previous discount

Actual Result: The discount is not available.
Expected result: The discount should be available:
Ending Dat: The Date To indicates the end date of a range (inclusive)

-> If you modify the Ending date = a later day, the discount is available.
Replace

new Date(new Date(stringDate).toISOString().split('T')[0])

with

new Date(new Date(stringDate.split('T')[0]).toISOString())
NOR
caused by defect 0044635 closed ranjith_qualiantech_com Web Pos does not apply correctly the "Ending Date" of a discount or promotion 
Issue History
2020-11-19 16:53AugustoMauchNew Issue
2020-11-19 16:53AugustoMauchAssigned To => ranjith_qualiantech_com
2020-11-19 16:53AugustoMauchResolution time => 1597010400
2020-11-19 16:53AugustoMauchTriggers an Emergency Pack => No
2020-11-19 16:53AugustoMauchIssue generated from0044635
2020-11-19 16:54rafarodaTag Attached: NOR
2020-11-19 16:54rafarodaRelationship addedcaused by 0044635
2020-11-19 17:31marvintmResolution time1597010400 => 1605826800
2020-11-19 17:45marvintmResolution time1605826800 => 1606690800
2020-11-20 06:08ranjith_qualiantech_comStatusnew => scheduled
2020-11-23 06:35hgbotNote Added: 0124553
2020-11-23 06:36hgbotNote Added: 0124554
2020-11-23 06:36hgbotNote Added: 0124555
2020-11-23 06:56hgbotNote Added: 0124562
2020-11-23 06:57hgbotNote Added: 0124563
2020-11-23 06:57hgbotNote Added: 0124564
2020-11-23 06:57hgbotNote Added: 0124565
2020-11-23 06:57hgbotResolutionopen => fixed
2020-11-23 06:57hgbotStatusscheduled => closed
2020-11-23 06:57hgbotFixed in Version => RR21Q1
2020-11-23 06:57hgbotNote Added: 0124566

Notes
(0124553)
hgbot   
2020-11-23 06:35   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/196 [^]
(0124554)
hgbot   
2020-11-23 06:36   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.activediscountspopup/-/merge_requests/3 [^]
(0124555)
hgbot   
2020-11-23 06:36   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/9 [^]
(0124562)
hgbot   
2020-11-23 06:56   
Merge request closed: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.activediscountspopup/-/merge_requests/3 [^]
(0124563)
hgbot   
2020-11-23 06:57   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 7fd7308493a2a9771468472009129e316632776b
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2020-11-23T05:57:17+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/7fd7308493a2a9771468472009129e316632776b [^]

Related to ISSUE-45465: Updated Discount Date validation
* Discount date should be validated without time

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0124564)
hgbot   
2020-11-23 06:57   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/196 [^]
(0124565)
hgbot   
2020-11-23 06:57   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/9 [^]
(0124566)
hgbot   
2020-11-23 06:57   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts [^]
Changeset: 0c14adcba1948de2a61ec87eee9aa18f9e76e76b
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2020-11-23T08:12:19+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/commit/0c14adcba1948de2a61ec87eee9aa18f9e76e76b [^]

Fixed ISSUE-45465: Updated Discount Date validation
* Discount date should be validated without time

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