</actions>
</permacrud>
</class>
+ <class id="mowbus" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::open_with_balance_user_summary" oils_persist:tablename="money.open_with_balance_usr_summary" reporter:label="Open User Summary for transactions with balances">
+ <fields oils_persist:primary="usr" oils_persist:sequence="">
+ <field name="balance_owed" reporter:datatype="money" />
+ <field name="total_owed" reporter:datatype="money" />
+ <field name="total_paid" reporter:datatype="money" />
+ <field name="usr" reporter:datatype="link"/>
+ </fields>
+ <links>
+ <link field="usr" reltype="has_a" key="id" map="" class="au"/>
+ </links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <retrieve permission="VIEW_USER">
+ <context link="usr" field="home_ou"/>
+ </retrieve>
+ </actions>
+ </permacrud>
+ </class>
<class id="mct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="money::collections_tracker" oils_persist:tablename="money.collections_tracker" reporter:label="Collections Tracker">
<fields oils_persist:primary="id" oils_persist:sequence="money.collections_tracker_id_seq">
<field name="collector" />
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 /;
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,
--- /dev/null
+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;
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';
// 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})
}