Openbravo Issue Tracking System - Retail Modules
View Issue Details
0051775Retail ModulesDiscounts and Promotionspublic2023-03-03 15:382023-03-23 09:59
ivazquez 
ranjith_qualiantech_com 
highmajoralways
closedfixed 
5
RR22Q1.3 
RR22Q1.3RR23Q2 
marvintm
No
0051775: Problem with TPV promos end date
The problem occurs at the time of loading the promotions in the POS and the application of the same taking the end date of these.

Reproduced in:

https://livebuilds.openbravo.com/retail_mp_3.0RR22Q1.3/web/org.openbravo.retail.posterminal/?terminal=VBS-1#retail.pointofsale [^]

Video reproduced in live builds: https://youtu.be/4ryxJa3g0ko [^]

Video reproduced in client's environment: https://youtu.be/xqsQGdk1GvU [^]

-Create two new promotions where one has an end date of today and the other has a start date of tomorrow.
- Perform a master data refresh to upload these promotions to the POS.
- Verify that the first promotion with today's end date applies.
- We change the day (simulating that it is 12 o'clock at night and we change the day, which can happen).
- Perform a master data refresh and we see that the same promotion continues even though the end date has expired.
No tags attached.
Issue History
2023-03-03 15:38ivazquezNew Issue
2023-03-03 15:38ivazquezAssigned To => Retail
2023-03-03 15:38ivazquezTriggers an Emergency Pack => No
2023-03-03 15:54PracticsIssue Monitored: Practics
2023-03-03 16:21ivazquezPrioritynormal => high
2023-03-07 07:54ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2023-03-08 02:40ranjith_qualiantech_comStatusnew => scheduled
2023-03-14 05:48hgbotNote Added: 0147507
2023-03-22 08:33hgbotResolutionopen => fixed
2023-03-22 08:33hgbotNote Added: 0147805
2023-03-22 08:33hgbotStatusscheduled => closed
2023-03-22 08:33hgbotFixed in Version => RR23Q2
2023-03-22 08:33hgbotNote Added: 0147806
2023-03-22 18:36ivazquezNote Added: 0147854
2023-03-22 18:36ivazquezStatusclosed => new
2023-03-23 09:41marvintmStatusnew => scheduled
2023-03-23 09:48marvintmNote Added: 0147883
2023-03-23 09:48marvintmStatusscheduled => resolved
2023-03-23 09:48marvintmReview Assigned To => marvintm
2023-03-23 09:48marvintmStatusresolved => closed
2023-03-23 09:59ranjith_qualiantech_comNote Added: 0147886

Notes
(0147507)
hgbot   
2023-03-14 05:48   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1096 [^]
(0147805)
hgbot   
2023-03-22 08:33   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1096 [^]
(0147806)
hgbot   
2023-03-22 08:33   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: be394d6a9ed62072be8e44580a78ceeb562b324c
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 22-03-2023 07:27:57
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/be394d6a9ed62072be8e44580a78ceeb562b324c [^]

Fixed ISSUE-51775: Receipt orderDate should be updated when adding first product

---
M web/org.openbravo.retail.posterminal/app/model/business-object/ticket/AddProductUtils.js
---
(0147854)
ivazquez   
2023-03-22 18:36   
One part of the problem was solved, but the other part is still not working and I will explain why:

Demonstration video in Spanish: https://www.youtube.com/watch?v=peR-g6kSt6w [^]

If I have a line with a product that has a discount applied which expires today and I change the date of my computer the next day (something that can happen if I am working around 23:50hs and I switch to 00hs which would mean a change of day), even if I refresh data, the discount is not recalculated and continues leaving the expired discount applied to the line (TESTOB1 in the video).
But if I delete the line and add the same product, the valid discount is applied (TESTOB2 in the video).
(0147883)
marvintm   
2023-03-23 09:48   
The reason this behavior happens is because the order received the order date of the 22nd, and even if the date of the system changed to the 23rd, the order date is preserved, and therefore the discounts that are applied are the ones for the 22nd.

In the POS, we have the convention that the order date is set when the products start being added to the ticket. Once it is set, it is used to calculate the discounts. This is the convention that was decided, and the previous change implemented a fix to preserve this behavior, even in case the ticket came from the previous day (in case it did not have any products).

We believe that functionally this criteria makes sense. In most cases, this criteria will favor the customer, but we believe this is fair, as if the sale started on the 23rd, even if the cashier is late, he adds the products slowly and the 24th is reached, in most cases most probably we will want to preserve the discounts that were defined in the 23rd.

We also understand that some customers might disagree with this policy, and would want the discounts for the 24rd to apply in this case. However, we need to decide what should be the general criteria, and we believe the one we are using is the easiest to understand, and the one that makes more sense in general.

And if somebody wants a different behavior, they can just remove the ticket and create it again, and then the discounts for a new day will start applying.
(0147886)
ranjith_qualiantech_com   
2023-03-23 09:59   
Changes from the issue https://issues.openbravo.com/view.php?id=51830 [^] is required for this issue.