Skip to content

Billing 0.7.4: Print pages and billing emails no longer crash

Billing 0.7.4 fixes the printable invoice, receipt, credit note and payment confirmation pages, which crashed on every visit, and the billing email functions that failed the same way.

The print pages and the invoice page’s reload after an action read the customer’s email without loading the customer first, so every visit ended in an error. The eight functions that send billing emails had the same gap. All of them now load the customer.

The credit note and payment confirmation print pages also never opened at all, because they looked for the invoice under the wrong name in the address. They now open from their links on the invoice page.

Full release notes: Billing 0.7.4

0.7.4 · 17 August 2026

Fixed

  • Billing print views (InvoicePrint, ReceiptPrint, CreditNotePrint, PaymentConfirmationPrint) and InvoiceDetail.Actions.reload_invoice/1 never preloaded :user, but their templates read @invoice.user.email — KeyError: key :email not found in: #Ecto.Association.NotLoaded<...> on every visit. All 8 public send_*_email/2,3 functions in PhoenixKitBilling had the same gap in their own ensure_preloaded/2 call. Fixed by adding :user to every preload list that feeds one of these reads (#22).
  • CreditNotePrint and PaymentConfirmationPrint never mounted: their do_mount pattern-matched on "id", but the registered route binds :invoice_uuid (#22).
  • Paths.payment_confirmation/2 built .../invoices/:id/payment/:txn_uuid instead of the registered .../payment-confirmation/:txn_uuid — same bug class as the route-param fix above, in the one file PR #22 didn’t touch. Currently unreferenced by any call site, so it never 404’d in practice.

Billing 0.7.4. Install or update: {:phoenix_kit_billing, "~> 0.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.