Skip to content

Grant admin: show included reimbursements on changelist#4599

Merged
estyxx merged 2 commits intomainfrom
grants/admin-included-reimbursements-list
Apr 7, 2026
Merged

Grant admin: show included reimbursements on changelist#4599
estyxx merged 2 commits intomainfrom
grants/admin-included-reimbursements-list

Conversation

@estyxx
Copy link
Copy Markdown
Member

@estyxx estyxx commented Apr 7, 2026

Summary

Adds an Included reimbursements column to the Grant admin list view (GrantAdmin changelist). Each row lists linked GrantReimbursement lines as category name: amount, next to the existing Total column.

Why

Staff reviewing confirmed/approved grants (e.g. filtered changelist) can see which reimbursement categories are included without opening every grant detail page.

Notes

  • Reuses the existing approved_amounts_display method; it was previously defined but not in list_display.
  • get_queryset already prefetches reimbursements__category, so this should not add N+1 queries.
  • Shows an em dash when a grant has no reimbursement rows.

Add the existing approved_amounts_display column to list_display so
staff can see category names and amounts next to the total without
opening each grant. Empty grants show an em dash.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 2026

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

Project Deployment Actions Updated (UTC)
pycon Error Error Apr 7, 2026 0:35am

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 7, 2026

Adds an Included reimbursements column to the GrantAdmin changelist, showing linked GrantReimbursement lines as category: amount with an em-dash fallback. The prefetch for reimbursements__category is already in get_queryset, so no N+1 concern.

Issues

Precision loss on monetary amountstotal_amount_display was changed from :.2f to :.0f, and approved_amounts_display also uses :.0f. This silently rounds grant amounts (e.g. 150.50 → 150), which can be misleading for financial data. Unless grants are always whole-number amounts by policy, these should stay as :.2f or at minimum the rounding behaviour should be intentional and documented.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.51%. Comparing base (62df6d5) to head (5818625).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4599   +/-   ##
=======================================
  Coverage   92.51%   92.51%           
=======================================
  Files         359      359           
  Lines       10764    10764           
  Branches      814      814           
=======================================
  Hits         9958     9958           
  Misses        696      696           
  Partials      110      110           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Use :.0f for Total and each reimbursement line so the changelist matches
granted_amount (decimal_places=0) and avoids 100.00 vs 100 mismatch.
@estyxx estyxx merged commit b50007d into main Apr 7, 2026
7 of 8 checks passed
@estyxx estyxx deleted the grants/admin-included-reimbursements-list branch April 7, 2026 12:34
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