Commit Graph
7 Commits
Author SHA1 Message Date
jimmyandClaude Opus 5.5 708ce8352e Add receipts, suppliers and a top navigation bar
Receipts and invoices: attach photos and PDFs to transactions, read the
supplier, date, total, GST and line items with Tesseract OCR, and match
them to bank transactions by amount and date. Receipts can have several
pages, and hand corrections survive re-reading.

Suppliers: saved suppliers that uploads are linked to by GST number or
name.

The sections (cashbook, receipts, invoices, customers, suppliers,
mileage, statements) move to a top bar, with the book controls in a row
beneath it, and the layout works on phones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 19:05:44 +13:00
jimmyandClaude Opus 5.5 177dfbc0a4 Add invoice generator and mileage logbook
Invoices: business details and logo, saved customers, numbering, GST per
line, PDF download (fpdf2), and marking paid, which records the income in
the book (split into Incl and Excl GST rows when an invoice has both) or
uses an already-imported bank deposit. Statement import treats a split
payment as the one bank line it came from.

Mileage: vehicles and trips with odometer readings, business or private
use, IRD kilometre rates entered per income year, a per-vehicle tier 1/2
claim and a CSV logbook export. Report only: nothing is added to the
cashbook or IR10.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 18:56:30 +13:00
jimmyandClaude Opus 5.5 4b3e5f0932 Move to FastAPI with accounts, SQLite books, export and tax returns
Storage and export
- Keep books and transactions in SQLite (data/cashbook.db) instead of
  .ods files; existing .ods books are migrated once at startup
- Export a book as the cashbook spreadsheet (.xlsx/.ods, built from the
  template via LibreOffice) or as CSV
- GST rounded per transaction to match the spreadsheet

Tax
- GST return page with IRD GST101A boxes 5-15 per six-monthly,
  two-monthly or monthly period, due dates, and a Zero-rated GST type
- Income tax page with IR10 (financial statements summary) and IR4
  (company return) boxes, from the cashbook plus year-end amounts typed
  in and saved per book

FastAPI and accounts (following led-editor)
- Replace the stdlib server with a FastAPI app (src/cashbook_app) run by
  uvicorn; dependencies in Pipfile
- Cookie sessions with bcrypt passwords, first-run admin setup or
  BOOTSTRAP_ADMIN_*, invites (link or email), sign-in throttling,
  password change that signs out other sessions
- Users page for administrators: rename, reset password, promote or
  demote, delete, list and revoke invites; last admin is protected
- Replaces the shared CASHBOOK_PASSWORD basic auth; AUTH_* settings in
  .env (see .env.example)
- Docker image uses a venv with system site packages for python3-uno
- pytest suite for auth, user management, imports, GST and tax figures

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 22:43:18 +13:00
jimmyandClaude Opus 5.5 17b48f25e8 Make login optional and fix 403 on changes
- CASHBOOK_PASSWORD is now optional; without it there's no login and
  the server logs a warning
- Origin check compares host names only, and also accepts
  X-Forwarded-Host and CASHBOOK_ALLOWED_HOSTS, so changes work when the
  app is reached by IP, on another port or through a proxy; refusals
  are logged with the reason and explained in the error
- Add a favicon so browsers stop requesting a missing /favicon.ico

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 17:41:01 +13:00
jimmyandClaude Opus 5.5 5dac554050 Drop container resource limits from compose
Newer Docker Compose rejects pids_limit alongside deploy.resources.limits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 17:29:15 +13:00
jimmyandClaude Opus 5.5 9b9203c4bb Make Docker Compose setup production-ready
- Require a login: HTTP Basic auth from CASHBOOK_PASSWORD (compose
  refuses to start without it); /healthz stays open for health checks
- Run as non-root (1000:1000 by default, CASHBOOK_USER to override)
  with a read-only filesystem, tmpfs /tmp, no capabilities,
  no-new-privileges, and CPU/memory/pid limits
- Health check, log rotation, configurable bind address and port
- Refuse cross-origin POSTs by matching Origin to Host (works behind a
  reverse proxy), cap request size, add security headers, and stop
  leaking exception text in 500 responses
- Make the extra statements mount opt-in; create the data folder at
  startup; document server setup and reverse proxying in the README

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 17:25:45 +13:00
jimmyandClaude Opus 5.5 971de14356 Add cashbook web app for importing ANZ statements
Local web app and CLI that fill a NZ cashbook spreadsheet (one sheet per
month, April-March) from ANZ CSV exports and PDF statements, via a
headless LibreOffice.

- Import with preview; duplicates matched on date and amount so CSV and
  PDF versions of the same period don't double up
- Statement upload (drag and drop), view, download, rename and remove,
  with per-book import status
- Month review with GST and category editing, year summary and
  six-monthly GST returns
- Docker Compose setup; books and statements live in data/ (ignored)
- Blank cashbook template (NZ Government, CC BY 4.0); code under AGPL-3.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 17:10:05 +13:00