Skip to content

feat(finance): statutory financial statements (#98)#101

Merged
ankitsejwal merged 1 commit into
mainfrom
feat/m3.5-statements
Jul 16, 2026
Merged

feat(finance): statutory financial statements (#98)#101
ankitsejwal merged 1 commit into
mainfrom
feat/m3.5-statements

Conversation

@ankitsejwal

Copy link
Copy Markdown
Member

M3.5 · Task #98 — Statutory statements (backend)

The statutory deliverable — Trial Balance, Income & Expenditure, Balance Sheet, Receipts & Payments — derived purely off the general ledger (design §8). This is the single biggest gap vs benchmark apps and the reason the app can be a society's system of record (Rule 62, MCS Rules 1961).

Domain (shared/statements.ts, pure + unit-tested)

  • Trial Balance — each account's net in its debit/credit column; nets to zero (proves integrity).
  • Income & Expenditure (accrual) — income vs expenditure, surplus; mutual (exempt) vs non-mutual (taxable) split for ITR-5.
  • Balance Sheet (as-of) — assets vs liabilities + funds + current surplus; balances by construction (Σdebit = Σcredit).
  • Receipts & Payments (cash) — groups the contra legs of cash/bank entries into money-in vs money-out, with opening + closing.

API (/reports/*, ADMIN, ?fromDate&toDate)

/trial-balance, /income-expenditure, /balance-sheet, /receipts-payments. accountBalances aggregates journal_lines over the entry-date window.

Acceptance

  • ✅ All four generate for an arbitrary period; Balance Sheet balances, Trial Balance nets to zero (verified on a balanced mini-ledger).
  • ✅ R&P (cash) and I&E (accrual) produce different, correct figures.
  • ✅ Mutual/taxable income split present.

Tests / notes

Unit tests on a genuinely balanced ledger (TB=0, BS balances, I&E surplus + split, R&P separation) + route auth tests. Suite 349 green. Web reports.tsx rendering + account drill-down land in the M3.5 admin-UI pass; Maharashtra Rule-62-strict formatting deferred (generic first, design §9.6). No schema change.

Trial Balance, Income & Expenditure, Balance Sheet, and Receipts & Payments —
derived purely off the ledger (design §8). The statutory deliverable (Rule 62
MCS Rules) that lets the app be a society's system of record.

- shared/statements.ts (pure, unit-tested): trialBalance (nets to zero),
  incomeExpenditure (accrual; surplus + mutual/taxable split for ITR-5),
  balanceSheet (assets vs liabilities+funds+current surplus; balances by
  construction), receiptsAndPayments (cash basis via contra legs of cash/bank
  entries, opening+closing).
- API (reports.ts, ADMIN): /reports/trial-balance, /income-expenditure,
  /balance-sheet, /receipts-payments — all ?fromDate&toDate. accountBalances
  aggregates journal_lines over the entry-date window.
- Tests on a genuinely balanced mini-ledger: TB nets to zero, BS balances, I&E
  surplus + mutual split, R&P separates receipts/payments; + route auth tests.
  Suite 349 green.

Web reports.tsx rendering + drill-down land in the M3.5 admin-UI pass.
Maharashtra Rule-62-strict formatting deferred (generic mode first, design §9.6).
@ankitsejwal
ankitsejwal merged commit 079bffb into main Jul 16, 2026
1 check passed
@ankitsejwal
ankitsejwal deleted the feat/m3.5-statements branch July 16, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant