internal tool to analyze equals money expense card transactions into a formatted excel for upload to work day accounting software using the EIB excel tool
Go to file
JasonFraser d0ebc3f995 Category subtotal headings + live formulas against embedded source sheets
Two changes, confirmed with the user via concrete preview mockups
before building (avoiding a third wrong guess on the subtotal
structure after the account-grouping change):

- Reverted subtotal/heading grouping from Account back to Category
  (bold subtotal row per category, sorted alphabetically; within a
  category, detail rows sorted by account number then strategic area
  then full project code). Account still shows as the full unsplit
  "code:name" string on every detail row - that part of the account
  change stays, only the grouping key reverted.

- The two uploaded trial balance files are now embedded as their own
  sheets ("Revenue TB", "Expense TB") in the generated workbook, and
  every Category Summary/Balance Sheet cell is a live formula against
  them rather than a precomputed number - directly modeled on
  "1. Summary (Manual)"/"Balance Sheet (FS)"'s own SUMIFS/SUMIF
  formulas:
  - Category Summary detail rows: SUMIFS matching Account+Category+
    Project against the embedded sheet (blank category/project use ""
    criteria, mirroring the template's ISBLANK(...) branches).
  - Balance Sheet lines: SUMIF per mapped account code, wildcard-
    matched ("<code>:*") since the sheet stores code+name together.
    Totals (Total Current Assets, Total Assets, etc.) are formulas
    summing the line-item cells above them, not baked-in numbers.
  - Unrestricted (Net Assets) adds a live cross-sheet reference to
    Category Summary's own Total Revenue/Total Expenses cells for the
    period's Net Income, instead of a Python-computed literal.
  All formulas use only SUM/SUMIF/SUMIFS - no Excel-only functions -
  so the workbook is Google Sheets compatible, not just Excel.

Verified far more rigorously than a cross-check against my own Python
computation this time: wrote a SUMIFS/SUMIF simulator that evaluates
every formula against the actual embedded sheet data (not a
side-channel recomputation), recursively resolving subtotals, grand
totals, and the Balance Sheet's cross-sheet reference. Every result
matches exactly: revenue 5,338,866.02 / expense 3,743,572.26 /
surplus 1,595,293.76 / balance_check 0.00.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-25 16:23:22 -04:00
app Category subtotal headings + live formulas against embedded source sheets 2026-08-25 16:23:22 -04:00
templates Add Financial Reports tool: Category Summary + Balance Sheet snapshot 2026-08-25 15:49:12 -04:00
.gitignore Add Financial Reports tool: Category Summary + Balance Sheet snapshot 2026-08-25 15:49:12 -04:00
CLAUDE.md Move merchant mapping to a bind-mounted CSV, add in-UI mapping flow 2026-08-19 11:55:43 -04:00
Dockerfile Initial commit: EIB processor tool with new landing page preview 2026-08-18 10:30:53 -04:00
README.md Move merchant mapping to a bind-mounted CSV, add in-UI mapping flow 2026-08-19 11:55:43 -04:00
docker-compose.yml Add Financial Reports tool: Category Summary + Balance Sheet snapshot 2026-08-25 15:49:12 -04:00
eib-processor_how-it-works.md Update docs for the template-population features 2026-08-18 16:13:58 -04:00
requirements.txt Initial commit: EIB processor tool with new landing page preview 2026-08-18 10:30:53 -04:00

README.md

Internal Tools

A small platform of internal tools for Planeterra International Foundation. Built by Undo Designs. Currently hosts one tool: the EIB Processor (Equals Money → Workday EIB transformer and statement auditor).

Quick start

docker compose up --build

Then open http://localhost:8081 for the tools landing page, or go straight to http://localhost:8081/eib/ for the EIB Processor.

Adding a new tool

Each tool lives in its own app/tools/<name>/ package with a Flask Blueprint (routes + a logic.py of Flask-free business logic) and its own templates/<name>/ folder. Register the blueprint and add an entry to the TOOLS list in app/main.py to get a card on the landing page.

EIB Processor — what it does

  1. Upload a raw Equals Money export (.xlsx)
  2. Optionally upload a combined card statement CSV for per-person audit
  3. Download the processed EIB Excel file

The audit table appears in the output file four columns after the last EIB column. Each person gets a single MATCHED / REVIEW REQUIRED status based on:

sum(EIB Converted Amount) == sum(statement Total debited for rows in EIB)

PDF statement audit (Docling)

The Docling container starts automatically with Docker Compose. Once it's healthy (check the badge in the top-right of the UI), you can upload a PDF statement instead of the CSV.

PDF parsing extracts the opening/closing balance summary from page 1 of the Equals statement. The Docling health check takes ~60s on first start.

Adding new merchants

If the processor reports unmapped merchants, the result panel lets you type a clean name for each one right there and continue processing immediately — no code changes or restarts needed.

The mappings live in app/tools/eib/merchant_lookup.csv (bind-mounted, so edits — from the UI or by hand — take effect on the next run with no rebuild). Editing it directly works too: it's a plain two-column CSV (raw_description,clean_name).

Services

Service Port Description
app 8081 Flask web app (tools platform)
docling 5001 Docling PDF parsing service

Volumes

  • ./uploads/ — temporary uploaded files
  • ./outputs/ — generated EIB Excel files