reporter.xact_billing_totals (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

unvoided

numeric

Yes

voided

numeric

Yes

total

numeric

Yes

View Definition

 SELECT b.xact,
    sum(
        CASE
            WHEN b.voided THEN 0::numeric
            ELSE b.amount
        END) AS unvoided,
    sum(
        CASE
            WHEN b.voided THEN b.amount
            ELSE 0::numeric
        END) AS voided,
    sum(b.amount) AS total
   FROM money.billing b
  GROUP BY b.xact;