Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSmajoralways2021-04-29 17:312021-05-13 05:58
ReportervmromanosView Statuspublic 
Assigned Torqueralta 
PrioritynormalResolutionopenFixed in Version
StatusscheduledFix 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

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
TagsNo tags attached.
Attached Filesdiff file icon crossStore_ExternalOrderLoader.diff [^] (1,073 bytes) 2021-04-29 17:31 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

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

Merge Request created: [^]

- 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-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

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker