From 6e97a567b6e830e294ef024c76857ce1a2d60296 Mon Sep 17 00:00:00 2001 From: Victoria Lewis Date: Fri, 24 Jul 2015 15:08:15 -0700 Subject: [PATCH] webstaff: LP#1436980 Total Circulations in Patron Bills Add code to display Total Circulations in Item Summary on Bills page. Signed-off-by: Victoria Lewis Signed-off-by: Mike Rylander --- Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2 | 2 +- Open-ILS/web/js/ui/default/staff/circ/patron/bills.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2 index 059153b500..9e83fe3949 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_xact_details.tt2 @@ -100,7 +100,7 @@
[% l('Total Circulations') %]
- TODO + {{total_circs}}
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 2c7d18d419..9f1b29b17a 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 @@ -587,6 +587,16 @@ function($scope, $q , $routeParams , egCore , egGridDataProvider , patronSvc , egBilling.fetchXact(xact_id).then(function(xact) { $scope.xact = xact; + var copyId = xact.circulation().target_copy().id(); + var circ_count = 0; + egCore.pcrud.search('circbyyr', + {copy : copyId}, null, {atomic : true}) + .then(function(counts) { + angular.forEach(counts, function(count) { + circ_count += Number(count.count()); + }); + $scope.total_circs = circ_count; + }); // set the title. only needs to be done on initial page load if (xact.circulation()) { if (xact.circulation().target_copy().call_number().id() == -1) { -- 2.11.0