Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0054007
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Discounts and Promotionsmajoralways2023-11-22 22:082023-12-18 12:17
ReportersofidossantView Statuspublic 
Assigned ToSABARINATH P 
PriorityurgentResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionRR23Q1SCM revision 
Merge Request Statusopen
Review Assigned Tomarvintm
OBNetwork customerOBPS
Support ticket81099
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0054007: Price Adjustment Discounts, do not follow the Avaialability tab in the webPOS

DescriptionThe client is testing promotions for Black Friday, and they do not apply when a day of the week is enabled in the "Avaialability" tab

Specific:
Price Adjustment: 25%
Availability:
* Day of week: Wednesday
* From : 11:15:00
*To: 11:45:00

If we analyze the .js code

const weekDay = currentDate.getDay();
..
..
const availableDateTimes = discountImpl.availableDateTimes.filter(dateTime=>{
const day = parseInt(dateTime.day, 10);
if (day === 0) {
return true;
}
if (weekDay === day || (weekDay === 0 && day === 7)) {
return true;
}
return false;

"day" contains the value 3 (Wednesday)
"weekDay" contains the value 2, which corresponds to the value Wednesday getDay()

For that reason when we apply a discount for a day of the week other than "Sunday" it does not apply...
Steps To ReproduceSet up a price adjustment on 25% discounts, and Availability:
* Day of week: Wednesday
* From : 11:15:00
*To: 11:45:00

checked if we can see the discount


PLEASE , you use the hour in argentina or guatemala in the computer
Proposed SolutionChange
const weekDay = currentDate.getDay();
..
..
const availableDateTimes = discountImpl.availableDateTimes.filter(dateTime=>{
const day = parseInt(dateTime.day, 10);
if (day === 0) {
return true;
}
if (weekDay === day || (weekDay === 0 && day === 7)) {
return true;
}
return false;

"day" contiene el valor 3 ( MiƩrcoles )
"weekDay" contiene el valor 2, que se corresponde con el valor MiƩrcoles getDay()
TagsNo tags attached.
Attached Filespng file icon bf_disc_02.png [^] (137,152 bytes) 2023-11-22 22:08


png file icon bf_disc_01.png [^] (603,888 bytes) 2023-11-22 22:09
patch file icon 54007 (2).patch [^] (5,842 bytes) 2023-12-18 12:12 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0157683)
marvintm (viewer)
2023-11-27 14:55

Sorry but we haven't been able to reproduce the issue.

We define availability to one specific day of the week (for instance Monday), and then the discount is applied correctly if it is Monday, and it is not applied if it is not. It also seems to take correctly into account the hours as far as we can see.

So we need a clear explanation of how it can be reproduced, with clear steps.
(0157761)
hgbot (developer)
2023-11-28 14:32

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/127 [^]
(0157788)
hgbot (developer)
2023-11-29 09:51

Merge request closed: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/127 [^]
(0158292)
SABARINATH P (viewer)
2023-12-18 12:11

Attaching the patch since it doesn't required backport.

- Issue History
Date Modified Username Field Change
2023-11-22 22:08 sofidossant New Issue
2023-11-22 22:08 sofidossant Assigned To => Retail
2023-11-22 22:08 sofidossant File Added: bf_disc_02.png
2023-11-22 22:08 sofidossant OBNetwork customer => OBPS
2023-11-22 22:08 sofidossant Support ticket => 81099
2023-11-22 22:08 sofidossant Triggers an Emergency Pack => No
2023-11-22 22:09 sofidossant File Added: bf_disc_01.png
2023-11-23 11:30 sofidossant Priority high => urgent
2023-11-27 06:50 SABARINATH P Assigned To Retail => SABARINATH P
2023-11-27 11:30 SABARINATH P Status new => scheduled
2023-11-27 14:55 marvintm Review Assigned To => marvintm
2023-11-27 14:55 marvintm Note Added: 0157683
2023-11-27 14:55 marvintm Status scheduled => closed
2023-11-27 14:55 marvintm Resolution open => unable to reproduce
2023-11-27 17:09 sofidossant Steps to Reproduce Updated View Revisions
2023-11-27 17:09 sofidossant Resolution unable to reproduce => open
2023-11-27 17:09 sofidossant Status closed => new
2023-11-28 12:05 sofidossant version RR23Q3.1 => RR23Q1
2023-11-28 14:32 hgbot Merge Request Status => open
2023-11-28 14:32 hgbot Note Added: 0157761
2023-11-28 14:40 SABARINATH P Status new => scheduled
2023-11-29 09:51 hgbot Note Added: 0157788
2023-12-18 11:44 sreehari Assigned To SABARINATH P => sreehari
2023-12-18 12:09 SABARINATH P Assigned To sreehari => SABARINATH P
2023-12-18 12:11 SABARINATH P Note Added: 0158292
2023-12-18 12:12 SABARINATH P File Added: 54007 (2).patch
2023-12-18 12:17 SABARINATH P Status scheduled => resolved
2023-12-18 12:17 SABARINATH P Resolution open => fixed
2023-12-18 12:17 SABARINATH P Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker