Openbravo Issue Tracking System - Retail Modules
View Issue Details
0052224Retail ModulesGift cards and gift voucherspublic2023-04-25 12:002023-04-26 06:46
guilleaer 
hcurbelo 
normalcriticalhave not tried
closedfixed 
5
 
RR23Q3 
marvintm
No
Production - QA Approved
2023-01-27
https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/commit/f7860454aa84bf073f34ebd22e5b8d151b732e95 [^]
No
0052224: Issue prepaid order from POS2 generates and EWI if gift card module is installed
Issue prepaid order from POS2 generates and EWI if gift card module is installed
Configure POS2 to use prepayments
Create an order to pickup in store
Select a customer
complete the order with a prepayment
Open the order and pay it completely
Open de order and issue the order

org.codehaus.jettison.json.JSONException: JSONObject["created"] is not a number.
    at org.codehaus.jettison.json.JSONObject.getDouble(JSONObject.java:405)
    at org.codehaus.jettison.json.JSONObject.getLong(JSONObject.java:475)
    at org.openbravo.retail.giftcards.hooks.OrderLoaderHookGiftCard.exec(OrderLoaderHookGiftCard.java:45)
    at org.openbravo.retail.giftcards.hooks.OrderLoaderHookGiftCard$Proxy$_$$_WeldClientProxy.exec(Unknown Source)
    at org.openbravo.retail.posterminal.OrderLoader.executeHooks(OrderLoader.java:834)
    at org.openbravo.retail.posterminal.OrderLoader.saveRecord(OrderLoader.java:624)

diff --git a/src/org/openbravo/retail/giftcards/hooks/OrderLoaderHookGiftCard.java b/src/org/openbravo/retail/giftcards/hooks/OrderLoaderHookGiftCard.java
index 018021e..1edc565 100644
--- a/src/org/openbravo/retail/giftcards/hooks/OrderLoaderHookGiftCard.java
+++ b/src/org/openbravo/retail/giftcards/hooks/OrderLoaderHookGiftCard.java
@@ -42,7 +42,7 @@ public class OrderLoaderHookGiftCard extends OrderLoaderPaymentHook {
   public void exec(JSONObject jsonorder, Order order, ShipmentInOut shipment, Invoice invoice)
       throws Exception {
     // Date Time Long Value from Order Creation
- Long localCreationDate = jsonorder.getLong("created");
+ Long localCreationDate = jsonorder.optLong("created", new Date().getTime());
No tags attached.
depends on backport 0052225RR23Q2 closed hcurbelo Issue prepaid order from POS2 generates and EWI if gift card module is installed 
Issue History
2023-04-25 12:00guilleaerNew Issue
2023-04-25 12:00guilleaerAssigned To => Retail
2023-04-25 12:00guilleaerOBNetwork customer => No
2023-04-25 12:00guilleaerRegression level => Production - QA Approved
2023-04-25 12:00guilleaerRegression date => 2023-01-27
2023-04-25 12:00guilleaerRegression introduced by commit => https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/commit/f7860454aa84bf073f34ebd22e5b8d151b732e95 [^]
2023-04-25 12:00guilleaerTriggers an Emergency Pack => No
2023-04-25 12:00guilleaerAssigned ToRetail => hcurbelo
2023-04-25 12:13guilleaerStatusnew => scheduled
2023-04-25 12:33guilleaerSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=25937#r25937
2023-04-26 06:46hgbotResolutionopen => fixed
2023-04-26 06:46hgbotStatusscheduled => resolved
2023-04-26 06:46hgbotNote Added: 0148877
2023-04-26 06:46marvintmReview Assigned To => marvintm
2023-04-26 06:46marvintmStatusresolved => closed
2023-04-26 06:46marvintmFixed in Version => RR23Q3

Notes
(0148877)
hgbot   
2023-04-26 06:46   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards [^]
Changeset: 5517639c27f982bde72120a99f43e8ed55bd49d5
Author: HECTOR CURBELO BARRIOS <HECTOR.CURBELO@SMFCONSULTING.ES>
Date: 26-04-2023 04:46:16
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/commit/5517639c27f982bde72120a99f43e8ed55bd49d5 [^]

Fixed ISSUE-52224: Open order and issue the order when order is to pickup in store

---
M src/org/openbravo/retail/giftcards/hooks/OrderLoaderHookGiftCard.java
---