money.billable_xact_summary_location_view (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 |
|---|---|---|---|
id |
|
Yes |
|
usr |
|
Yes |
|
xact_start |
|
Yes |
|
xact_finish |
|
Yes |
|
total_paid |
|
Yes |
|
last_payment_ts |
|
Yes |
|
last_payment_note |
|
Yes |
|
last_payment_type |
|
Yes |
|
total_owed |
|
Yes |
|
last_billing_ts |
|
Yes |
|
last_billing_note |
|
Yes |
|
last_billing_type |
|
Yes |
|
balance_owed |
|
Yes |
|
xact_type |
|
Yes |
|
billing_location |
|
Yes |
View Definition
SELECT m.id,
m.usr,
m.xact_start,
m.xact_finish,
m.total_paid,
m.last_payment_ts,
m.last_payment_note,
m.last_payment_type,
m.total_owed,
m.last_billing_ts,
m.last_billing_note,
m.last_billing_type,
m.balance_owed,
m.xact_type,
COALESCE(c.circ_lib, g.billing_location, r.pickup_lib) AS billing_location
FROM money.materialized_billable_xact_summary m
LEFT JOIN action.circulation c ON c.id = m.id
LEFT JOIN money.grocery g ON g.id = m.id
LEFT JOIN booking.reservation r ON r.id = m.id;