
Compliance
Designed so a silent bug cannot invent tax.
GST invoices, e-way bills and IRNs are legal artefacts. If a government or gateway adapter is unreachable, the document stays unfinished — we do not type a number to keep the UI green.

Money is Decimal(18,2). Never a float.
Currency is exact rupees, two places. Rounding happens only at defined boundaries.
- GST rounds HALF-UP per line to two decimals.
- Landed cost remainder lands on the last GRN line so paise sum exactly.
- Cash amounts reject more than two decimal places.

Every journal balances. The original is never rewritten.
Sum of debits equals sum of credits. If a report cannot prove that, it must not pretend the books are fine.
- Cancelling an invoice posts a reversing journal — rows on the original are not edited.
- Credit notes and debit notes are new sourced documents with their own gap-free numbers.
- P&L and balance sheet derive from posted journals for a date range.
- The cash ledger proves Σdebit = Σcredit over the range, not just the current page.

Place of supply, HSN, and nil-GST where the law says so.
GST is not a theme on the invoice PDF. Place of supply comes from the ship-to state. Job-work is a challan, not a tax invoice.
- CGST+SGST vs IGST from customer state vs facility state.
- HSN and default GST rate come from the item; they can be reviewed, not invented at print time.
- India job-work challans are nil GST.
- B2C (no customer GSTIN) is marked IRN-not-required — we do not mint a number.

If the government portal is down, the document stays unfinished.
IRN and e-way bill numbers are legal artefacts. The default stub never fabricates them. Blocked means do not ship.
- IRN via the IRP/GSP adapter. Unreachable or rejected → the invoice stays without an IRN.
- E-way required at threshold. Status blocked / failed → wait and retry. Do not type a 12-digit EBN.
- GSTR-1 is a JSON export of posted invoices. Auto-file stays GSP-gated. A government ack is never invented.

The token is the access control. Hostile input, one customer.
The customer portal is unauthenticated by design. We never store payment-instrument data — PCI stays with the gateway.
- Reveal shows the existing link; rotate invalidates the old token.
- The portal is scoped to that customer’s invoices and balance. Nothing else.
- Pay goes through the configured gateway. Stubs never capture a fake payment id.
What we never do
A green UI is not a filed return
- Invent an IRN, e-way bill number, or government acknowledgement.
- Edit rows on a posted invoice. Cancel and credit notes post new journals.
- Ship QC-hold, scrap, job-worker, or expired process-lot quantity.
- Let MRP silently create a purchase order or work order.
- Store card, UPI, or bank-instrument data. Reference and status only.
- Show another customer’s invoices on a portal token.
Prove it in the books
Raise an invoice, cancel it, and read the reversing journal. Help & Guide names the exact screens.