Openbravo Issue Tracking System - Retail Modules
View Issue Details
0038736Retail ModulesDiscounts and Promotionspublic2018-06-12 11:292019-01-24 17:05
anderaranguren 
rqueralta 
highmajoralways
closedfixed 
5
 
RR18Q3 
marvintm
No
0038736: Problem when applying a scaled price discount on the Web POS in OFFLINE mode
While offline mode, if you select a product with a discount (e.g. fixed percentage discount) and after that select a product with scaled price discount the Web POS does not work as expected.
- Install the Scaled Price discounts module
- Log in Backoffice and create a new discount on 'Discounts and Promotions' window, discount type: Scaled Price
- Add a product to this discount (e.g. avalanche transeiver)
- Set up the scaled price tab (1 item -> 25% , 2 items -> 35%, 3 items -> 50%)
- Go to the web POS, and add a product that has a different discount (e.g. gps handheld with 'fixed percentage discount')
- After that add the product with scaled price discount (avalanche transceiver)
- It works fine. But if you go OFFLINE, refresh the Web POS and do these last steps (add both products to the order) again while offline, it does not work properly.
No tags attached.
png online.png (132,309) 2018-06-12 11:29
https://issues.openbravo.com/file_download.php?file_id=11850&type=bug
png

png offline.png (266,562) 2018-06-12 11:29
https://issues.openbravo.com/file_download.php?file_id=11851&type=bug
Issue History
2018-06-12 11:29anderarangurenNew Issue
2018-06-12 11:29anderarangurenAssigned To => Retail
2018-06-12 11:29anderarangurenFile Added: online.png
2018-06-12 11:29anderarangurenResolution time => 1530568800
2018-06-12 11:29anderarangurenTriggers an Emergency Pack => No
2018-06-12 11:29anderarangurenFile Added: offline.png
2018-06-12 12:03PracticsIssue Monitored: Practics
2018-06-14 13:11rqueraltaAssigned ToRetail => rqueralta
2018-06-14 13:11rqueraltaStatusnew => scheduled
2018-06-18 08:50jorge-garciaNote Added: 0105190
2018-06-18 08:50jorge-garciaAssigned Torqueralta => anderaranguren
2018-06-18 08:50jorge-garciaStatusscheduled => feedback
2018-06-18 09:53anderarangurenSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=17312#r17312
2018-06-18 10:01jorge-garciaStatusfeedback => scheduled
2018-06-18 10:01jorge-garciaAssigned Toanderaranguren => rqueralta
2018-06-20 18:41hgbotCheckin
2018-06-20 18:41hgbotNote Added: 0105287
2018-06-20 18:41hgbotStatusscheduled => resolved
2018-06-20 18:41hgbotResolutionopen => fixed
2018-06-20 18:41hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.scaledprice/rev/c72b5910588f02d40696d860b595a6c128f83482 [^]
2018-06-25 08:52marvintmNote Added: 0105353
2018-06-25 08:52marvintmStatusresolved => new
2018-06-25 08:52marvintmResolutionfixed => open
2018-06-25 19:00hgbotCheckin
2018-06-25 19:00hgbotNote Added: 0105371
2018-06-26 20:56hgbotCheckin
2018-06-26 20:56hgbotNote Added: 0105457
2018-06-26 22:28rqueraltaStatusnew => scheduled
2018-06-26 22:29rqueraltaStatusscheduled => resolved
2018-06-26 22:29rqueraltaResolutionopen => fixed
2018-06-27 09:04marvintmReview Assigned To => marvintm
2018-06-27 09:04marvintmStatusresolved => closed
2018-06-27 09:04marvintmFixed in Version => RR18Q3
2018-07-09 15:19hgbotCheckin
2018-07-09 15:19hgbotNote Added: 0105678
2019-01-24 17:05hgbotCheckin
2019-01-24 17:05hgbotNote Added: 0109240

Notes
(0105190)
jorge-garcia   
2018-06-18 08:50   
The issue is not reproducible in PI following the steps to reproduce, feedback requested.
(0105287)
hgbot   
2018-06-20 18:41   
Repository: erp/pmods/org.openbravo.retail.discounts.scaledprice
Changeset: c72b5910588f02d40696d860b595a6c128f83482
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com>
Date: Tue Jun 19 16:12:47 2018 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.scaledprice/rev/c72b5910588f02d40696d860b595a6c128f83482 [^]

Fixed issue 38736: Problem when applying a scaled price discount on the Web POS
in OFFLINE mode

- Added OBDSCAL_Scale model into OB.Model, to make it is available in offline
mode

---
M web/org.openbravo.retail.discounts.scaledprice/js/scaledpricemodel.js
---
(0105353)
marvintm   
2018-06-25 08:52   
The solution is not correct. The modified model is a generatedStructure model, so it is generated automatically from the DAL model. We don't want or need to change this, so this part should be reverted. We also don't need to change the name of the variable, or the way the model is registered, all of this was correct.

Instead, the main problem is that the request to load the model structure is not being cached inside the application cache. To solve this problem, we need to add the request to the manifest, like it is currently done in ApplicationCacheComponent.java.

However, this model exists inside a module, so we need to implement a CoreAppCacheResourceProvider class, and then add the request there. You can check DiscountsByTotalAppCacheProvider.java for a very similar example.
(0105371)
hgbot   
2018-06-25 19:00   
Repository: erp/pmods/org.openbravo.retail.discounts.scaledprice
Changeset: ec726fb2b439c8a45976416b7d6394a1301b094f
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com>
Date: Mon Jun 25 12:58:48 2018 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.scaledprice/rev/ec726fb2b439c8a45976416b7d6394a1301b094f [^]

Related to issue 38736: Problem when applying a scaled price discount on the Web
POS in OFFLINE mode

- Backed out changeset: c72b5910588f

---
M web/org.openbravo.retail.discounts.scaledprice/js/scaledpricemodel.js
---
(0105457)
hgbot   
2018-06-26 20:56   
Repository: erp/pmods/org.openbravo.retail.discounts.scaledprice
Changeset: e005c70552cff64066896a5d9f11fc7943b2eea9
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com>
Date: Tue Jun 26 14:40:22 2018 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.scaledprice/rev/e005c70552cff64066896a5d9f11fc7943b2eea9 [^]

Related to issue 38736: Problem when applying a scaled price discount on the Web
POS in OFFLINE mode

- Implemented a CoreAppCacheResourceProvider class to load the OBDSCAL_Scale
model structure inside the application cache

---
A src/org/openbravo/retail/discounts/scaledprice/DiscountsScaledPriceAppCacheProvider.java
---
(0105678)
hgbot   
2018-07-09 15:19   
Repository: tools/automation/pi-mobile
Changeset: 07dd8157c00618010cda3d8276db4c8e920328eb
Author: Alejandro <alekosmp86 <at> gmail.com>
Date: Thu Jul 05 09:07:09 2018 -0400
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/07dd8157c00618010cda3d8276db4c8e920328eb [^]

Related to issue 38736: added automated test

---
M src-test/org/openbravo/test/mobile/core/utils/AllowedErrorsHelper.java
A src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/multidiscounts/I38736_VerifyScalePriceDiscountInOfflineMode.java
---
(0109240)
hgbot   
2019-01-24 17:05   
Repository: tools/automation/pi-mobile
Changeset: 0ced71588d1690c7e13d064fb848dfc8bc1a4230
Author: Alejandro <alekosmp86 <at> gmail.com>
Date: Tue Jan 22 14:43:46 2019 -0500
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/0ced71588d1690c7e13d064fb848dfc8bc1a4230 [^]

Related to issue 38736: test has been refactored due it no longer creates its own
sampledata.

---
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/discounts_scaledprice/I38736_VerifyScalePriceDiscountInOfflineMode.java
---