My Products
Help
Florian Haase
PARTNER

Cash transaction Post results in errormessage when posting inventoryNumber instead of accountId

by Florian Haase (Updated ‎30-03-2021 10:47 by Yıldırım VISMA )

Hi,

 

following json failes in the API:

 

{"hold":{"value":false},"tranDate":{"value":"2021-03-17T00:00:00"},"description":{"value":"Overføring fra POS"},"cashAccount":{"value":"1721"},"entryType":{"value":"13"},"cashTransactionDetails":[{"operation":"Insert","inventoryNumber":{"value":"2010402"},"quantity":{"value":4.0},"price":{"value":200.0}},{"operation":"Insert","description":{"value":"Betalingstransaksjon fra POS"},"amount":{"value":-800.0},"offsetAccount":{"value":"1931"}}]}

 

with error:

Result: "{\"message\":\"Error: Inserting 'Cash management transaction' record raised at least one error. Please review the errors.\\r\\nError: 'Cash account' cannot be empty.\\r\\n\"}"

 

no problem to register this in the UI. It seems that the API does not axcept to registrer cashaccount - transaction with Inventory number instead of offsetAccount, but thats no problem in the user-interface. Could you confirm before I start to make a lot of workarounds?

 

Regards,

 

Florian

 

 

6 REPLIES 6
Yıldırım
VISMA

by Yıldırım (Updated ‎07-05-2021 13:32 by Yıldırım VISMA )

Hello, 


We'd like to clarify some operation details of how CashTransaction works in the Financials ERP before drill down into the API operation and the reported issue.

1) Offset Account and Offset Subaccount fields are mandatory in the ERP. So, CT documents can not be registered without assigning any value to those fields.
if_inventory_and_entry_offsets_are_null.png

2) There are two ways of these values would automatically be fetched to the CT document in the Financials ERP. 

A) Through selected  "Entry Type" Defaults
Entry_Type.png

B) Through selected "Inventory:  Default GL Accounts"
- Inventory>salesAccount = CashTransactionLine>offsetAccount
- Inventory>salesSubAccount = CashTransactionLine>offsetSubAccount
Inventory_GL.png

In the UI, those values can not be automatically fetched into the Cash Transaction Line if the aforementioned both module's defaults are missing and, therefore, they should be manually filled.


When it comes to your point,  


@Florian Haase wrote:

no problem to register this in the UI. It seems that the API does not axcept to registrer cashaccount - transaction with Inventory number instead of offsetAccount, but thats no problem in the user-interface. Could you confirm before I start to make a lot of workarounds?


As it mentioned in the operation clarification part above, bypassing Offset & OffsetSubAccount value is not possible in the UI either. In your case most likely, these values have automatically been fetched from the Inventory Card's default as soon as you enter the InventoryID.

Consequently,

after conducting some testing, we're seeing that CashTransaction Endpoint does not automatically inherit the default  Inventory GL : "Sales" & "Sales subAccount" to "Offset" & "OffsetSubAccount" values of the desired inventory to the Cash Transaction Document when only "InventoryNumber" included in the payload. 

So that, it returns  

 

 

 

"message": "Error: Inserting  'Cash management transaction details' record raised at least one error. Please review the errors.\r\nError: 'Offset account' cannot be empty."

 

 

 


This case has been escalated to the development team.  Relevant status updates will be shared under this thread. We appreciate your reporting this issue to us.

 

Workaround:  
OffsetAccount & OffsetSubAccount can be specified in the POST operation

    "offsetAccount": {
        "value": "string"
      },
      "offsetSubaccount": [
        {
          "segmentId": 0,
          "segmentValue": "string"
        }

 

Yıldırım
VISMA

by Yıldırım

Hello Florian, 

we'll look into it and get back to you.

Florian Haase
PARTNER

by Florian Haase

Just got again over this problem where our customer pinpoints that the subaccount has not been set from the inventories when importing by API. This works in the UI

Yıldırım
VISMA

by Yıldırım (Updated ‎23-06-2021 12:35 by Yıldırım VISMA )

We're still waiting for the fix, therefore, please follow the workaround that has been provided earlier. We'll check the status of the case and inform the team that this is important.

Florian Haase
PARTNER

by Florian Haase

Don't need it today 🙂 The workaround works for us but causes a bit traffic on the API because we have to read the inventory and afterwards we have to read the subaccount for each line (not implemented yet)

Florian Haase
PARTNER

by Florian Haase

Sorry, the json and the errormessage was wrong - a bit kaos here with testing different scenarios.

Right json:

{"hold":{"value":false},"tranDate":{"value":"2021-03-17T00:00:00"},"description":{"value":"Overføring fra POS"},"cashAccount":{"value":"1931"},"entryType":{"value":"13"},"cashTransactionDetails":[{"operation":"Insert","inventoryNumber":{"value":"2010402"},"quantity":{"value":4.0},"price":{"value":200.0}},{"operation":"Insert","description":{"value":"Betalingstransaksjon fra POS"},"amount":{"value":-800.0},"offsetAccount":{"value":"1721"}}]}

 

results in:

Error: Inserting 'Cash management transaction details' record raised at least one error. Please review the errors.\r\nError: 'Offset account' cannot be empty.

 

Setting standard account on entryType fixes the error-message but we have different accounts on different inventoryIds

 

Florian