money.open_transaction_billing_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 |
|
Yes |
|
last_billing_type |
|
Yes |
|
last_billing_note |
|
Yes |
|
last_billing_ts |
|
Yes |
|
total_owed |
|
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(COALESCE(billing.amount, 0::numeric)) AS total_owed
FROM money.billing
WHERE billing.voided IS FALSE
GROUP BY billing.xact
ORDER BY (max(billing.billing_ts));