Supplier outstanding balance (AP outstanding)
Calculates the true supplier AP outstanding balance accounting for partial payments. Provides an accurate snapshot of accounts payable at any given date.
84/100ยท๐
WeeklyยทIntermediateCFOAP ManagerController
ReconciliationSuppliersget_payablesget_payable_by_id
๐ฏ Skill purpose
Calculates the true supplier AP outstanding balance accounting for partial payments. Provides an accurate snapshot of accounts payable at any given date.
๐ What it produces
Total AP outstanding with breakdown by supplier, invoiced amount vs paid amount.
โก Benefit
Before
Manual Excel calculation reconciling invoices and payments supplier by supplier.
After
Exact real-time AP outstanding, supplier by supplier, without spreadsheets.
# Instructions โ Calculating supplier outstanding (AP outstanding)
## โ ๏ธ Critical rule
The `amount` field of a payable is **always the total invoice amount**, never reduced by partial payments.
`paymentStatus=toPay` includes **partially paid** invoices โ do not sum `amount` directly.
**Correct formula**: for each `toPay` payable, the actual outstanding = `amount.amount - sum(allocations[].amount.amount)`
## Step 1 โ Retrieve unpaid payables
Call `get_payables` with:
```
filters: { field: "paymentStatus", operator: "=", value: ["toPay"] }
```
Paginate if `hasNextPage=true`.
## Step 2 โ For each payable, calculate the true remaining balance
```
For each payable p:
allocations_sum = sum(p.allocations[i].amount.amount)
actual_outstanding = p.amount.amount - allocations_sum
outstanding_decimal = actual_outstanding / 10^p.amount.precision
```
Examples of real cases encountered:
- Payable with allocations `[+11,106, -11,106]` โ net = 0 โ outstanding = 0 (payment then revision)
- Payable with allocations `[]` โ outstanding = total amount โ unpaid invoice
- Payable with allocation `[-250,000]` on a credit note of `-300,000` โ 50,000 still to apply
## Step 3 โ Aggregate in functional currency
**Careful**: amounts are in various currencies. Use `functionalAmount` (in the company's functional currency) for aggregation, not `amount` (invoice currency).
Calculate `functional_outstanding` = `functionalAmount.amount - sum(functional_allocations)`.
## Step 4 โ Summary
Display:
- Total outstanding in functional currency
- Number of invoices involved
- Top 5 suppliers by outstanding amount
- Flag payables with complex allocations (revisions, partial credit notes)
## Example prompts
- "What is our total supplier outstanding?"
- "How much do we still owe suppliers this month?"
How to install this skill
/
- 1Download the file
s13-ap-outstanding-calcul.mdusing the button above. - 2Place the file in the
.claude/directory of your project (or~/.claude/for a global install).cp s13-ap-outstanding-calcul.md .claude/s13-ap-outstanding-calcul.md - 3Use in Claude Code โ the skill is automatically discovered. Describe your need in natural language and Claude will apply the skill instructions.
๐ก Make sure the Spendesk MCP is configured in your
.claude/settings.json with the tools get_payables, get_payable_by_id.Similar skills
โ
Top