Invoicing
GST-aware, recurring-friendly, with TDS settlement built in.

What's working
- GST math:
- Client state code from GSTIN → intra-state (CGST + SGST half-half) vs inter-state (IGST).
- Per-line
HSNCode+TaxRate→TaxAmountauto-computed. IsGSTRegistered = 0clients → no GST, plain invoice.
- Firm-scoped invoice numbering —
Firm.InvoiceNumberPrefix(e.g. 'TUL') + FY ("26-27") + padded series →TUL/26-27/0001. Atomic counter viaInvoiceCountertable — gapless allocation, race-free. - Recurring engagements —
ClientService× frequency × due-date math materialises monthly invoices for retainer clients. Daily cron at 5am IST (IssueRecurringInvoicestask). - TDS handling (Slice F2/F3):
Client.IsTDSDeductor = 1→ auto-computeTDSAmount = 10% of Subtotal.- Payment-time settlement — when a client pays ₹X net-of-TDS, our
InvoicePaymentrow captures TDSDeducted; F3 ledger tracksTDSCreditlifecycle (Deducted → Reflected in 26AS → Claimed in ITR).
- Credit notes —
CreditNotetable with state machine (Draft / Issued / Cancelled), linked to original invoice, GST Act §34 compliant. - PDF rendering —
lib/invoicePdf.mjsproduces a clean A4 invoice PDF with firm logo, GST breakdown, terms, bank details. - Bulk email send — Slice 18c sends overdue-invoice reminders via SendGrid daily at 5am with PDF attached, per-firm cadence config (FirmReminderConfig), de-duped to prevent double sends.
- Excel import — invoices + lines via multi-sheet template, transient natural key (
InvoiceRefmatches parent rows to child lines).
What's stub / pending
- e-Invoice IRN push — needs GST Suvidha Provider (GSP) onboarding. The data model is e-Invoice ready (
Firm.InvoiceNumberPrefix, GSTIN, HSN, place of supply); only the actual API call to NIC is missing. - GSTR-1 inclusion preview — clicking an invoice could show "this will appear in GSTR-1 section: b2b" with the row preview.
- Multi-currency — INR-only today. Foreign-currency export invoices would need extra modeling.