Openbravo Issue Tracking System - Retail Modules
View Issue Details
0052925Retail ModulesRetail APIpublic2023-07-05 12:172023-07-12 09:22
kchoperena 
ranjith_qualiantech_com 
highmajoralways
closedfixed 
5
 
 
approved
Gold
No
0052925: Ship step of ExternalOrderLoader fails when there is a deleted line before an ordered line in the receipt
If there is an order with the same status as the attached screenshot, the ExternalOrderLoader's ship step is failing because the filterNoDeletedLines function of ExternalOrderLoaderTransformationJsonHook class is not correctly building the noDeletedLines array
Create an order using WebPOS that is persisted in the database with a deleted line before an ordered line according to the lineNo order (see screenshot)

Call to the ExternalOrderLoader with the step "SHIP" to deliver only one line. Example:
{
  "messageId": "messageId",
  "posTerminal": "214101",
  "channel": "External",
  "data": [
    {
      "id": "orderId",
      "step": "ship",
      "lines": [
        {
          "id": "line1",
          "qty": 1
        }
      ]
    }
  ]
}

RESULT:
The filterNoDeletedLines will create an array with a null value and later the ExternalOrderLoader will fail processing it
When building noDeletedLines avoid the index parameter putting elements in the JSONArray

Attached a patch
No tags attached.
related to defect 0053444 closed ranjith_qualiantech_com External Order Loader (Ship Step) finish with error 
png Screenshot from 2023-07-05 12-05-17.png (159,398) 2023-07-05 12:17
https://issues.openbravo.com/file_download.php?file_id=18727&type=bug
png

diff issue5295.diff (763) 2023-07-05 12:21
https://issues.openbravo.com/file_download.php?file_id=18728&type=bug
Issue History
2023-07-05 12:17kchoperenaNew Issue
2023-07-05 12:17kchoperenaAssigned To => Triage Platform Conn
2023-07-05 12:17kchoperenaFile Added: Screenshot from 2023-07-05 12-05-17.png
2023-07-05 12:17kchoperenaOBNetwork customer => Gold
2023-07-05 12:17kchoperenaTriggers an Emergency Pack => No
2023-07-05 12:20kchoperenaProposed Solution updated
2023-07-05 12:21kchoperenaFile Added: issue5295.diff
2023-07-05 12:44adrianromeroAssigned ToTriage Platform Conn => Retail
2023-07-07 09:27ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2023-07-07 09:27ranjith_qualiantech_comStatusnew => scheduled
2023-07-10 09:38hgbotMerge Request Status => open
2023-07-10 09:38hgbotNote Added: 0152229
2023-07-12 09:22hgbotMerge Request Statusopen => approved
2023-07-12 09:22hgbotNote Added: 0152373
2023-07-12 09:22hgbotResolutionopen => fixed
2023-07-12 09:22hgbotStatusscheduled => closed
2023-07-12 09:22hgbotNote Added: 0152374
2023-09-13 11:12ranjith_qualiantech_comRelationship addedrelated to 0053444

Notes
(0152229)
hgbot   
2023-07-10 09:38   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.api/-/merge_requests/73 [^]
(0152373)
hgbot   
2023-07-12 09:22   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.api/-/merge_requests/73 [^]
(0152374)
hgbot   
2023-07-12 09:22   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.api [^]
Changeset: b73f6f0a2d6e512f7e18fa7bf5706aae3fcf1a22
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 07-07-2023 18:23:27
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.api/-/commit/b73f6f0a2d6e512f7e18fa7bf5706aae3fcf1a22 [^]

Fixed ISSUE-52925: Lines added to JSONArray without index

---
M src/org/openbravo/retail/api/events/order/ExternalOrderLoaderTransformationJsonHook.java
---