PhoenixKit.Modules.Billing.Web.InvoiceDetail.Helpers (phoenix_kit v1.7.71)

Copy Markdown View Source

Helper functions for the invoice detail LiveView.

Contains timeline building, history parsing, formatting, and other template-callable utilities.

Summary

Functions

Builds a sorted timeline of all invoice events. Returns a list of %TimelineEvent{} structs sorted by datetime.

Formats payment method name for display.

Checks if invoice is fully refunded.

Gets credit note send history from transaction metadata.

Gets the default email address from invoice billing details or user.

Gets receipt send history from invoice receipt_data.

Gets send history from invoice metadata.

Parses ISO8601 datetime string to DateTime.

Functions

build_timeline_events(invoice, transactions)

Builds a sorted timeline of all invoice events. Returns a list of %TimelineEvent{} structs sorted by datetime.

format_payment_method_name(other)

Formats payment method name for display.

fully_refunded?(invoice, transactions)

Checks if invoice is fully refunded.

get_credit_note_send_history(transaction)

Gets credit note send history from transaction metadata.

get_default_email(invoice)

Gets the default email address from invoice billing details or user.

get_receipt_send_history(invoice)

Gets receipt send history from invoice receipt_data.

get_send_history(invoice)

Gets send history from invoice metadata.

parse_datetime(datetime_string)

Parses ISO8601 datetime string to DateTime.