Receivables reporting distinguishes invoiced, paid and outstanding amounts. Money values should retain a defined unit throughout the server calculation.
Worked example
// app/billing/page.tsx
export default function ReceivablesBalance() {
const invoices = [
{ id: "A", cents: 3200, paid: true, due: "2028-01-10" },
{ id: "B", cents: 7900, paid: false, due: "2028-02-15" },
{ id: "C", cents: 4600, paid: false, due: "2028-03-20" },
];
return (
<output>
Outstanding:{" "}
{(invoices.filter((i) => !i.paid).reduce((s, i) => s + i.cents, 0) / 100).toFixed(
2,
)}
</output>
);
}Implementation notes
A credit or overpayment can produce a negative balance. Decide whether that is a credit to display or a condition requiring reconciliation.
Try it yourself
Apply a partial payment and inspect the outstanding balance.
Open the Next.js example →Editorial date July 5, 2025 · Published December 6, 2026