feat(finance): XLSX + CSV + Tally exports (#99 pt.1)#102
Merged
Conversation
The most-demanded treasurer feature: financial reports the society's CA can
consume. Dependency-free and Cloudflare-Workers-safe.
- lib/xlsx.ts: a from-scratch .xlsx writer — real OOXML SpreadsheetML zipped
with STORED entries + a hand-rolled CRC32, so no Node-only zip/xlsx lib is
needed on Workers. Validated with `unzip -t` (CRC OK) and openpyxl-shaped
structure.
- shared/export.ts (pure): report -> table (rows in rupees) for trial balance,
I&E, balance sheet, R&P, and dues; a CSV serializer; and a Tally-import XML
builder (ledger masters + vouchers, debit negative / credit positive).
- API: ?format=xlsx|csv on /reports/{trial-balance,income-expenditure,
balance-sheet,receipts-payments} and /bills/dues; GET /reports/tally-export
streams Tally XML (PAYMENT->Receipt, EXPENSE->Payment, else Journal).
- Tests: xlsx zip structure + inline-string/number/escaping, CSV escaping,
Tally envelope/signing/masters, table shaping. Suite 359 green.
Print-ready statement PDFs + the invoice ₹-glyph fix are the next export PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
M3.5 · Task #99 (part 1) — XLSX / CSV / Tally exports
The most-demanded treasurer feature — financial reports a CA can consume. Dependency-free and Cloudflare-Workers-safe (no lockfile change).
Worker-safe XLSX writer (
lib/xlsx.ts)exceljs/SheetJS assume Node APIs, so I wrote a small from-scratch
.xlsxwriter: real OOXML SpreadsheetML zipped with STORED (uncompressed) entries + a hand-rolled CRC32 — no zip/deflate dependency. Validated locally withunzip -t(CRC OK, no errors) and structurally (all 6 OOXML parts).Export layer (
shared/export.ts, pure + tested)API
?format=xlsx|csvon/reports/{trial-balance,income-expenditure,balance-sheet,receipts-payments}and/bills/duesGET /reports/tally-export→ Tally XML (PAYMENT→Receipt, EXPENSE→Payment, else Journal), importable into TallyPrimeAcceptance
.xlsx(CRC-verified valid zip / OOXML) — recommend a real-Excel smoke test on deploy; pip/openpyxl is locked down in this sandbox.Tests
xlsx zip structure + inline-string/number/escaping; CSV escaping; Tally envelope/signing/masters; table shaping. Suite 359 green. No schema change.