US sales tax breakdown
BodySplits the sales tax into one row per jurisdiction, state first, each on its own taxable amount, because a city can exempt clothing the state taxes and a county can cap the taxable price of a single item. Each row is rounded on its own base and the cent left over against the total is put on the state row, so the rows always add up to the tax charged, which multiplying a combined rate by the subtotal does not give you. Rates are decimal strings worked in whole numbers, never floats. Shipping is taxed only where the jurisdiction taxes delivery and only for the taxable share of the order, and a charge sent as shipping and handling together prints a warning, because that makes delivery taxable where it would not be. Exempt lines are listed under their reason. When a marketplace facilitator collected the tax, the rows are replaced by a statement saying so. Everything is worked out by a deriver that ships with it.
npx dxcl add us-sales-tax-breakdown salesTax.collectedBy Данные предпросмотра
JSON, на котором построен этот предпросмотр{
"salesTax": {
"currency": "USD",
"lines": [
{
"description": "Ride-on industrial floor scrubber, 40-inch cleaning path, lithium-ion battery (x12)",
"amountMinor": 148750000,
"taxable": true,
"category": "manufacturing-machinery"
},
{
"description": "Replacement squeegee blades and brush decks, assorted",
"amountMinor": 2486475,
"taxable": true
},
{
"description": "Extended service agreement, 60 months",
"amountMinor": 18750000,
"taxable": false,
"exemptReason": "Optional service contract, not tangible personal property"
}
],
"shipping": {
"amountMinor": 2485000,
"separatelyStated": true,
"combinedWithHandling": true
},
"jurisdictions": [
{
"level": "state",
"name": "Colorado",
"rate": "0.029",
"exemptCategories": [
"manufacturing-machinery"
]
},
{
"level": "county",
"name": "Arapahoe County",
"rate": "0.0025",
"exemptCategories": [
"manufacturing-machinery"
]
},
{
"level": "city",
"name": "City of Greenwood Village",
"rate": "0.03"
},
{
"level": "special",
"name": "Regional Transportation District",
"rate": "0.01",
"exemptCategories": [
"manufacturing-machinery"
]
},
{
"level": "special",
"name": "Scientific and Cultural Facilities District",
"rate": "0.001",
"exemptCategories": [
"manufacturing-machinery"
]
}
],
"collectedBy": "seller"
}
} {
"salesTax": {
"currency": "USD",
"lines": [
{
"description": "Ride-on industrial floor scrubber, 40-inch cleaning path, lithium-ion battery (x12)",
"amountMinor": 148750000,
"taxable": true,
"category": "manufacturing-machinery"
},
{
"description": "Replacement squeegee blades and brush decks, assorted",
"amountMinor": 2486475,
"taxable": true
},
{
"description": "Extended service agreement, 60 months",
"amountMinor": 18750000,
"taxable": false,
"exemptReason": "Optional service contract, not tangible personal property"
}
],
"shipping": {
"amountMinor": 2485000,
"separatelyStated": true,
"combinedWithHandling": true
},
"jurisdictions": [
{
"level": "state",
"name": "Colorado",
"rate": "0.029",
"exemptCategories": [
"manufacturing-machinery"
]
},
{
"level": "county",
"name": "Arapahoe County",
"rate": "0.0025",
"exemptCategories": [
"manufacturing-machinery"
]
},
{
"level": "city",
"name": "City of Greenwood Village",
"rate": "0.03"
},
{
"level": "special",
"name": "Regional Transportation District",
"rate": "0.01",
"exemptCategories": [
"manufacturing-machinery"
]
},
{
"level": "special",
"name": "Scientific and Cultural Facilities District",
"rate": "0.001",
"exemptCategories": [
"manufacturing-machinery"
]
}
],
"collectedBy": "marketplace"
}
} Разрешённые узлы
что получает рендерер — узлов: 1us-sales-tax section us-sales-tax section Файлы
что записывает установка; выбранный файл и есть компонентnodes/us-sales-tax-breakdown.node.tsx import { Cell, Paragraph, Row, Section, type Section as SectionComponent, Table, useDeriver, useState } from "docxcelerate/template";
import usSalesTaxBreakdown from "../derivers/us-sales-tax-breakdown.deriver.ts";
/**
* The sales tax on a US invoice, one row per taxing jurisdiction: state, then
* county, city and special district. Each row shows its own taxable amount,
* rate and tax, and the rows add up exactly to the tax charged.
*
* Different bases: a city can exempt goods the state taxes, such as clothing,
* and a county can cap the taxable price of a single item, as Tennessee and
* Alabama do. One base applied to every layer would overtax or undertax, so
* each row has its own.
*
* The residual goes to the state row: each row is rounded on its own base and
* the total is rounded once from the exact sum, so the rows can differ from it
* by a cent or two. That difference is put on the state row. Multiplying the
* combined rate by the subtotal gives the right total but rows that do not add
* up to it.
*
* Shipping is taxed proportionally, and only where delivery is taxed: it joins
* a jurisdiction's base only when that jurisdiction taxes delivery, and only
* for the share of the order that is taxable there.
*
* A combined shipping-and-handling charge warns. States that exempt delivery
* stated on its own tax it when it is combined, so the warning says so and what
* to change on the invoice.
*
* When a marketplace facilitator collected the tax, the rows are replaced by a
* statement saying so.
*
* The rows are eight fixed slots and the exemptions four, rather than a
* `.map()`: the resolver reads a published loop's entries from request data and
* ignores the derived scope, so a loop over the deriver's rows would publish and
* then resolve to nothing. More than eight jurisdictions throws; more than four
* exemption groups fold into the last slot.
*
* All of it is decided in one deriver and the node only prints its output.
* Per-request arithmetic cannot run at publish time, and branching per layer
* would spend `branchLimit`. Tests on the deriver's output are written inline
* (`tax.marketplace && ...`) and never hoisted into a `const`.
*
* Installed by `dxcl add us-sales-tax-breakdown`, which also installs its deriver.
*/
/** What this component reads. Add these fields to your document data type. */
export interface UsSalesTaxData {
salesTax: {
/**
* ISO 4217 code that every `…Minor` amount is in. Missing means `"USD"`.
* The number of minor digits comes from `Intl` (2 for USD), so
* `amountMinor: 4699` in USD is $46.99. An unknown code throws.
*/
currency?: string;
/**
* The goods and services on the invoice, in invoice order. Missing or empty
* means no goods: every row prints a zero taxable amount and zero tax, and
* shipping is not taxed, because there is nothing taxable for it to follow.
*/
lines?: Array<{
/**
* What the line is, as printed on the invoice. Printed only when the line
* is listed as exempt. Missing or blank on a line that has to be listed
* throws.
*/
description: string;
/**
* The line's net price in minor units (cents), after any line discount and
* before tax. Must be a safe integer. A negative amount is a discount or a
* return, and it reduces every base that includes the line. Anything that
* is not an integer throws.
*/
amountMinor: number;
/**
* Whether the state taxes this line at all. Required. Missing or not a
* boolean throws: guessing taxability is wrong in both directions. `false`
* leaves the line out of every base and lists it under `exemptReason`.
*/
taxable: boolean;
/**
* A category matched exactly against each jurisdiction's
* `exemptCategories`, for example `"clothing"`. Missing means no
* jurisdiction exempts the line by category.
*/
category?: string;
/**
* Why a `taxable: false` line is exempt, as printed. Missing prints
* "Not taxable". Ignored on a taxable line.
*/
exemptReason?: string;
}>;
/** The delivery charge. Missing means no shipping on the invoice. */
shipping?: {
/** Minor units, safe integer. Negative refunds shipping. Not an integer throws. */
amountMinor: number;
/**
* Whether delivery is shown as its own line on the invoice. Missing means
* `true`, since it arrived as its own field. `false` means it is folded
* into the sale price, so it is taxable wherever the goods are.
*/
separatelyStated?: boolean;
/**
* Whether this one charge covers shipping and handling together. In a
* state that exempts delivery stated on its own, a combined charge is
* taxable, and a warning prints. Missing means `false`.
*/
combinedWithHandling?: boolean;
};
/**
* Every jurisdiction that taxes this sale, in any order. They are printed
* state, county, city, special, and in the given order within a level.
* Required unless `collectedBy` is `"marketplace"`. Missing, empty, without
* exactly one `state` entry, or with a level outside the four all throw.
* A state with no state sales tax, such as Alaska, still sends a state row
* with `rate: "0"`.
*/
jurisdictions?: Array<{
/** Which layer this is. */
level: "state" | "county" | "city" | "special";
/** What it is called, as printed: `"Travis County"`. Missing or blank throws. */
name: string;
/**
* The rate as a decimal fraction string with at most 6 decimal places:
* `"0.0625"`, `"0.0825"`, `"0.047125"`, `"0"`. Never a number and never a
* percent. Not matching `^(0|[1-9]\d*)(\.\d{1,6})?$`, or a value of 1 or
* more (which is how `"6.25"` gets caught), throws.
*/
rate: string;
/**
* Whether this jurisdiction taxes delivery charges that are stated
* separately. Missing means it follows the state row. Missing on the state
* row means `false`.
*/
taxesShipping?: boolean;
/**
* Line categories this jurisdiction does not tax, even though the line is
* `taxable`. Matched exactly against `line.category`. Missing means none.
*/
exemptCategories?: string[];
/**
* The most of any one line this jurisdiction taxes, in minor units. Each
* line counts as a single item (see Out of scope). Missing means no cap.
* Present but not a positive safe integer throws.
*/
perItemCapMinor?: number;
}>;
/**
* Who collected the tax. Missing means `"seller"`. With `"marketplace"`, no
* rows, exemptions or warning are printed, only the facilitator statement,
* and nothing else here is validated. Any other value throws.
*/
collectedBy?: "seller" | "marketplace";
/**
* The facilitator's name, printed in the statement. Read only when
* `collectedBy` is `"marketplace"`. Missing or blank prints "the marketplace
* facilitator".
*/
marketplaceName?: string;
};
}
export const UsSalesTaxBreakdown: SectionComponent = async () => {
const [salesTax] = useState((data: UsSalesTaxData) => data.salesTax);
const tax = await useDeriver(usSalesTaxBreakdown, [salesTax]);
return (
<Section id="us-sales-tax" title="Sales tax">
{tax.marketplace && <Paragraph id="us-sales-tax-marketplace">{tax.marketplace}</Paragraph>}
{!tax.marketplace && (
<Table
id="us-sales-tax-table"
columns={[{ width: "auto" }, { width: 32, align: "right" }, { width: 20, align: "right" }, { width: 28, align: "right" }]}
>
<Row id="us-sales-tax-header" header>
<Cell>Jurisdiction</Cell>
<Cell>Taxable amount</Cell>
<Cell>Rate</Cell>
<Cell>Tax</Cell>
</Row>
{tax.rowSlots[0].name && (
<Row id="us-sales-tax-row-1">
<Cell>{tax.rowSlots[0].name}</Cell>
<Cell>{tax.rowSlots[0].taxable}</Cell>
<Cell>{tax.rowSlots[0].rate}</Cell>
<Cell>{tax.rowSlots[0].tax}</Cell>
</Row>
)}
{tax.rowSlots[1].name && (
<Row id="us-sales-tax-row-2">
<Cell>{tax.rowSlots[1].name}</Cell>
<Cell>{tax.rowSlots[1].taxable}</Cell>
<Cell>{tax.rowSlots[1].rate}</Cell>
<Cell>{tax.rowSlots[1].tax}</Cell>
</Row>
)}
{tax.rowSlots[2].name && (
<Row id="us-sales-tax-row-3">
<Cell>{tax.rowSlots[2].name}</Cell>
<Cell>{tax.rowSlots[2].taxable}</Cell>
<Cell>{tax.rowSlots[2].rate}</Cell>
<Cell>{tax.rowSlots[2].tax}</Cell>
</Row>
)}
{tax.rowSlots[3].name && (
<Row id="us-sales-tax-row-4">
<Cell>{tax.rowSlots[3].name}</Cell>
<Cell>{tax.rowSlots[3].taxable}</Cell>
<Cell>{tax.rowSlots[3].rate}</Cell>
<Cell>{tax.rowSlots[3].tax}</Cell>
</Row>
)}
{tax.rowSlots[4].name && (
<Row id="us-sales-tax-row-5">
<Cell>{tax.rowSlots[4].name}</Cell>
<Cell>{tax.rowSlots[4].taxable}</Cell>
<Cell>{tax.rowSlots[4].rate}</Cell>
<Cell>{tax.rowSlots[4].tax}</Cell>
</Row>
)}
{tax.rowSlots[5].name && (
<Row id="us-sales-tax-row-6">
<Cell>{tax.rowSlots[5].name}</Cell>
<Cell>{tax.rowSlots[5].taxable}</Cell>
<Cell>{tax.rowSlots[5].rate}</Cell>
<Cell>{tax.rowSlots[5].tax}</Cell>
</Row>
)}
{tax.rowSlots[6].name && (
<Row id="us-sales-tax-row-7">
<Cell>{tax.rowSlots[6].name}</Cell>
<Cell>{tax.rowSlots[6].taxable}</Cell>
<Cell>{tax.rowSlots[6].rate}</Cell>
<Cell>{tax.rowSlots[6].tax}</Cell>
</Row>
)}
{tax.rowSlots[7].name && (
<Row id="us-sales-tax-row-8">
<Cell>{tax.rowSlots[7].name}</Cell>
<Cell>{tax.rowSlots[7].taxable}</Cell>
<Cell>{tax.rowSlots[7].rate}</Cell>
<Cell>{tax.rowSlots[7].tax}</Cell>
</Row>
)}
<Row id="us-sales-tax-total">
<Cell>Total sales tax</Cell>
<Cell>{tax.total.taxable}</Cell>
<Cell>{tax.total.rate}</Cell>
<Cell>{tax.total.tax}</Cell>
</Row>
</Table>
)}
{tax.exemptionSlots[0].reason && (
<Paragraph id="us-sales-tax-exempt-1">{tax.exemptionSlots[0].reason}: {tax.exemptionSlots[0].items}.</Paragraph>
)}
{tax.exemptionSlots[1].reason && (
<Paragraph id="us-sales-tax-exempt-2">{tax.exemptionSlots[1].reason}: {tax.exemptionSlots[1].items}.</Paragraph>
)}
{tax.exemptionSlots[2].reason && (
<Paragraph id="us-sales-tax-exempt-3">{tax.exemptionSlots[2].reason}: {tax.exemptionSlots[2].items}.</Paragraph>
)}
{tax.exemptionSlots[3].reason && (
<Paragraph id="us-sales-tax-exempt-4">{tax.exemptionSlots[3].reason}: {tax.exemptionSlots[3].items}.</Paragraph>
)}
{tax.shippingWarning && <Paragraph id="us-sales-tax-shipping-warning">{tax.shippingWarning}</Paragraph>}
</Section>
);
}; derivers/us-sales-tax-breakdown.deriver.ts // deno-lint-ignore-file no-explicit-any
import { deriver } from "docxcelerate/template";
/**
* Works out a US sales tax breakdown: one row per jurisdiction, each on its own
* base, adding up to the tax charged. Installed by
* `dxcl add us-sales-tax-breakdown`.
*
* It is self-contained on purpose: it travels to the engine as source text, so
* a module-level constant or helper would be a ReferenceError there. The order
* map, the rounding, the rate parser and the formatters are all declared inside
* it.
*
* It rounds half away from zero, so a credit memo mirrors its invoice to the
* cent. It throws rather than guess whether something is taxable: a line with
* no `taxable` flag, a rate that is not a decimal string and a missing state
* row are all errors, because a guess is wrong in one direction or the other.
*
* It has no placeholder, so previews run it.
*/
export default deriver({
name: "usSalesTaxBreakdown",
run: (salesTax: unknown) => {
const st = salesTax as any;
if (st === null || typeof st !== "object") throw new Error("salesTax is required");
const collectedBy = st.collectedBy ?? "seller";
if (collectedBy !== "seller" && collectedBy !== "marketplace") {
throw new Error('salesTax.collectedBy must be "seller" or "marketplace"');
}
// The published loop cannot read this output, so the node prints fixed slots: 8 rows, 4 exemption groups.
const pad = <T,>(items: T[], size: number, empty: T): T[] => {
const out = items.slice(0, size);
while (out.length < size) out.push(empty);
return out;
};
const emptyRow = { name: "", taxable: "", rate: "", tax: "" };
const emptyGroup = { reason: "", items: "" };
if (collectedBy === "marketplace") {
const name = typeof st.marketplaceName === "string" && st.marketplaceName.trim() !== ""
? st.marketplaceName.trim()
: "the marketplace facilitator";
return {
marketplace: "Sales tax on this order was collected and remitted by " + name +
" as the marketplace facilitator, so it is not charged on this invoice.",
rows: [] as Array<{ name: string; taxable: string; rate: string; tax: string; taxableMinor: number; taxMinor: number }>,
total: { taxable: "", rate: "", tax: "", taxMinor: 0 },
exemptions: [] as Array<{ reason: string; items: string }>,
rowSlots: pad([] as Array<typeof emptyRow>, 8, emptyRow),
exemptionSlots: pad([] as Array<typeof emptyGroup>, 4, emptyGroup),
shippingWarning: "",
};
}
const roundHalfAway = (n: bigint, d: bigint): bigint =>
n >= 0n ? (2n * n + d) / (2n * d) : -((-2n * n + d) / (2n * d));
const abs = (n: bigint): bigint => n < 0n ? -n : n;
const currency: string = st.currency ?? "USD";
let money: Intl.NumberFormat;
try {
money = new Intl.NumberFormat("en-US", { style: "currency", currency });
} catch {
throw new Error("salesTax.currency must be an ISO 4217 code");
}
const digits = money.resolvedOptions().maximumFractionDigits ?? 2;
const fmt = (minor: bigint): string => money.format(Number(minor) / 10 ** digits);
const pct = (millionths: bigint): string => {
const whole = millionths / 10000n;
let frac = String(millionths % 10000n).padStart(4, "0");
while (frac.length > 2 && frac.endsWith("0")) frac = frac.slice(0, -1);
return whole + "." + frac + "%";
};
const jur = st.jurisdictions;
if (!Array.isArray(jur) || jur.length === 0) {
throw new Error("salesTax.jurisdictions must be a non-empty array");
}
if (jur.length > 8) throw new Error("salesTax.jurisdictions has more than the 8 rows the component prints");
const levels = ["state", "county", "city", "special"];
const parsed = jur.map((j: any, index: number) => {
const at = "salesTax.jurisdictions[" + index + "]";
if (j === null || typeof j !== "object") throw new Error(at + " must be an object");
if (!levels.includes(j.level)) throw new Error(at + ".level must be one of " + levels.join(", "));
if (typeof j.name !== "string" || j.name.trim() === "") throw new Error(at + ".name is required");
const m = typeof j.rate === "string" ? /^(0|[1-9]\d*)(\.(\d{1,6}))?$/.exec(j.rate) : null;
const rate = m ? BigInt(m[1]) * 1000000n + BigInt((m[3] ?? "").padEnd(6, "0")) : null;
if (rate === null || rate >= 1000000n) {
throw new Error(at + '.rate must be a decimal string such as "0.0625"');
}
if (j.perItemCapMinor !== undefined && j.perItemCapMinor !== null &&
(!Number.isSafeInteger(j.perItemCapMinor) || j.perItemCapMinor <= 0)) {
throw new Error(at + ".perItemCapMinor must be a positive integer");
}
if (j.exemptCategories !== undefined && j.exemptCategories !== null && !Array.isArray(j.exemptCategories)) {
throw new Error(at + ".exemptCategories must be an array");
}
return {
index,
order: levels.indexOf(j.level),
name: j.name as string,
rate,
taxesShipping: j.taxesShipping as boolean | undefined,
exempt: (j.exemptCategories ?? []) as string[],
cap: j.perItemCapMinor == null ? null : BigInt(j.perItemCapMinor),
};
});
if (parsed.filter((j: { order: number }) => j.order === 0).length !== 1) {
throw new Error("salesTax.jurisdictions must have exactly one state entry");
}
const js = [...parsed].sort((a, b) => a.order - b.order || a.index - b.index);
const state = js[0];
const rawLines = st.lines ?? [];
if (!Array.isArray(rawLines)) throw new Error("salesTax.lines must be an array");
const lines = rawLines.map((l: any, index: number) => {
const at = "salesTax.lines[" + index + "]";
if (l === null || typeof l !== "object") throw new Error(at + " must be an object");
if (!Number.isSafeInteger(l.amountMinor)) throw new Error(at + ".amountMinor must be an integer");
if (typeof l.taxable !== "boolean") throw new Error(at + ".taxable must be true or false");
return { index, line: l, amount: BigInt(l.amountMinor) };
});
const ship = st.shipping === undefined || st.shipping === null ? null : st.shipping;
if (ship !== null && !Number.isSafeInteger(ship.amountMinor)) {
throw new Error("salesTax.shipping.amountMinor must be an integer");
}
const shipAmount = ship === null ? 0n : BigInt(ship.amountMinor);
const combined = ship !== null && ship.combinedWithHandling === true && ship.separatelyStated !== false;
const taxedBy = (j: { exempt: string[] }, l: { taxable: boolean; category?: string }): boolean =>
l.taxable === true && !(l.category !== undefined && j.exempt.includes(l.category));
const all = lines.reduce((sum: bigint, l: { amount: bigint }) => sum + l.amount, 0n);
let warn = false;
const bases = js.map((j) => {
let goods = 0n;
let base = 0n;
for (const { line, amount } of lines) {
if (!taxedBy(j, line)) continue;
goods += amount;
base += j.cap === null ? amount : amount >= 0n ? (amount < j.cap ? amount : j.cap) : (amount > -j.cap ? amount : -j.cap);
}
if (ship !== null) {
const ships = j.taxesShipping ?? state.taxesShipping ?? false;
if (ships || ship.separatelyStated === false || ship.combinedWithHandling === true) {
const none = all === 0n || goods === 0n || (goods > 0n) !== (all > 0n);
const share = none ? 0n : abs(goods) >= abs(all) ? shipAmount : roundHalfAway(shipAmount * abs(goods), abs(all));
base += share;
if (!ships && share !== 0n) warn = true;
}
}
return base;
});
const exact = js.map((j, i) => bases[i] * j.rate);
const taxes = exact.map((e) => roundHalfAway(e, 1000000n));
const totalTax = roundHalfAway(exact.reduce((a, b) => a + b, 0n), 1000000n);
const residual = totalTax - taxes.reduce((a, b) => a + b, 0n);
const target = state.rate !== 0n ? 0 : js.findIndex((j) => j.rate !== 0n);
if (target >= 0) taxes[target] += residual;
const rows = js.map((j, i) => ({
name: j.name,
taxable: fmt(bases[i]),
rate: pct(j.rate),
tax: fmt(taxes[i]),
taxableMinor: Number(bases[i]),
taxMinor: Number(taxes[i]),
}));
const same = bases.every((b) => b === bases[0]);
const total = {
taxable: same ? fmt(bases[0]) : "",
rate: same ? pct(js.reduce((sum, j) => sum + j.rate, 0n)) : "",
tax: fmt(totalTax),
taxMinor: Number(totalTax),
};
const list = new Intl.ListFormat("en-US", { type: "conjunction" });
const groups: Array<{ reason: string; items: string[] }> = [];
for (const { index, line, amount } of lines) {
let reason: string;
if (!line.taxable) {
reason = typeof line.exemptReason === "string" && line.exemptReason.trim() !== ""
? line.exemptReason.trim()
: "Not taxable";
} else {
const skipping = js.filter((j) => !taxedBy(j, line));
if (skipping.length === 0) continue;
reason = skipping.length === js.length
? "Exempt from sales tax (" + line.category + ")"
: "Not taxed by " + list.format(skipping.map((j) => j.name));
}
if (typeof line.description !== "string" || line.description.trim() === "") {
throw new Error("salesTax.lines[" + index + "].description is required");
}
const item = line.description + " (" + fmt(amount) + ")";
const group = groups.find((g) => g.reason === reason);
if (group) group.items.push(item);
else groups.push({ reason, items: [item] });
}
const shippingWarning = warn && combined
? "Shipping and handling were charged together as " + fmt(shipAmount) + ". " + state.name +
" does not tax delivery charges stated on their own, but a combined shipping and handling charge is taxable, so its taxable share has been taxed here. Invoice handling as a separate line to keep delivery out of the tax."
: "";
const exemptions = groups.map((g) => ({ reason: g.reason, items: g.items.join("; ") }));
// Past the last slot the remaining groups are folded into it, so nothing is dropped.
if (exemptions.length > 4) {
const rest = exemptions.splice(3);
exemptions.push({ reason: "Other exemptions", items: rest.map((g) => g.reason + ": " + g.items).join(" | ") });
}
return {
marketplace: "",
rows,
total,
exemptions: groups.map((g) => ({ reason: g.reason, items: g.items.join("; ") })),
rowSlots: pad(rows.map(({ name, taxable, rate, tax }) => ({ name, taxable, rate, tax })), 8, emptyRow),
exemptionSlots: pad(exemptions, 4, emptyGroup),
shippingWarning,
};
},
});