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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0035077
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Retail Modules] Web POSmajoralways2017-01-19 09:342017-03-15 14:11
ReportermarvintmView Statuspublic 
Assigned Toranjith_qualiantech_com 
PriorityurgentResolutionfixedFixed in VersionRR17Q1
StatusclosedFix in branchFixed in SCM revisione4d2663673c3
ProjectionnoneETAnoneTarget VersionRR17Q1
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toguilleaer
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0035077: Discounts priority is not properly taken into account if incremental refresh updates the discount information

DescriptionDiscounts defined in the system should be applied following order of priority. When the Web POS is initially loaded, this works correctly. However, if incremental refresh later on updates some discounts, this may stop working properly.

The reason for this is that the query executed in the client-side doesn't contain an explicit order, which means that it implicitly uses the "_idx" property, automatically generated when records are loaded from the backend. The query in the backed does have proper order, so it works correctly on the first load.

However, if incremental refresh is triggered and it either adds new discounts, or updates previously existing discounts, their corresponding value for the idx column will reset to 0, and in this case, their effective priority will no longer be valid.
Steps To Reproduce- Define two discounts over the same product, disc1 and disc2 (disc1 priority=20, disc2 priority=40). They should not have the "apply next discount" checked.
- Log in the Web POS. Add the product to the ticket. Notice that the disc1 is applied. Delete the ticket.
- Go to the backend. Change the disc2 name and save.
- Go back to the web pos, and refresh the page (F5).
- Add the same product again. Notice that now the disc2 is applied instead. This is wrong.
Proposed SolutionIn the executor.js file, in the query executed for the Discounts, an orderby of priority and id should be added. Once this is done, the problem will no longer happen.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0035006 closedranjith_qualiantech_com Discounts priority is not properly taken into account if incremental refresh updates the discount information 

-  Notes
(0093930)
hgbot (developer)
2017-01-30 12:57

Repository: retail/backports/3.0RR17Q1/org.openbravo.retail.posterminal
Changeset: e4d2663673c31535c305556f157652706534358a
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Jan 30 17:27:00 2017 +0530
URL: http://code.openbravo.com/retail/backports/3.0RR17Q1/org.openbravo.retail.posterminal/rev/e4d2663673c31535c305556f157652706534358a [^]

Fixes issue 35077 : Adding orderClause for Discount

* default orderClause "_idx" is not stable when incremental refresh happens.
So for discount calcualtion, discount should be ordered by priority and idx

---
M web/org.openbravo.retail.posterminal/js/model/executor.js
---
(0093931)
hgbot (developer)
2017-01-30 12:58

Repository: retail/backports/3.0RR17Q1/pi-mobile
Changeset: e9dd08353b96729ad73cdcbe106eacd1d9ebd817
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Jan 30 17:21:08 2017 +0530
URL: http://code.openbravo.com/retail/backports/3.0RR17Q1/pi-mobile/rev/e9dd08353b96729ad73cdcbe106eacd1d9ebd817 [^]

Verifies issue 35077 : Added automated test 'I35077_VerifyDiscountPriorityOnUpdate'

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/I35077_VerifyDiscountPriorityOnUpdate.java
---
(0095040)
hgbot (developer)
2017-03-15 14:11

Repository: tools/automation/pi-mobile
Changeset: e9dd08353b96729ad73cdcbe106eacd1d9ebd817
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Jan 30 17:21:08 2017 +0530
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/e9dd08353b96729ad73cdcbe106eacd1d9ebd817 [^]

Verifies issue 35077 : Added automated test 'I35077_VerifyDiscountPriorityOnUpdate'

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/I35077_VerifyDiscountPriorityOnUpdate.java
---

- Issue History
Date Modified Username Field Change
2017-01-30 09:46 marvintm Type defect => backport
2017-01-30 09:46 marvintm Target Version => RR17Q1
2017-01-30 12:57 hgbot Checkin
2017-01-30 12:57 hgbot Note Added: 0093930
2017-01-30 12:57 hgbot Status scheduled => resolved
2017-01-30 12:57 hgbot Resolution open => fixed
2017-01-30 12:57 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/c22376541cdcaed876f82bac2cb2faa2a87a08da [^] => http://code.openbravo.com/retail/backports/3.0RR17Q1/org.openbravo.retail.posterminal/rev/e4d2663673c31535c305556f157652706534358a [^]
2017-01-30 12:58 hgbot Checkin
2017-01-30 12:58 hgbot Note Added: 0093931
2017-02-02 11:31 guilleaer Review Assigned To => guilleaer
2017-02-02 11:31 guilleaer Status resolved => closed
2017-02-02 11:31 guilleaer Fixed in Version => RR17Q1
2017-03-15 14:11 hgbot Checkin
2017-03-15 14:11 hgbot Note Added: 0095040


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker