Skip to content

feat(presentation_group_keys): Display presentation breakdowns in invoices#5529

Open
tiagolupepic wants to merge 13 commits into
mainfrom
feat/presentation-breakdowns-in-pdf-invoices
Open

feat(presentation_group_keys): Display presentation breakdowns in invoices#5529
tiagolupepic wants to merge 13 commits into
mainfrom
feat/presentation-breakdowns-in-pdf-invoices

Conversation

@tiagolupepic
Copy link
Copy Markdown
Contributor

This commit changes the invoice slim templates to also display presentation breakdowns

Continuing the epic of presentation_group_keys, we're changing the templates to also include
the presentation breakdowns.
The main difference of API and GraphQL response and the presentation breakdowns displayed in invoice
is a new method. We're adding the Charge#presentation_group_keys_values_displayed_in_invoice to return the keys
that should be displayed in invoice.

In the invoice perspective, we're filtering the breakdowns and then displaying them.

We're also doing some small refactors:

  • Adding FeeDisplayHelper.fee_title to use around when we need to display the title of each fee.
  • InvoiceSubscriptionsHelper to wrap the logic of loading fees for subscriptions instead of having in the view

@tiagolupepic tiagolupepic changed the title feat(presentation_group_keys) Display presentation breakdowns in invoices feat(presentation_group_keys): Display presentation breakdowns in invoices May 18, 2026
Copy link
Copy Markdown
Collaborator

@vincent-pochet vincent-pochet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

- if applied_invoice_custom_sections.present?
== SlimHelper.render('templates/invoices/v4/_custom_sections', self)

== SlimHelper.render('templates/invoices/v4/_presentation_breakdowns', self, fees: fees.includes(:presentation_breakdowns))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
== SlimHelper.render('templates/invoices/v4/_presentation_breakdowns', self, fees: fees.includes(:presentation_breakdowns))
== SlimHelper.render('templates/invoices/v4/_presentation_breakdowns', self, fees: fees.includes(:presentation_breakdowns, :charge, :charge_filter))

to avoid N+1

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.

3 participants