Skip to content

Show invoice amount and balance on the account invoices page - #681

Draft
tungleduyxyz wants to merge 1 commit into
masterfrom
invoice-amount-balance-678
Draft

tungleduyxyz wants to merge 1 commit into
masterfrom
invoice-amount-balance-678

Conversation

@tungleduyxyz

Copy link
Copy Markdown
Contributor

Summary

Fixes #678. The paginated account invoices API returns shallow invoices, so Amount and Balance were not usable. This uses the new includeInvoiceComponents option, which loads the components for the invoices of the requested page only, so the cost depends on the page size, not on the account's invoice count.

  • Edit Columns: amount and balance are listed like the other columns (hidden by default, so default behavior and DEFAULT_VISIBLE_COLUMNS are unchanged).
  • Skips the extra work when hidden: the table only sends include_invoice_components=true when Amount or Balance is visible, and reloads the current page when one of them is turned on.
  • CSV: the download requests components when amount/balance are exported (or all fields), so the export matches the UI.
  • Sorting needed no change: it is already done in memory on the loaded page.

Draft: blocked on releases

This calls paginated_invoices with the new argument, so it needs a killbill-client release (and a Gemfile.lock bump) before it can pass CI/merge.

Testing

Added controller tests (flag plumbing with a stubbed API; column list and default visibility). I could not run the functional tests locally: they need a Kill Bill server. The UI behavior (column toggle reload) is untested in a browser.

🤖 Generated with Claude Code

The paginated account invoices API returns shallow invoices, so amount and
balance were not usable. Kill Bill can now load the invoice components for
the invoices of the requested page only (includeInvoiceComponents).

- List Amount and Balance in Edit Columns (hidden by default)
- Only ask for the components when one of these columns is visible, and
  reload the page when one of them is turned on
- CSV download requests them when amount/balance are exported, so the
  export matches what the UI displays

Requires killbill/killbill#2334 and killbill/killbill-client-ruby#128.

Closes #678

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

Show invoice amount and balance on the account invoices page without losing pagination

1 participant