> For the complete documentation index, see [llms.txt](https://kb.theloops.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.theloops.io/agentstudio/skills-library/financials-and-accounts-receivable/explain-customer-invoice-aging.md). Agents can also search and read this documentation through its [MCP server](https://kb.theloops.io/~gitbook/mcp).

# Explain Customer Invoice Aging

Explains why one customer invoice is still open or overdue by reading the invoice, installments, payment history and dunning context. Read-only.

| Business area                      | Action type |
| ---------------------------------- | ----------- |
| Financials and Accounts Receivable | Read-only   |

## Overview

A customer invoice in IFS Cloud is a ledger item (InvoiceLedgerItem, query invoice\_ledger\_item\_cu\_qry) with a status (Objstate, enum InvoiceState), amounts (InvoiceAmount, OpenAmount), a due date (DueDate = next/last due date), and flags that commonly explain why money has not arrived: an installment plan (PayPlan), an exception code (ReasonCodeExist), a bad-debt level or ledger status (BadDebtLevel, LedgerStatusType), a correction in progress (CorrectionExists), a different payer (PayerIdentity), or a not-yet-sent invoice (SendStatus).

The IFS Cloud integration reads customer invoices, installments, payments and reminders to explain aging.

## How it works

{% stepper %}
{% step %}
If company or invoice identifier is missing, ask.
{% endstep %}

{% step %}
Call Find Customer Invoice. If 0 rows → invoice not found. If >1 rows → list and ask user to choose.
{% endstep %}

{% step %}
Call List Invoice Installments (company, invoice\_id).
{% endstep %}

{% step %}
Call Get Invoice Payment History (company, identity, series\_id, invoice\_no, ledger\_item\_version).
{% endstep %}

{% step %}
Call Get Customer Dunning Context (company, identity).
{% endstep %}

{% step %}
Decide verdict (first match): Cancelled, Paid, Bad debt, On hold, Not due, Partly paid - overdue, Overdue.
{% endstep %}
{% endstepper %}

## Key capabilities

* Resolves an invoice by InvoiceId or by series and invoice number within a company.
* Reads status, amounts (transaction and accounting currency), dates and payment terms of the invoice.
* Calculates days overdue from DueDate against the evaluation date.
* Lists installments with installment status (OnHold, PartlyPaid, ...) and predicted payment delay.
* Lists payments, write-offs, discounts, interest and fines cleared against the invoice, including rolled-back payments.
* Detects blockers: exception code, bad debt, repost, correction invoice in progress, other payer, invoice not yet sent.
* Adds customer dunning context (latest reminder level and amounts).
* Returns a verdict with plain-language drivers and one recommended next action, never changes data.

## Requirements

The following IFS Cloud components and projections must be available, with permission sets that grant access to each projection.

| Component | Projection                                   |
| --------- | -------------------------------------------- |
| PAYLED    | ArCustomerInvoicesAnalysis                   |
| PAYLED    | CustomerInvoicesWithInterestFineAnalysis     |
| PAYLED    | CustomerPaymentsPerInvoicePrePaymentAnalysis |
| PAYLED    | CustomerReminderAnalysis                     |

## Version compatibility

| Projection                                   | Supported IFS Cloud releases |
| -------------------------------------------- | ---------------------------- |
| ArCustomerInvoicesAnalysis                   | 24R2, 25R1, 25R2, 26R1, 26R2 |
| CustomerInvoicesWithInterestFineAnalysis     | 24R2, 25R1, 25R2, 26R1, 26R2 |
| CustomerPaymentsPerInvoicePrePaymentAnalysis | 24R2, 25R1, 25R2, 26R1, 26R2 |
| CustomerReminderAnalysis                     | 24R2, 25R1, 25R2, 26R1, 26R2 |

## Known limitations

* Read-only: does not create, update, or delete IFS Cloud data.
* Requires projection-level security. Permission errors halt the run.
