Automate Inter-Company Transactions – Architecture

Hi All,

I have this question quite a lot in Asia, mostly because there you probably have a big company already if you explore the ERP options. Many medium/big companies in Asia have multiple locations, multiple offices, multiple legal entities in multiple countries. This comes to the point where you have to do some inter-company transactions that affects multiple companies.


Inter-Company Transaction

Inter-company accounting is the process of recording financial transactions between different legal entities within the same parent company
You can classify inter-company transactions in 2 types:

  • One transaction that hits multiple companies. For example when you pay rent from one company to multiple others. This transactions can be performed in Acumatica using inter-branch transactions feature.
  • Two or more transactions that offsetting each other in corresponding companies. For example, if you purchase some services between companies you should create corresponding AP Bill for each create AR Invoice. This is more like an Electronic Documents exchange. In Acumatica this operations needs to be done manually.

Here and further I will speak about second type of transactions.a

When do you need an inter-company transactions?

You have to do inter-company transactions between independent tenants. In the current stage Acumatica does not support multiple base currencies in the same Tenant, so if you have a multi-country client than you most probably have to setup it as multiple tenants.
Another scenario is when you want to have profit/expenses or taxes on inter-company transactions. You have to record revenue and taxes on sales/purchases so you’ll need all documents on all parties.
Third scenario is when you need to have some sort of electronic documents exchange (EDI) between companies with independent approvals and processing.

How to deal with inter-company transactions?

You can easily record such transactions manually:

  1. Create Company A and Company B as vendor in each corresponding tenant.
  2. Extend Vendors to Customer with appropriate action on Vendor Maintenance screen.
  3. In Company A: create an AR Invoice with Customer as Company B.
  4. In Company B: create an AP Bill with Vendor as Company A
  5. Release transactions.

This process is quite simple, but manual transactions may lead to some mistakes and typos. This might not be notices until you try to reconcile the balances or eliminate inter-company balances on consolidated report.
Acumatica Consolidation Scenario
To really make this safe we need to automate the process and make sure that corresponding transactions are always automatically created by your ERP system.

Inter-Company Transactions customization Architecture

Here I want to propose a solution on how you can automate inter-company documents creation with Acumatica ERP Platform.
The direction of transactions might be different (AP->AR or AR->AP) but in this case I’ll show how we can create AP Bill automatically for release AR Invoice (AR -> AP).

Step 1 – Customer/Vendors Mapping

First thing we need to do is to map customers to corresponding vendors. For this thing we create a setup screen.
Inter-Company Setup
Please note that we also can setup a URL and Login/password for API user to connect from source to destination company. So in this case you can handle even if companies on different Acumatica servers.
Also note the Branch ID column in the grid – this helps you to have different inter-company rules between different branches. Technically you can setup this integration event between branches within the same tenant. To do this you choose Destination branch with the login credentials and Originating Branch in the mapping itself.

The same way you can map Accounts, Subaccounts, Cost Codes and Projects if your companies stores due to/from balance on different accounts.
Inter-Company Accounts Mapping

Step 2 – Triggering Inter-Company Integration

We should have a triggering point when we should trigger inter-company synchronization. Logically to have it when origination document (in my case it is AP Bill) is released.
We override a release procedure and rise the inter-company flag on the document if there is any vendor associated with Inter-company accordingly on the configurations above.
Acumatica Inter-Company Trigger
We can trigger synchronization immediately and do not rise the flag separately, but this approach helps us to segregate two independent processes: Releasing of the Bill and Generate Corresponding Document.
Also this approach can help with performance a bit as release process does not need to wait for API sync.
And lastly this approach helps us to monitor, fix and retry inter-company errors independently. As AP Bill is created and successfully release you can just retry inter-company sync only.

Step 3 – Processing Inter-Company Integration

The next step after flag is risen is to process inter-company synchronization. To trigger it and actually control the execution and history we need create a processing screen.
On that screen we can review all transactions require processing and process all or selected ones.
Acumatica Inter-Company Process
Please note that you can schedule the processing screen so Acumatica can run this process instead of us.
If to be creative a bit you also can use Business Events feature to trigger an Import scenario, that can finally run a processing. In that scenario you don’t need to schedule processing and it will be executed real time.

During the processing document type should be mapped between AR and AP modules. In our processing we have following rules:

  1. AR Invoice –> AP Invoice
  2. AR Cash Sale –> AP Quick Check
  3. AR Debit Memo –> AP Credit Adjustment
  4. AR Credit Memo –> AP Debit Adjustment

The code responsible for document synchronization should push changes thought Contract Based API. In case your companies are on the same instance you also can use programming API with graphs and events, but I do not recommend it as this way is not flexible and is not protected from field changes.
Please note that Cash Sales and Quick Check documents are managed by other screens, so during API calls we should choose the proper screen based on the document type.

Step 4 – Review Documents Created

As a result of the operation new AP documents should be created and both of the documents should be linked to each other.
Acumatica Inter-Company Link AR
Please note that the “Inter-Company Completed” flag is risen. This means operation has been completed and related document has been created successfully.

Acumatica Inter-Company Link AP
If you invest a bit more time you also can create a LinkCommand or Button associated to the control and than open a related inter-company document in a new tab using PXRedirectRequiredException.

Here you also can note that account mapping has been automatically triggered and you see the changes in Accounts.

That is actually it. We have completed our inter-company automation and now we can use it.
In case required the same integration can be done for reverse flow of the documents (AP -> AR). Also it is not complicated to extend the same approach to other document types, like PO/SO.

Simplifications and Improvements

This solution has couple of simplifications that should improve later:

  • Customers, Vendors, Accounts, Subaccounts, Inventory Items are mapped by name and have to be presented in each tenant. So even if some company does not use certain account it still have to be created for mapping. In the future will be good to get accounts for mapping directly from related company thought API.
  • Solution can’t tell users about failed processes. Would be good to store processing error message somewhere to trigger the business events and inform the IT staff.
  • Would be good to add other document synchronization in the future like PO/SO.

Code Sample

Here you can find a code sample that demonstrates you an inter-comapny sync processing described in this article. This is just a part of code for demonstartion purposes.

Hope it helps and have an easy consolidation.

2 Replies to “Automate Inter-Company Transactions – Architecture”

  1. Hi Sergey,

    Thanks for providing the sample code. This is very very useful for us as we have several customers which are requesting inter company accounting.
    This also shows how powerful Acumatica customization can be as it can also help to deliver features not included in the standard Acumatica or to automate tasks. In fact, we have developed several customizations where we automate processes so that our clients can operate more efficiently and effectively – giving them a competitive advantage.



Leave a Reply

Your email address will not be published. Required fields are marked *