@zenuinebit/invoice
v0.1.0
Published
Calculate invoice totals and render print-ready invoice HTML. Depends only on @zenuinebit/money and @zenuinebit/tax.
Readme
@zenuinebit/invoice
Calculate invoice totals and render a print-ready HTML invoice. Zero dependencies; works in Node and the browser.
import { calculateTotals, renderInvoiceHTML } from "@zenuinebit/invoice";
const totals = calculateTotals(invoice); // { subtotal, discount, tax, total }
const html = renderInvoiceHTML(invoice); // open it and call window.print(), or feed it to a PDF toolMoney is computed in integer minor units via @zenuinebit/money and @zenuinebit/tax, so totals never drift and respect each currency's decimals (JPY has none). All text is HTML-escaped; only extraHtml is inserted raw, so pass trusted markup only (for example a QR code from @zenuinebit/qrcode).
