money.transaction_payment_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_payment_type

name

Yes

last_payment_note

text

Yes

last_payment_ts

timestamp with time zone

Yes

total_paid

numeric

Yes

View Definition

 SELECT payment_view.xact,
    last(payment_view.payment_type) AS last_payment_type,
    last(payment_view.note) AS last_payment_note,
    max(payment_view.payment_ts) AS last_payment_ts,
    sum(
        CASE
            WHEN payment_view.voided THEN 0::numeric
            ELSE COALESCE(payment_view.amount, 0::numeric)
        END) AS total_paid
   FROM money.payment_view
  GROUP BY payment_view.xact
  ORDER BY (max(payment_view.payment_ts));