# SalesTaxSummary

> Taxable, exempt and collected by jurisdiction; the liability tied to the GL.

Source: https://lopifi.com/components/sales-tax-summary
Part of: Lopifi — US GAAP books on autopilot, checked by a CPA (https://lopifi.com)

---

- **Family:** Tax & compliance — The obligations around the books: what is due to whom, who has been verified, and which controls held.
- **Status:** Implemented
- **Spec:** https://lopifi.com/docs/catalog/14-tax-compliance

## Install

```bash
npx shadcn@latest add @lopifi/theme
npx shadcn@latest add @lopifi/sales-tax-summary
```

## Specification

By jurisdiction: gross sales, exempt, taxable, rate, tax collected, tax due, and the return's state (`open | filed | paid`). Totals sit under single and double rules over the figure columns only.

**The tie-out is the point.** The unpaid liability on the returns (every row not yet paid) is compared to the sales-tax-payable balance in the GL, and the difference is on screen. Three renders: **ties**, **differs** (an alert, with the signed difference), and **not tied out**. A `null` GL balance never compares against zero; the component states that no tie-out was performed.

**Each row proves itself.** Gross less exempt must equal taxable. A row that doesn't gets a glyph in the taxable cell and is named in an alert above the table. A gap between collected and due is printed under the jurisdiction as "Collected $31.80 less than due". Over- and under-collection are both findings, in opposite directions.

**Refuses to render:** a computed average rate. A row blending several rates passes `rate: null` and prints "Blended". Mixed currencies are never summed either: one `currency` prop governs every row.

**Edge cases:** a 0-decimal currency (the amounts follow the currency's exponent through `Money`). Every row paid, so the unpaid liability is zero and ties to a zero GL balance. A jurisdiction exempt in full.

**Accessibility:** a real `<table>` with a caption naming the period and currency, row headers per jurisdiction, and the frozen header and first column from `.ledger-frozen` (CSS only, so the component stays server-safe).

## 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.
