# CashApplication

> The highest-value screen in AR. Every case, not just the happy one.

Source: https://lopifi.com/components/cash-application
Part of: Lopifi — US GAAP books on autopilot, reviewed by a CPA (https://lopifi.com)

---

- **Family:** Receivables (AR) — 
- **Status:** Implemented
- **Spec:** https://lopifi.com/docs/catalog/10-receivables

## Install

```bash
npx shadcn@latest add @lopifi/theme
npx shadcn@latest add @lopifi/cash-application
```

## Specification

> The highest-value screen in AR, and the one most tools handle worst.

Left: unapplied payments. Right: open invoices for that customer. A running sum against the payment amount as invoices are selected, so the user sees when the selection is exact.

**Every case is a first-class path, not just the happy one:** exact, partial, overpayment, lump-sum-to-many, short pay, no-invoice, duplicate, bank fee deducted in transit, FX settlement difference.

**Rules:** unapplied cash is never revenue; it is shown separately within AR, and a customer's net credit balance is flagged for reclassification to a liability · a remaining difference always requires a disposition (write-off with reason and account, leave unapplied, or dispute) · write-off thresholds enforce approval · applying is reversible and audited.

The match uses the [reconciliation animation](../motion/03-catalog.md) — one of the four sanctioned moments.

## Rules this component obeys

Money is minor units, never floats. `null` is not `0` and neither is redacted. Negatives render in accounting parentheses with the parenthesis column reserved on both sides. Debit and credit are two columns. Per-currency decimal places. Polarity is explicit — up is not always good. Every figure states its period, entity, currency, basis and as-of.
