From: Mike Rylander Date: Thu, 30 Jul 2020 15:48:46 +0000 (-0400) Subject: LP#1772955: Only include xacts with balance in summary X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1492b6f109504d361e4b978d821fbee25118d7c2;p=working%2FEvergreen.git LP#1772955: Only include xacts with balance in summary This commit adds a new view and IDL definition that shows the total owed/paid/balance for transactions that have a balance other than 0. This new view is used in the patron summary bar, and access is provided wherever the all-open-transactions version is available in case we want to move to the new one elsewhere. Signed-off-by: Mike Rylander Signed-off-by: Ruth Frasur Signed-off-by: Jason Boyer --- diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index a312c105ef..b00330cf3f 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -3411,6 +3411,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/Configure.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/Configure.pm index 351a129643..2b1f24fcc6 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/Configure.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/Configure.pm @@ -25,7 +25,7 @@ sub fieldmapper { asv asva asvr asvq circ ccs ahn bre mrd crcd crmf crrf mbts aoc aus - mous mobts mb ancc cnct cnal + mous mowbus mobts mb ancc cnct cnal /; my @reports = qw/ perm_ex ex ao aou aout /; diff --git a/Open-ILS/src/sql/Pg/500.view.cross-schema.sql b/Open-ILS/src/sql/Pg/500.view.cross-schema.sql index 2dd3592b52..158e1519e8 100644 --- a/Open-ILS/src/sql/Pg/500.view.cross-schema.sql +++ b/Open-ILS/src/sql/Pg/500.view.cross-schema.sql @@ -39,6 +39,16 @@ CREATE OR REPLACE VIEW money.open_usr_summary AS WHERE xact_finish IS NULL GROUP BY usr; +CREATE OR REPLACE VIEW money.open_with_balance_usr_summary AS + SELECT + usr, + sum(total_paid) AS total_paid, + sum(total_owed) AS total_owed, + sum(balance_owed) AS balance_owed + FROM money.materialized_billable_xact_summary + WHERE xact_finish IS NULL AND balance_owed <> 0.0 + GROUP BY usr; + CREATE OR REPLACE VIEW money.open_usr_circulation_summary AS SELECT usr, diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.open_with_balance_usr_summary.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.open_with_balance_usr_summary.sql new file mode 100644 index 0000000000..48ef5982ad --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.open_with_balance_usr_summary.sql @@ -0,0 +1,15 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +CREATE OR REPLACE VIEW money.open_with_balance_usr_summary AS + SELECT + usr, + sum(total_paid) AS total_paid, + sum(total_owed) AS total_owed, + sum(balance_owed) AS balance_owed + FROM money.materialized_billable_xact_summary + WHERE xact_finish IS NULL AND balance_owed <> 0.0 + GROUP BY usr; + +COMMIT; diff --git a/Open-ILS/web/js/dojo/fieldmapper/Fieldmapper.js b/Open-ILS/web/js/dojo/fieldmapper/Fieldmapper.js index 3ef0ad9d05..9e9f4b5df1 100644 --- a/Open-ILS/web/js/dojo/fieldmapper/Fieldmapper.js +++ b/Open-ILS/web/js/dojo/fieldmapper/Fieldmapper.js @@ -356,6 +356,7 @@ if(!dojo._hasResource["fieldmapper.Fieldmapper"]){ fieldmapper.cblvl.Identifier = 'code'; fieldmapper.clfm.Identifier = 'code'; fieldmapper.mous.Identifier = 'usr'; + fieldmapper.mowbus.Identifier = 'usr'; fieldmapper.moucs.Identifier = 'usr'; fieldmapper.mucs.Identifier = 'usr'; fieldmapper.mus.Identifier = 'usr'; diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js index f9a6d66700..011e553c9e 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/bills.js @@ -24,7 +24,7 @@ function($q , egCore , egWorkLog , patronSvc) { // user billing summary service.fetchSummary = function() { return egCore.pcrud.retrieve( - 'mous', service.userId, {}, {authoritative : true}) + 'mowbus', service.userId, {}, {authoritative : true}) .then(function(summary) {return service.summary = summary}) }