Openbravo Issue Tracking System - Retail Modules
View Issue Details
0051290Retail ModulesCoupons OTFpublic2023-01-05 12:102023-01-27 08:11
kchoperena 
ranjith_qualiantech_com 
highmajoralways
closedfixed 
5
pi 
 
No
0051290: JSONObject["mOfferId"] not found error, when doing a Cancel this order of a Layaway with OTF Coupons Generation Rules configured
Having configured "OTF Coupons Generation Rules" configured in back-end, an "Errors While Importing POS Data" happens when doing a Cancel this Order of a paid Layaway
1.- In the back-end, create the configuration of a discount (see attached screenshot)
2.- In the back-end, create the configuration of an "OTF Coupons Generation Rules" (see attached screenshot)
3.- Login into the webpos and create a Layaway and pay it completely
4.- Reopen the Layaway using the "Open receipt" functionality and cancel it using "Cancel this Order"

Steps to reproduce in livebuilds
Backoffice
1) Enable discount "OTF Coupons - Coupon 5 EUR in "Backpacks & Travel"
POS
1) Add product "Bivy bag gore-tex" and complete the ticket T1
2) Make sure, Coupon is generated for the discount "OTF Coupons - Coupon 5 EUR in "Backpacks & Travel" (In Coupon tab)
3) Reopen last completed ticket T1
4) Click "Done" on ticket T1 without any changed
5) EWI occurs like below


RESULT:
An Errors While Importing POS Data happens when synchronizing the cancelation

org.codehaus.jettison.json.JSONException: JSONObject["mOfferId"] not found.
    at org.codehaus.jettison.json.JSONObject.get(JSONObject.java:360)
    at org.codehaus.jettison.json.JSONObject.getString(JSONObject.java:487)
    at org.openbravo.retail.discounts.coupons.otf.OrderLoaderHookOTFCoupons.exec(OrderLoaderHookOTFCoupons.java:42)
    at org.openbravo.retail.discounts.coupons.otf.OrderLoaderHookOTFCoupons$Proxy$_$$_WeldClientProxy.exec(Unknown Source)
    at org.openbravo.retail.posterminal.OrderLoader.executeHooks(OrderLoader.java:830)
    at org.openbravo.retail.posterminal.OrderLoader.saveRecord(OrderLoader.java:620)
    at org.openbravo.retail.posterminal.CancelLayawayLoader.saveRecord(CancelLayawayLoader.java:19)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.saveRecord(DataSynchronizationProcess.java:214)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.exec(DataSynchronizationProcess.java:165)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.exec(DataSynchronizationProcess.java:97)
    at org.openbravo.mobile.core.process.MobileImportEntryProcessorRunnable.processEntry(MobileImportEntryProcessorRunnable.java:57)
    at org.openbravo.retail.posterminal.importprocess.CancelLayawayImportEntryProcessor$CancelLayawayRunnable.processEntry(CancelLayawayImportEntryProcessor.java:62)
    at org.openbravo.service.importprocess.ImportEntryProcessor$ImportEntryProcessRunnable.doRunCycle(ImportEntryProcessor.java:430)
    at org.openbravo.service.importprocess.ImportEntryProcessor$ImportEntryProcessRunnable.run(ImportEntryProcessor.java:347)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
No tags attached.
png Screenshot from 2023-01-05 12-08-05.png (100,980) 2023-01-05 12:10
https://issues.openbravo.com/file_download.php?file_id=17992&type=bug
png

png Screenshot from 2023-01-05 12-08-31.png (98,452) 2023-01-05 12:11
https://issues.openbravo.com/file_download.php?file_id=17993&type=bug
png

png Screenshot from 2023-01-05 12-11-41.png (113,230) 2023-01-05 12:11
https://issues.openbravo.com/file_download.php?file_id=17994&type=bug
png

png Screenshot from 2023-01-05 12-12-02.png (335,069) 2023-01-05 12:12
https://issues.openbravo.com/file_download.php?file_id=17995&type=bug
Issue History
2023-01-05 12:10kchoperenaNew Issue
2023-01-05 12:10kchoperenaAssigned To => Retail
2023-01-05 12:10kchoperenaTriggers an Emergency Pack => No
2023-01-05 12:10kchoperenaFile Added: Screenshot from 2023-01-05 12-08-05.png
2023-01-05 12:11kchoperenaFile Added: Screenshot from 2023-01-05 12-08-31.png
2023-01-05 12:11kchoperenaFile Added: Screenshot from 2023-01-05 12-11-41.png
2023-01-05 12:12kchoperenaFile Added: Screenshot from 2023-01-05 12-12-02.png
2023-01-05 12:13kchoperenaversion => pi
2023-01-20 08:00marvintmSeveritycritical => major
2023-01-23 13:59ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2023-01-23 13:59ranjith_qualiantech_comStatusnew => scheduled
2023-01-24 08:10ranjith_qualiantech_comSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=25442#r25442
2023-01-25 06:04hgbotNote Added: 0145811
2023-01-27 08:11hgbotResolutionopen => fixed
2023-01-27 08:11hgbotStatusscheduled => closed
2023-01-27 08:11hgbotNote Added: 0145899
2023-01-27 08:11hgbotNote Added: 0145900

Notes
(0145811)
hgbot   
2023-01-25 06:04   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf/-/merge_requests/20 [^]
(0145899)
hgbot   
2023-01-27 08:11   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf [^]
Changeset: f2e9e9dec3ab44b30affaa5f9ef63cafd40b5845
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 24-01-2023 12:43:32
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf/-/commit/f2e9e9dec3ab44b30affaa5f9ef63cafd40b5845 [^]

Fixed ISSUE-51290: Coupon should not be created when completing the paid ticket

---
M src/org/openbravo/retail/discounts/coupons/otf/OrderLoaderHookOTFCoupons.java
M src/org/openbravo/retail/discounts/coupons/otf/hook/LoadCoupons.java
---
(0145900)
hgbot   
2023-01-27 08:11   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.otf/-/merge_requests/20 [^]