Skip to content

feat(export): Sheet 3 List of Expenses feeding Sheet 2 actuals - #338

Merged
arutsh merged 3 commits into
mainfrom
Budget/feat/Issue-321/excel-export-group3
Sep 24, 2026
Merged

arutsh merged 3 commits into
mainfrom
Budget/feat/Issue-321/excel-export-group3

Conversation

@arutsh

@arutsh arutsh commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds Sheet 3 (List of Expenses): one row per report-line allocation, with its own conversion date, rate and converted amount. Any unallocated remainder gets a row at the budget's estimated rate, flagged with * and a footnote. Adds a Category column.
  • Sheet 2's expense and converted-expense columns are now SUMIFs over Sheet 3, matched on a hidden budget-line-id column. They replace the separate Python rollup (get_budget_line_expense_rollups / _compute_converted_expense, both removed), so the two sheets can't disagree. See design.md Decision 14.
  • Each expense's rows add up to its full amount, including refunds, zero amounts and over-allocation. Rates of 0 or below are treated as missing instead of producing #DIV/0!.

Test plan

  • pytest services/budget: 426 passed
  • New regression tests: refund, zero-amount expense, over-allocation, estimated rate of 0, conversion with a local amount of 0. The last two go through the real Sheet 3 writer.
  • black / mypy / flake8 clean on services/budget/app (pre-push hook)
  • Export a real budget with refunds and partial allocations, and check that Sheet 2 matches Sheet 3 in Excel/LibreOffice

🤖 Generated with Claude Code

Closes #321

arutsh and others added 2 commits September 24, 2026 17:58
…ce for Sheet 2 actuals

Sheet 2 and Sheet 3 computed the blended converted-expense figure two
different ways, so they could disagree. Build the expense row list once
and have Sheet 2 SUMIF Sheet 3 via a hidden budget-line-id column.
Unallocated remainders use the budget's estimated rate (flagged); refunds,
zero amounts and over-allocation keep their rows so each expense foots,
and zero/negative rates are treated as unusable to avoid #DIV/0!.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
grant-flow Ready Ready Preview Sep 24, 2026 5:09pm UTC

…ke CI

BudgetLineModel.category_id is UUID | None, so looking it up in a
UUID-keyed dict failed CI's mypy. Resolve it first and skip the lookup
when unset.

The pre-push hook didn't catch it because it ran mypy from the repo
root: there app.* imports don't resolve, and mypy.ini's
ignore_missing_imports turns them into Any, hiding cross-module type
errors in ai/budget/chat/users. It now runs black/mypy/flake8 from
services/<svc> against ./app, matching the CI workflows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@arutsh
arutsh merged commit 484cb5c into main Sep 24, 2026
27 of 29 checks passed
@arutsh
arutsh deleted the Budget/feat/Issue-321/excel-export-group3 branch September 24, 2026 17:11

This branch was successfully deployed

1 active deployment
Preview — 83030875 Deployed Sep 24, 2026 by vercel[bot]
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.

excel-export: Sheet 3 — List of Expenses with per-allocation sublines (group 3)

1 participant