money.transaction_billing_with_void_summary (view)

This is a database view, not a base table. It has no triggers, indexes, or FK constraints of its own. Querying this view may be more efficient than joining the underlying tables directly.

Columns

Column Type Nullable Notes

xact

bigint

Yes

last_billing_type

text

Yes

last_billing_note

text

Yes

last_billing_ts

timestamp with time zone

Yes

total_owed

numeric

Yes

View Definition

 SELECT billing.xact,
    last(billing.billing_type) AS last_billing_type,
    last(billing.note) AS last_billing_note,
    max(billing.billing_ts) AS last_billing_ts,
    sum(
        CASE
            WHEN billing.voided THEN 0::numeric
            ELSE COALESCE(billing.amount, 0::numeric)
        END) AS total_owed
   FROM money.billing
  GROUP BY billing.xact
  ORDER BY (max(billing.billing_ts));