From: miker Date: Thu, 21 Jul 2005 15:48:50 +0000 (+0000) Subject: adding "last_billing_note" to transaction summary view X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=68aafd67b64ced2db9f1e6963d9011e126f66210;p=Evergreen.git adding "last_billing_note" to transaction summary view git-svn-id: svn://svn.open-ils.org/ILS/trunk@1335 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm index 2fc3eaaf7c..32c2568e10 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm @@ -34,7 +34,7 @@ __PACKAGE__->table('money_billable_transaction_summary'); __PACKAGE__->columns(Primary => 'id'); __PACKAGE__->columns(Essential => qw/xact_start usr xact_finish total_paid last_payment_ts total_owed last_billing_ts - balance_owed xact_type/); + balance_owed xact_type last_billing_note/); #------------------------------------------------------------------------------- package money::billing; diff --git a/Open-ILS/src/sql/Postgres/080.schema.money.sql b/Open-ILS/src/sql/Postgres/080.schema.money.sql index bff25d42ed..2328c33e41 100644 --- a/Open-ILS/src/sql/Postgres/080.schema.money.sql +++ b/Open-ILS/src/sql/Postgres/080.schema.money.sql @@ -41,6 +41,7 @@ CREATE OR REPLACE VIEW money.billable_xact_summary AS MAX(credit.payment_ts) AS last_payment_ts, SUM(COALESCE(debit.amount,0)) AS total_owed, MAX(debit.billing_ts) AS last_billing_ts, + COALESCE(debit.note,'') AS last_billing_note, SUM(COALESCE(debit.amount,0) - COALESCE(credit.amount,0)) AS balance_owed, p.relname AS xact_type FROM money.billable_xact xact @@ -48,7 +49,7 @@ CREATE OR REPLACE VIEW money.billable_xact_summary AS LEFT JOIN money.billing debit ON (xact.id = debit.xact AND debit.voided IS FALSE) LEFT JOIN money.payment credit ON (xact.id = credit.xact AND credit.voided IS FALSE) WHERE xact.xact_finish IS NULL - GROUP BY 1,2,3,4,10; + GROUP BY 1,2,3,4,9,11; CREATE OR REPLACE VIEW money.usr_summary AS SELECT usr,