teamtinvio/jaz-ai / .agents/skills/transaction-recipes
jaz-recipes
VerifiedUse this skill when modeling complex multi-step accounting transactions: anything that spans multiple periods, involves changing amounts, or requires linked entries. Covers 16 IFRS-compliant recipes (prepaid amortization, deferred revenue, loans, IFRS 16 leases, hire purchase, fixed deposits, asset disposal, FX revaluation, ECL, IAS 37 provisions, dividends, intercompany, capital WIP) and 13 financial calculators that return the schedule and the journal lines to post. Also use when the user mentions depreciation, amortization, lease accounting, loan schedules, or any IFRS calculation.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 25.7 KB |
| references/accrued-expenses.md | markdown | 10.2 KB |
| references/asset-disposal.md | markdown | 16.2 KB |
| references/bad-debt-provision.md | markdown | 12.1 KB |
| references/bank-loan.md | markdown | 12.9 KB |
| references/building-blocks.md | markdown | 25.4 KB |
| references/capital-wip.md | markdown | 15.1 KB |
| references/declining-balance.md | markdown | 12.0 KB |
| references/deferred-revenue.md | markdown | 11.7 KB |
| references/dividend.md | markdown | 12.3 KB |
| references/employee-accruals.md | markdown | 11.4 KB |
| references/fixed-deposit.md | markdown | 12.1 KB |
| references/fx-revaluation.md | markdown | 10.1 KB |
| references/hire-purchase.md | markdown | 8.1 KB |
| references/ifrs16-lease.md | markdown | 14.1 KB |
| references/intercompany.md | markdown | 11.3 KB |
| references/prepaid-amortization.md | markdown | 10.5 KB |
| references/provisions.md | markdown | 12.7 KB |
references/intercompany.md
View on GitHub# Recipe: Intercompany Transactions (manual, no calculator)
> Cross-org charge + settlement pattern between two related entities (parent ↔ subsidiary, sister entities). No calculator: built from `create_invoice` + `create_bill` + a capsule per entity. Each leg posts in its own org via separate Jaz API key.
## Why no calculator
Intercompany requires posting MIRRORED entries in TWO different Jaz orgs (Entity A invoices Entity B; Entity B records Entity A's invoice as a bill). There is nothing to compute, and every tool call posts into exactly one org. Multi-org coordination is the caller's responsibility; each entity has its own Jaz org and API key, and the agent must switch the active credentials between legs (see Multi-org auth below).
## Tools this recipe uses
### Posting tools
- **`create_invoice(...)`** (Entity A side): post the management-fee invoice to Entity B (the customer in Entity A's org).
- **`create_bill(...)`** (Entity B side): post the same management-fee as a bill from Entity A (the supplier in Entity B's org).
- **`create_capsule(capsuleTypeResourceId: <id of 'Intercompany' from list_capsule_types>, ...)`**: one capsule per entity, both with matching reference (e.g., `IC-MGMT-2025-Q1`).
- **`pay_invoice(...)` / `pay_bill(...)`**: settlement legs in each entity's org.
- **`apply_credits_to_invoice(...)` / `apply_credits_to_bill(...)`**: netting if both entities owe each other (one entity's invoice clears against the other's bill via credit note).
### Search tools for reconciliation
- **`search_invoices(contactId: <Entity B in A's org>, startDate, endDate)`**: pull all Entity A intercompany invoices (invoices cannot be filtered by capsule).
- **`search_bills(contactId: <Entity A in B's org>, startDate, endDate)`**: pull all Entity B intercompany bills.
- **`generate_general_ledger(accountResourceIds: [<Intercompany Receivable>], startDate: <period-start>, endDate: <date>)` / same for Intercompany Payable**: eliminate at consolidation.
### Multi-org targeting (CRITICAL)
Each entity is a separate Jaz org. Pin the org **explicitly per call** with `org_id` (from `list_organizations`). NEVER rely on ambient session, `--org` alias, or `JAZ_API_KEY` env state; a wrong "active" org silently posts to the wrong tenant and corrupts both entities' books.
1. Verify, then post Entity A: confirm `get_organization(org_id: <Entity A org>)` returns Entity A's legal entity, then create the Entity A invoice with `org_id: <Entity A org>`.
2. Verify, then post Entity B: confirm `get_organization(org_id: <Entity B org>)` returns Entity B's legal entity, then create the Entity B bill with `org_id: <Entity B org>`.
3. Every leg carries its own explicit `org_id`; never depend on which org was targeted last.
### Cross-references
- Operational context: invoked during month-end close (intercompany leg of the close, only for entities with active intercompany arrangements).
- Sibling: `dividend.md` (cross-entity equity distribution; also requires multi-org coordination).
- IFRS / accounting context: IAS 24 (related-party disclosure); intercompany balances ELIMINATE at consolidation per IFRS 10.B86 (consolidation procedures).
---
## Step-by-step (per intercompany transaction)
### Step 0: Identify the arrangement
Confirm the intercompany arrangement from BOTH entities' records (cross-validation: Entity A's outbound charges should match Entity B's inbound charges). Each arrangement has: `name`, `from_entity`, `to_entity`, `amount`, `frequency`, `gl_revenue` (Entity A side), `gl_expense` (Entity B side), `transfer_pricing_basis`.
If the two entities' arrangements don't match: halt and surface it (likely a setup gap or one side wasn't updated when terms changed).
### Step 1: Capsules (one per entity)
In Entity A's org:
```
create_capsule(
capsuleTypeResourceId: <Intercompany capsule type id>,
title: 'IC Mgmt Fee to Entity B, Q1 2025',
description: 'Monthly management services Jan-Mar 2025 per IC arrangement IC-MGMT-2025'
)
```
In Entity B's org (separately, using Entity B's API key):
```
create_capsule(
capsuleTypeResourceId: <Intercompany capsule type id>,
title: 'IC Mgmt Fee from Entity A, Q1 2025',
description: 'Monthly management services Jan-Mar 2025 per IC arrangement IC-MGMT-2025'
)
```
Both capsules carry the same logical reference (IC-MGMT-2025-Q1) so the practitioner can reconcile across the two orgs.
### Step 2 (Entity A): post the invoice
In Entity A's org (Entity A API key resolved):
```
create_invoice(
contactResourceId: <Entity B as a customer in Entity A's contacts>,
reference: 'IC-MGMT-2025-Q1-JAN',
valueDate: '2025-01-31',
dueDate: '2025-02-28',
lineItems: [{
name: 'Management services, January 2025',
accountResourceId: <Entity A's 'Intercompany Revenue' GL>,
quantity: 1,
unitPrice: 15000
}],
capsuleResourceId: <Entity A IC capsule>,
saveAsDraft: false
)
```
Per `jaz-api/SKILL.md` rule 9: `name` (not `description`) for line items. Per rule 7: invoice creates AR + Revenue split.
### Step 3 (Entity B): post the mirrored bill
In Entity B's org (Entity B API key resolved):
```
create_bill(
contactResourceId: <Entity A as a supplier in Entity B's contacts>,
reference: 'IC-MGMT-2025-Q1-JAN',
valueDate: '2025-01-31',
dueDate: '2025-02-28',
lineItems: [{
name: 'Management services, January 2025',
accountResourceId: <Entity B's 'Intercompany Expense' or 'Management Fee Expense' GL>,
quantity: 1,
unitPrice: 15000
}],
capsuleResourceId: <Entity B IC capsule>,
saveAsDraft: false
)
```
The amount, valueDate, and reference MUST match Entity A's invoice exactly. Reconciliation downstream (step 5) compares these; mismatches mean either the wrong amount got posted or one side hasn't been recorded yet.
### Step 4: Settlement (varies by arrangement)
**Settlement option A: Cash settlement**
In Entity B's org (the payer):
```
pay_bill(
resourceId: <Entity B IC bill id>,
paymentAmount: 15000,
transactionAmount: 15000,
accountResourceId: <Entity B's bank account>,
paymentMethod: 'BANK_TRANSFER',
reference: 'IC-PAY-2025-Q1-JAN',
valueDate: '2025-02-15'
)
```
In Entity A's org (the payee):
```
pay_invoice(
resourceId: <Entity A IC invoice id>,
paymentAmount: 15000,
transactionAmount: 15000,
accountResourceId: <Entity A's bank account>,
paymentMethod: 'BANK_TRANSFER',
reference: 'IC-PAY-2025-Q1-JAN',
valueDate: '2025-02-15'
)
```
Both payments use the SAME bank reference. Bank-recon (`bank-recon.md`) on each side will match against this reference.
**Settlement option B: Net-off (Entity B also charges Entity A)**
Less cash-flow-intensive: net off intercompany charges across both directions. Requires posting credit notes:
1. In Entity A: `create_customer_credit_note(...)` for the amount Entity B charges back.
2. `apply_credits_to_invoice(resourceId: <Entity A's outstanding IC invoice to B>, credits: [{creditNoteResourceId: <CN>, amountApplied: <netting amount>}])`.
3. Mirror in Entity B with a supplier credit note + `apply_credits_to_bill`.
**Settlement option C: Loan-account treatment**
Long-term IC balances: instead of settling, keep as a loan. Same as `bank-loan.md` recipe but with the intercompany counterparty as the lender/borrower.
### Step 5: Monthly reconciliation
In each entity:
```
generate_general_ledger(accountResourceIds: [<IC Receivable in A | IC Payable in B>], startDate: <month-start>, endDate: <month-end>)
```
Cross-entity reconcile:
- Entity A's `Intercompany Receivable` balance == Entity B's `Intercompany Payable` balance (with sign flipped: receivable in A is debit, payable in B is credit)
- Differences indicate timing (one side posted, other hasn't) or amount errors.
For consolidation (if the practitioner manages a group): the matched IC balances ELIMINATE; `Intercompany Receivable` (Entity A) net against `Intercompany Payable` (Entity B), and `Intercompany Revenue` (Entity A) net against `Intercompany Expense` (Entity B). Per IFRS 10.B86. Consolidation typically happens in a separate consolidation worksheet, not in either entity's books.
---
## Common error classes and recovery
| Source | Error | Recovery |
|--------|-------|----------|
| Step 2 / 3 | Wrong-org posting: Entity A's invoice posted to Entity B's org | DELETE the wrongly-posted entry immediately. Re-post with the correct explicit `org_id`, after confirming it via `get_organization(org_id: <entity>)`. THIS IS THE #1 IC ERROR; pass and verify `org_id` on every leg; never rely on which org was active last. |
| Step 5 | IC Receivable in A ≠ IC Payable in B | Investigate per-transaction: pull both `search_invoices(contactId: <B in A's org>, startDate, endDate)` and `search_bills(contactId: <A in B's org>, startDate, endDate)` (neither search filters by capsule), line-by-line compare amounts, valueDates, references. Common: one side posted Jan 31, other posted Feb 1: timing diff that should resolve next period. Or one side posted USD-denominated and the other SGD: currency confusion. |
| Cross-FX intercompany | Entity A in SGD, Entity B in USD; IC Receivable in A doesn't match USD-equivalent in B | Both sides should agree on the transaction-currency amount (e.g., USD 15,000). Translation to base currency happens at each entity's books separately. Reconciliation at the SOURCE currency level, not base. |
| Transfer-pricing dispute (IRAS audit) | (process, separate from posting) | IC charges must satisfy arm's-length principle (SG: ITA s34D / OECD TPG). Maintain a transfer-pricing study and keep the supporting documentation on file. |
| Both entities forget to post | (audit risk) | Year-end audit-prep step; auditor reconciles IC balances. Build a quarterly review into the close routine. |
| Settlement reference mismatch | Bank-recon doesn't match IC payment to bill payment | Use a consistent `IC-PAY-YYYY-MM-XX` reference convention. Document the convention in your working notes. |
---
## Variations
- **Multi-leg IC** (Entity A → B → C): post 3 capsules (one per pair), each with its own invoice/bill set. Reconciliation is pairwise.
- **Intercompany loans** (long-term, with interest): use `bank-loan.md` recipe in EACH entity (Entity A as lender = invoice + scheduled receipts; Entity B as borrower = bill + scheduled payments). Mirror reconciliation each period.
- **Intercompany cost-sharing arrangements** (CCA, services received in multiple legal entities): pro-rate the charge across all participating entities; mirror in each. Document the allocation methodology.
- **Cross-currency IC**: use `currency: { sourceCurrency: 'USD' }` in the create_invoice/create_bill (per `jaz-api/SKILL.md` rule 25). Both sides agree on transaction-currency amount. Each entity's base-currency translation may differ; reconciliation at source-currency level.
- **Tax-deductibility considerations**: PH BIR may disallow IC charges without a transfer-pricing study; SG IRAS expects IC charges to be at arm's length. Practitioner judgment per jurisdiction.
---
## Cross-references
- Month-end close: invoked monthly per active IC arrangement. Orchestrates multi-org context switching (select entity A → post → select entity B → post → reconcile).
- Year-end close: full FY IC reconciliation; auditor sample-tests.
- `audit-prep.md` step 8: IC balances supporting schedule; auditor independently confirms with the counter-entity.
- Sibling `dividend.md`: cross-entity equity distribution; same multi-org coordination pattern.
- Data migration (multi-org setup): one Jaz org and API key per entity.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |