Openbravo Issue Tracking System - Retail Modules
View Issue Details
0049517Retail ModulesDiscounts and Promotionspublic2022-06-09 09:492022-07-19 06:45
rfacon 
radhakrishnan 
normalmajoralways
closedfixed 
5
 
RR22Q4 
No
0049517: API call - Availability of a promotion is calculated on universal time by the API
When configuring the availability subtab of a promotion using hours filters in the Back Office, this promotion is wrongly applied when a call is done on API Discount
1. Configure a discount in the Backend, for example:
- Discount/Promotion Type: Price adjustment
- Active = Y
- Define the discount for a product, for example Baby carrier and select "Included Products" = Only those defined.

2. In the subtab 'Availability' add a row: define 'Monday' from '0:00:00' to '23:59:59'

3. Call the API Discount https://{{OPENBRAVO_URL}}/openbravo/ws/org.openbravo.discounts.discount [^] with the product put at step 1 and an order date set on a Monday, "orderDate": "2022-06-06T13:59:00" for example

You will see the discount applied as configured.

4. Change the hour of the 'orderDate" doing several calls :
- "orderDate": "2022-06-06T23:00:00" (Monday)
- "orderDate": "2022-06-05T23:00:00" (Sunday)

In the summer time for France ("orderDate": "2022-06-06") you will see the discount applied from 'Sunday 22:00:00' to 'Monday 21:59:59' (UTC+2)

In the winter time for France ("orderDate": "2022-03-07") you will see the discount applied from 'Sunday 23:00:00' to 'Monday 22:59:59' (UTC+1)

An example of API Discount call is set in attachements
NOR
related to feature request 0048383pi closed jetxarri Allow to activate promotions on 2 distinct time slots within the same day 
related to defect 0049204 closed ranjith_qualiantech_com Modifying the Availibility subtab doesn't update the discount audit section 
related to defect 0049195 closed radhakrishnan Availability subtab records can be deleted 
related to defect 0049194 closed radhakrishnan Discount availability should be validated with POS time instead of server time 
related to defect 0049518 closed radhakrishnan API call - A promotion with an availability set on the last hours of a day is also applied on the last hours of the day before 
txt Exemple of call API Discount.txt (440) 2022-06-09 09:49
https://issues.openbravo.com/file_download.php?file_id=17138&type=bug
Issue History
2022-06-09 09:49rfaconNew Issue
2022-06-09 09:49rfaconAssigned To => Retail
2022-06-09 09:49rfaconFile Added: Exemple of call API Discount.txt
2022-06-09 09:49rfaconTriggers an Emergency Pack => No
2022-06-09 23:39rafarodaTag Attached: NOR
2022-06-09 23:40rafarodaRelationship addedrelated to 0049518
2022-06-09 23:41rafarodaRelationship addedrelated to 0048383
2022-06-09 23:43rafarodaRelationship addedrelated to 0049204
2022-06-09 23:44rafarodaRelationship addedrelated to 0049195
2022-06-09 23:45rafarodaRelationship addedrelated to 0049194
2022-06-21 13:38radhakrishnanAssigned ToRetail => radhakrishnan
2022-06-21 13:39radhakrishnanStatusnew => scheduled
2022-06-23 07:37hgbotNote Added: 0138660
2022-07-19 06:45hgbotResolutionopen => fixed
2022-07-19 06:45hgbotStatusscheduled => closed
2022-07-19 06:45hgbotFixed in Version => RR22Q4
2022-07-19 06:45hgbotNote Added: 0139398
2022-07-19 06:45hgbotNote Added: 0139399

Notes
(0138660)
hgbot   
2022-06-23 07:37   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/58 [^]
(0139398)
hgbot   
2022-07-19 06:45   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts [^]
Changeset: 25f475583e5125d3e6794faa515ef9ac6e14a968
Author: Radhakrishnan Seeman <radhakrishnan@qualiantech.com>
Date: 19-07-2022 04:45:22
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/commit/25f475583e5125d3e6794faa515ef9ac6e14a968 [^]

Fixed ISSUE-49517: Validated the availabilty date with current date

---
M web/org.openbravo.retail.discounts/app/model/business-logic/discounts-engine/engine/discount-rules.js
---
(0139399)
hgbot   
2022-07-19 06:45   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/58 [^]