Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0046429
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSmajoralways2021-04-29 17:312021-06-02 09:24
ReportervmromanosView Statuspublic 
Assigned Torqueralta 
PrioritynormalResolutionfixedFixed in VersionRR21Q3
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0046429: External Order Loader in cross store mode

DescriptionThe external order loader is failing when trying to work in a cross store environment. See this example:

{
  "messageId": "MessageId0144",
  "channel": "External",
  "posTerminal": "Magento",
  "data": [
    {
      "currency": "EUR",
      "payment": 135,
      "step": "create",
      "grossAmount": 135,
      "netAmount": 111.57,
      "documentStatus": "NC",
      "businessPartner": "WVG/C0002",
      "completeTicket": true,
      "organization": "B5DE96143D6642228E3B9DEC69886A47",
      "documentType": "91133D5715FA429C875334DB798D57A1",
      "transactionDocument": "91133D5715FA429C875334DB798D57A1",
      "warehouse" : "0B3E1D8D0FCB44FB81EA1A3FF158B086",
      "lines": [
        {
          "product": "WVG/L0014",
          "qty": 1,
          "grossAmount": 135,
          "netAmount": 111.57,
          "taxAmount": 23.43,
          "taxLines": {
            "Entregas IVA 21%": {
              "rate": 21,
              "netAmount": 111.57,
              "taxAmount": 23.43
            }
          }
        },
      ],
      "taxes": {
        "Entregas IVA 21%": {
          "rate": 21,
          "grossAmount": 135,
          "netAmount": 111.57,
          "taxAmount": 23.43
        }
      }
    }
  ]
}


We have registered a sale in "Magento" posTerminal, and we want to load a ticket in Posets Store with the Posets Store Warehouse, but linked to the Magento posTerminal. This is a common scenario when working with e-commerce and OMS, where the sale happens in an e-commerce solution and the order will be delivered by a different organization within the cross store.

If we try to load this JSON with the External Order Loader, it will fail with the following error:
"Value 0B3E1D8D0FCB44FB81EA1A3FF158B086 does not resolve to an instance of Warehouse"
Note that 0B3E1D8D0FCB44FB81EA1A3FF158B086 is the Posets Warehouse Id.

However, if we try to manually enter the ticket in the ERP it will work fine.


The problem is when the external order loader tries to find the warehouse [ExternalOrderLoader.resolve()]. In that moment it automatically adds a filter by the organization's natural tree to search for the warehouse from the provided ID. This looks OK, but the organization is taken from the posTerminal one (in our case Magento), so it fails because Posets is a Magento's sibling.
Steps To ReproduceTry to load the above JSON using the External Order Loader.
An error "Value 0B3E1D8D0FCB44FB81EA1A3FF158B086 does not resolve to an instance of Warehouse" is returned
Proposed SolutionTwo possible solution I see. Please evaluate them internally and decide the best approach:

1. If an organization is passed as part of the json file, use this organization to filter by its natural tree when resolving a json property.

2. Take the posTerminal organization and search for the related cross store organization. If defined, take it as the one for the filter.

I attached a proposed solution for the second option
TagsDemoImprovementProgram
Attached Filesdiff file icon crossStore_ExternalOrderLoader.diff [^] (1,073 bytes) 2021-04-29 17:31 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0128052)
hgbot (developer)
2021-05-13 05:58

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/412 [^]
(0128688)
hgbot (developer)
2021-05-26 22:02

Merge request closed: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/412 [^]
(0128826)
hgbot (developer)
2021-06-01 00:31

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/442 [^]
(0128863)
hgbot (developer)
2021-06-01 15:13

Merge request closed: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/442 [^]
(0128892)
hgbot (developer)
2021-06-01 22:28

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/449 [^]
(0128921)
hgbot (developer)
2021-06-02 09:24

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: edf313e955b2110314432fc801f25ada77fe4578
Author: Rafael Queralta <rafaelcuba81@gmail.com>
Date: 2021-06-02T07:22:47+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/edf313e955b2110314432fc801f25ada77fe4578 [^]

Fixed BUG-46429: Taking the related cross store organization if defined instead the POS organization and the the new preference is Y too

---
M src-db/database/sourcedata/AD_PREFERENCE.xml
M src-db/database/sourcedata/AD_REF_LIST.xml
M src/org/openbravo/retail/posterminal/ExternalOrderLoader.java
---
(0128922)
hgbot (developer)
2021-06-02 09:24

Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/449 [^]

- Issue History
Date Modified Username Field Change
2021-04-29 17:31 vmromanos New Issue
2021-04-29 17:31 vmromanos Assigned To => Retail
2021-04-29 17:31 vmromanos File Added: crossStore_ExternalOrderLoader.diff
2021-04-29 17:31 vmromanos Triggers an Emergency Pack => No
2021-04-29 17:51 marvintm Resolution time => 1621461600
2021-05-04 07:31 ranjith_qualiantech_com Assigned To Retail => ranjith_qualiantech_com
2021-05-04 07:32 ranjith_qualiantech_com Status new => scheduled
2021-05-10 07:20 ranjith_qualiantech_com Assigned To ranjith_qualiantech_com => Retail
2021-05-10 16:03 rqueralta Assigned To Retail => rqueralta
2021-05-13 05:58 hgbot Note Added: 0128052
2021-05-24 06:42 marvintm Resolution time 1621461600 => 1622066400
2021-05-26 22:02 hgbot Note Added: 0128688
2021-05-27 11:59 xplacesc Tag Attached: DemoImprovementProgram
2021-06-01 00:31 hgbot Note Added: 0128826
2021-06-01 15:13 hgbot Note Added: 0128863
2021-06-01 22:28 hgbot Note Added: 0128892
2021-06-02 09:24 hgbot Resolution open => fixed
2021-06-02 09:24 hgbot Status scheduled => closed
2021-06-02 09:24 hgbot Fixed in Version => RR21Q3
2021-06-02 09:24 hgbot Note Added: 0128921
2021-06-02 09:24 hgbot Note Added: 0128922


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker