Openbravo Issue Tracking System - Retail Modules
View Issue Details
0052466Retail ModulesRetail APIpublic2023-05-16 18:422023-06-20 09:19
kchoperena 
sreehari 
highmajoralways
closedfixed 
5
 
RR23Q3 
approved
Gold
No
0052466: ExternalOrderLoader fails updating or shipping if the BP has 2 shipping address with the same name and only one for invoicing
The ExternalOrderLoader has some checks regarding the business partner address information. There is a logic that throws an error when a customer has a shipping address and not an invoicing address

The error happens before this check. We are trying to obtain wrongly the addresses

Situation
The customer has:
   - 1 invoicing address
   - 2 shipping address with the same business partner location name

As the getAddressIdFromAddressName is wrongly checking the size of location list to return the first one, the ExternalOrderLoader is throwing an exception:

throw new OBException("Invoice location is missing for bp " + bpId + " for order json " + orderJson + " while shipping location is defined");
1.- In Web POS, create a new customer with different invoices for shipping and invoicing
2.- Create exactly the same address for shipping an assign it to the ticket
3.- Complete the ticket
4.- Using any REST tool, update the created order using the ExternalOrderLoader. You can also create it or whatever. The key is to use the same customer

RESULT:
The next error message will be received in the response ->

Invoice location is missing for bp 04326D2A5A03701125298C8796043335 for order json
Check in ExternalOrderLoader/getAddressIdFromAddressName method, that the size of result list is bigger than 0 instead of 1
No tags attached.
diff patch52466.diff (606) 2023-05-16 18:43
https://issues.openbravo.com/file_download.php?file_id=18538&type=bug
Issue History
2023-05-16 18:42kchoperenaNew Issue
2023-05-16 18:42kchoperenaAssigned To => Triage Platform Conn
2023-05-16 18:42kchoperenaOBNetwork customer => Gold
2023-05-16 18:42kchoperenaTriggers an Emergency Pack => No
2023-05-16 18:43kchoperenaFile Added: patch52466.diff
2023-05-18 17:13adrianromeroAssigned ToTriage Platform Conn => Retail
2023-05-19 08:57sreehariAssigned ToRetail => sreehari
2023-05-19 08:58sreehariStatusnew => scheduled
2023-06-09 07:16hgbotMerge Request Status => open
2023-06-09 07:16hgbotNote Added: 0150969
2023-06-20 09:10hgbotMerge Request Statusopen => approved
2023-06-20 09:19hgbotResolutionopen => fixed
2023-06-20 09:19hgbotStatusscheduled => closed
2023-06-20 09:19hgbotNote Added: 0151349
2023-06-20 09:19hgbotFixed in Version => RR23Q3
2023-06-20 09:19hgbotNote Added: 0151350

Notes
(0150969)
hgbot   
2023-06-09 07:16   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1237 [^]
(0151349)
hgbot   
2023-06-20 09:19   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1237 [^]
(0151350)
hgbot   
2023-06-20 09:19   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 40a730eb6974eda9c438a5605167059627383d9d
Author: Sreehari Venkataraman <sreehari@qualiantech.com>
Date: 20-06-2023 06:19:01
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/40a730eb6974eda9c438a5605167059627383d9d [^]

Fixes ISSUE-52466: Added address validation in ExternalOrderLoader
*added isActive checks in query
*added method overloading for getAddressIdFromAddressName
*Handled null Boolean exception using BooleanUtils

---
M src/org/openbravo/retail/posterminal/ExternalOrderLoader.java
---