case-study --logistics
§IV · PLATELogistics SaaS
Live · in productionOperations + billing for a family-run logistics business — lorry receipts, GST/TDS billing, payments, expenses and a customer portal, with a Postgres deadlock fix, proportional-TDS ledger, and tax computation engine.
project-brief --outcome-first
§IV · BRIEFWhat had to change
Replace paper LR books and disconnected spreadsheets without asking a working transport business to abandon its real billing and tax workflow.
What I shipped
A staff operations system plus customer portal for LRs, bills, allocations, expenses, rate cards, GST/TDS reports, financial years, PDFs, and accounting sync.
What the business gained
The business now runs daily shipment, billing, receivables, and reporting work from one source of truth, with customers able to see bills, shipments, and statements themselves.
systems --under-the-hood
§IV · SCHEMATIC- AB-BA deadlock fix — global lock ordering
Removed Postgres 40P01 deadlocks in billing/payment flows by enforcing one global row-lock order, then revalidating data-dependent lock sets after acquisition.
- Proportional-TDS customer ledger
A single-source-of-truth ledger — direct-vs-indirect payment attribution, TDS pro-rated across bills, on-account advances, opening-balance reconstruction — reused by the staff ledger, customer portal, statements and reports so balances can never disagree.
- GTA GST/TDS computation engine
GTA reverse-charge GST and Section 194C dual-threshold TDS with PAN-type rate detection, behind one validated place-of-supply resolver (IGST vs CGST/SGST) shared by the GSTR-1 report and the accounting sync.
- Money-mutation invariants
Restore-before-cascade so unallocated credit never vanishes, reversed-payment-aware bill status, LR row-locking against double-billing, and epsilon-tolerant allocation math.
- Customer self-service portal
Read-only, group-aware access gives customers their shipments, bills, payment requests, and financial-year statement without exposing staff CRUD screens.
- Document and accounting pipeline
Pixel-faithful LR, bill, ledger, rate-card, and report PDFs are cached where safe, while Zoho export/import flows reuse the same validated tax and ledger rules.
context --how-it-works
§IV · NOTESNaveen Logistics uses this system as its operating layer: staff create lorry receipts, consolidate them into bills, allocate payments, record expenses, and inspect receivables and profit without reconciling separate spreadsheets.
A global Indian financial-year context keeps lists, dashboards, reports, and customer statements aligned. The customer portal carries opening balances forward and gives each account a reconciled view of shipments, bills, dues, and payment requests.
The difficult work sits in correctness: concurrency-safe money mutations, tax rules shared across reports and accounting exports, server-authoritative bill status, and document generation that matches the forms the business already uses.