From: Chris Sharp Date: Tue, 10 Apr 2018 15:40:35 +0000 (-0400) Subject: LP#1746300: Fix circulation counts in Item Status Details X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b4eac90df0ce2923ce5611f66fc645f933d74a94;p=evergreen%2Fpines.git LP#1746300: Fix circulation counts in Item Status Details Currently, the "Total Circs -Current Year" and "Total Circs - Prev Year" numbers are seemingly randomly incorrect. This is caused by pulling the numbers from the "circbyyr" fieldmapper object, which results in an array of 2 rows (one for renewals and one for new circs). The current JS only displays the count for the first item in the array, ignoring the other. This branch totals the two, resulting in the right result for each year's circulations. Signed-off-by: Chris Sharp --- diff --git a/Open-ILS/web/js/ui/default/staff/cat/item/app.js b/Open-ILS/web/js/ui/default/staff/cat/item/app.js index 8d161de08b..33e5358112 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/item/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/item/app.js @@ -790,14 +790,14 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore , }); $scope.total_circs_this_year = - this_year.length ? this_year[0].count() : 0; + this_year.length ? (Number(this_year[0].count()) + Number(this_year[1].count())) : 0; var prev_year = counts.filter(function(c) { return c.year() == new Date().getFullYear() - 1; }); $scope.total_circs_prev_year = - prev_year.length ? prev_year[0].count() : 0; + prev_year.length ? (Number(prev_year[0].count()) + Number(prev_year[1].count())) : 0; }); }