Openbravo Issue Tracking System - Retail Modules
View Issue Details
0049628Retail ModulesRetail APIpublic2022-06-22 15:282022-07-26 08:16
azzeddine_meftoh 
ranjith_qualiantech_com 
normalmajoralways
closedfixed 
5
 
RR22Q4 
No
0049628: External Order Loader - impossible to import return line with a negative line gross amount
When importing orders with return line through the external order loader we cannot push a negative value on the line gross amount

(FYI : when doing returns on the pos this field is negative)
post on order with a return line -> absolute value in the DB
The issue can be reproduced using the "Import Order - Return" example from the Openbravo API Postman suite, or using the attached json.
The problem happens because the External Order Loader always sets the lineGrossAmount value with an absolute value[1], forcing all imported lines to be positive.

This seems to be a regression added with the project to support the Cancel Layaway flow from the EOL in 20q4

[1] https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/blob/master/src/org/openbravo/retail/posterminal/ExternalOrderLoader.java#L856 [^]


Attached a patch with a possible solution: keep the absolute value when doing a Cancel via EOL, otherwise use the gross amount (as it was used before 20q4).
FASH
related to defect 0049472 closed rqueralta Error with OrderLoader Web Services 
? 49628.json (919) 2022-06-22 16:08
https://issues.openbravo.com/file_download.php?file_id=17212&type=bug
diff 49628_patch.diff (1,362) 2022-06-22 16:09
https://issues.openbravo.com/file_download.php?file_id=17213&type=bug
Issue History
2022-06-22 15:28azzeddine_meftohNew Issue
2022-06-22 15:28azzeddine_meftohAssigned To => Triage Platform Conn
2022-06-22 15:28azzeddine_meftohTriggers an Emergency Pack => No
2022-06-22 15:58aaroncaleroAssigned ToTriage Platform Conn => Retail
2022-06-22 15:58aaroncaleroSummaryorder loader - impossible to import return line with a negative line gross amount => External Order Loader - impossible to import return line with a negative line gross amount
2022-06-22 15:58aaroncaleroDescription Updatedbug_revision_view_page.php?rev_id=24334#r24334
2022-06-22 16:08aaroncaleroSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=24336#r24336
2022-06-22 16:08aaroncaleroProposed Solution updated
2022-06-22 16:08aaroncaleroFile Added: 49628.json
2022-06-22 16:09aaroncaleroFile Added: 49628_patch.diff
2022-06-22 17:44marvintmRelationship addedrelated to 0049472
2022-06-23 11:51ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2022-06-24 11:23ranjith_qualiantech_comStatusnew => scheduled
2022-07-01 09:03hgbotNote Added: 0138898
2022-07-01 09:55rafarodaTag Attached: FASH
2022-07-25 08:53hgbotResolutionopen => fixed
2022-07-25 08:53hgbotStatusscheduled => closed
2022-07-25 08:53hgbotNote Added: 0139565
2022-07-25 08:53hgbotFixed in Version => RR22Q4
2022-07-25 08:53hgbotNote Added: 0139566
2022-07-26 08:16hgbotNote Added: 0139601

Notes
(0138898)
hgbot   
2022-07-01 09:03   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/839 [^]
(0139565)
hgbot   
2022-07-25 08:53   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/839 [^]
(0139566)
hgbot   
2022-07-25 08:53   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 9bdbd96e64488076a4530c7f593b61e0cd21b0fb
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 25-07-2022 06:53:05
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/9bdbd96e64488076a4530c7f593b61e0cd21b0fb [^]

Fixed ISSUE-49628: LineGrossAmount should be same as GrossAmount in EOL
* in EOL, If order is CANCEL, then lineGrossAmount should be updated as positive

---
M src/org/openbravo/retail/posterminal/ExternalOrderLoader.java
---
(0139601)
hgbot   
2022-07-26 08:16   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 394be9b2bfb3ec4c930cebe9e68c791d1a6cc0af
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 26-07-2022 11:45:13
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/394be9b2bfb3ec4c930cebe9e68c791d1a6cc0af [^]

Related to ISSUE-49628: LineJson orderStep should be updated after product validation in EOL

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