Automate intercompany cost recharges with configurable allocation keys (headcount, %, revenue, sqm).

  • Current version: v0.1.1.1
  • AL prefix: MULTI
  • Object range: 80700-80799
  • Business Central: 26.0.0.0
  • Publisher: Amplio Solutions

Multi-Entity Allocation & Recharge Journal Tool

Business Central AL extension that automates intercompany cost recharges using configurable allocation keys (headcount, percentage, revenue, sqm). Source GL balances are summed for a chosen period and dimension filter, split by an allocation key, and posted into the standard ICP General Journal in each target company.

Publisher Amplio Solutions
Version 0.1.1.0
Target BC application 26.0.0.0 / platform 26.0.0.0
Country GB
Object range 80700..80799
Prefix AMP

What's complete in this MVP (v0.1.0.0)

Data model

  • AMP Allocation Setup (80700) — singleton: ICP journal template/batch, source clearing account, run-no. series.
  • AMP Allocation Key Header (80701) — keys with effective-from/to, key type, source company + source GL account.
  • AMP Allocation Key Line (80702) — target company, IC partner, target GL account, target dim 1/2, weight.
  • AMP Allocation Source Filter (80703) — extra GL account / dim 1 / dim 2 filters per key. Multiple filters on a key are OR'd together.
  • AMP Allocation Run History (80704) — one row per run, with status, totals, audit fields, error.
  • AMP Allocation Run Buffer (80705) — preview lines (target company, share %, allocated amount, posted flag).

Enums

  • AMP Allocation Key Type (80700) — Percentage, Headcount, Revenue, Floor Area (sqm).
  • AMP Allocation Run Status (80701) — Draft, Previewed, Posted, Cancelled, Error.

Codeunits

  • AMP Allocation Engine (80700) — CreateRun, CalculatePreview, PostRun, CancelRun. Source amount uses ChangeCompany against G/L Entry so the source company can differ from the company you run the engine in. Final preview line absorbs the rounding remainder so allocated total equals source total exactly.
  • AMP Allocation ICP Posting (80701) — PostBuffer. For each preview line, opens the target company via ChangeCompany on Gen. Journal Line, inserts an inbound recharge line on the configured ICP template/batch, and routes it through the standard 2023 wave 2 cross-environment ICP plumbing (IC Partner Code, IC Account Type, IC Account No., IC Direction = Outgoing). When Auto-Reverse on Recharge is on, posts a single offsetting credit-memo line in the source company against the configured clearing account.
  • AMP Allocation Install (80702) — initialises the setup singleton on install.

Pages

  • AMP Allocation Setup (80700) — admin card.
  • AMP Allocation Key List (80701) / Card (80702) / Lines part (80703) / Source Filters part (80704).
  • AMP Allocation Run (80705) — the working surface: select key + period, Create & Preview action, Post action, Cancel Run action, with the preview part bound below.
  • AMP Allocation Run Preview (80706) — preview/posted lines.
  • AMP Allocation Run History (80707) / Card (80708) — one row per run.

Page extensions

  • AMP G/L Account Card Ext (80700) — adds an "Allocation Keys" navigation action onto the G/L Account Card filtered by the source account.

Permission sets

  • ASMEAAll (80700, Caption Amplio MEA All Permissions) — full RIMD over the extension's tables and execute on every object.
  • ASMEARead (80701, Caption Amplio MEA Read Only) — read-only over the same surface for finance users who only need history visibility.

Configuration

  • app.json — publisher, version, idRanges, deps on Base Application + System Application + Intercompany at 26.0.0.0; runtime 13.0; cloud target.
  • .vscode/launch.json — local Docker sandbox + cloud sandbox.
  • .gitignore, .editorconfig — standard AL housekeeping.

How a recharge run flows

  1. Open Multi-Entity Allocation Setup and pin: ICP journal template + batch, source clearing G/L account, run-no. series.
  2. Open Allocation Keys, create a key (e.g. RENT-HC headcount split). Add target lines: each line names a target company, IC partner, target GL account, optional dimensions, and a weight (e.g. headcount in that company).
  3. From the key, click New Allocation Run → fill period start/end + posting date → Create & Preview. The engine sums G/L entries in the source company for the source account and dimension filters across the period, then walks the key lines applying weight ÷ total-weight × source amount.
  4. Review the preview part. Click Post to write inbound lines into each target company's ICP general journal via ChangeCompany and the cross-environment ICP plumbing. The source-side offset (if enabled) goes to the clearing account in one credit-memo line.
  5. The run record moves to Posted and is visible in Allocation Run History, with the document no. (ALLOC-<run no.>) preserved for traceability.

What Lee needs to ship this to production

These are deliberately left to the implementer because they depend on the customer's chart of accounts, ICP topology and tenant security model.

  1. ICP partner setup
    • Each target company in the recharge fan-out must exist as an IC Partner in the source company, and the IC partner's Inbox Type/Inbox Details must be configured for the cross-environment plumbing (BC 2023 wave 2). Confirm IC Setup lists every partner and that the inbound batch on the partner side accepts the document type written by AMP Allocation ICP Posting (Invoice for inbound, Credit Memo for source offset).
    • The ICP G/L account in each target company should mirror the Source Clearing Account No. in the source company (or whatever convention you adopt) so the reciprocating IC entry flows back cleanly.
  2. G/L + dimension filter conventions
    • Decide whether allocation keys reference a single source GL account (e.g. 6800 IT Services) or a range/filter via Source Filters (e.g. 6100..6199 for facilities). The MVP supports both, but the convention should be pinned in your account-setup playbook so a new finance starter doesn't accidentally double-count.
    • Confirm the global dimensions (Global Dimension 1 Code, Global Dimension 2 Code) used on source filters match how cost is captured in the source GL — usually DEPARTMENT and PROJECT/COSTCENTRE. Lines in the key carry only Target Dimension 1/2 Code because the recharge is by definition coming from the recharging company; if you want to preserve a source dimension across companies, add a column to AMP Allocation Key Line in v0.2.
  3. Target-company access permissions
    • The user account that runs an allocation needs Indirect permission on Gen. Journal Line and the ICP tables in every target company in addition to the source company. Without this, ChangeCompany succeeds but the Insert on the target's Gen. Journal Line will fail.
    • Assign the supplied ASMEAAll permission set (Caption Amplio MEA All Permissions) to the finance recharge role in the source company; assign ASMEARead (Caption Amplio MEA Read Only, or your standard read-only finance set) in target companies if you want target users to be able to see the history.
    • On cloud sandbox / production, also grant the relevant Microsoft entitlements (D365 INTERCOMPANY POSTING, D365 BUS PREMIUM etc.) to the running user.
  4. No-series, journal templates, clearing account
    • Create a no. series for Allocation Run Nos. (suggested: AMPALLOC, AMPALLOC0001+1).
    • Pre-create a dedicated ICP journal template + batch (suggested: ICPRECH / DEFAULT) and pin them on the setup card.
    • Pick (or create) the source-side clearing G/L account. It should be a posting account, unblocked, and dimensioned consistently with how you'll reconcile the recharge each period-end.
  5. Validation that's deliberately out of scope for v0.1
    • Driver-data import (e.g. headcount feed from Dataverse / payroll) — for now, weights are entered by hand on AMP Allocation Key Lines.
    • Recursive allocations (one allocation feeding another) — single-source single-target-set only.
    • Reversal of a posted run — currently you reverse via the standard journal; an AMP Reverse Run action is on the v0.2 list.
    • FX. Source amount and target lines are posted in the source company's LCY; multi-currency recharges should be modelled with the standard ICP currency setup but have not been end-to-end tested.

v0.2 backlog (deferred)

  • Driver-data import (CSV / API for headcount, sqm, revenue).
  • Recursive allocation chains (output of one key as input of another).
  • Reverse-posted-run action.
  • Revenue and Floor Area key types end-to-end (data model is ready; engine treats them identically to Percentage for now).
  • Per-company FX revaluation on the source-side offset.

Folder layout

13-Multi-Entity-Allocation/
├── app.json
├── .vscode/launch.json
├── .gitignore
├── .editorconfig
├── README.md
└── src/
    ├── Tables/
    │   ├── AMPAllocationSetup.Table.al
    │   ├── AMPAllocationKeyHeader.Table.al
    │   ├── AMPAllocationKeyLine.Table.al
    │   ├── AMPAllocationSourceFilter.Table.al
    │   ├── AMPAllocationRunHistory.Table.al
    │   └── AMPAllocationRunBuffer.Table.al
    ├── Pages/
    │   ├── AMPAllocationSetup.Page.al
    │   ├── AMPAllocationKeyList.Page.al
    │   ├── AMPAllocationKeyCard.Page.al
    │   ├── AMPAllocationKeyLines.Page.al
    │   ├── AMPAllocationSourceFilters.Page.al
    │   ├── AMPAllocationRun.Page.al
    │   ├── AMPAllocationRunPreview.Page.al
    │   ├── AMPAllocationRunHistory.Page.al
    │   └── AMPAllocationRunHistoryCard.Page.al
    ├── PageExtensions/
    │   └── AMPGLAccountCardExt.PageExt.al
    ├── Codeunits/
    │   ├── AMPAllocationEngine.Codeunit.al
    │   ├── AMPAllocationICPPosting.Codeunit.al
    │   └── AMPAllocationInstall.Codeunit.al
    ├── Enums/
    │   ├── AMPAllocationKeyType.Enum.al
    │   └── AMPAllocationRunStatus.Enum.al
    └── permissionset/
        ├── 80700_ASMEAAll_permissionset.al
        └── 80701_ASMEARead_permissionset.al

Object ID map

Range Object ID
Tables AMP Allocation Setup 80700
AMP Allocation Key Header 80701
AMP Allocation Key Line 80702
AMP Allocation Source Filter 80703
AMP Allocation Run History 80704
AMP Allocation Run Buffer 80705
Pages AMP Allocation Setup 80700
AMP Allocation Key List 80701
AMP Allocation Key Card 80702
AMP Allocation Key Lines 80703
AMP Allocation Source Filters 80704
AMP Allocation Run 80705
AMP Allocation Run Preview 80706
AMP Allocation Run History 80707
AMP Allocation Run History Card 80708
Page Ext AMP G/L Account Card Ext 80700
Codeunits AMP Allocation Engine 80700
AMP Allocation ICP Posting 80701
AMP Allocation Install 80702
Enums AMP Allocation Key Type 80700
AMP Allocation Run Status 80701
Permission sets ASMEAAll 80700
ASMEARead 80701

Range used: 21 / 100 objects.