[open-ils-commits] [GIT] Evergreen ILS branch rel_3_0 updated. 509d9a3617797a32a288d75aab10a897e069a898

Evergreen Git git at git.evergreen-ils.org
Mon Apr 30 11:24:15 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_0 has been updated
       via  509d9a3617797a32a288d75aab10a897e069a898 (commit)
      from  ecb4bc828e622d3a080c1cc6c8802380a743f3e0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 509d9a3617797a32a288d75aab10a897e069a898
Author: Chris Sharp <csharp at georgialibraries.org>
Date:   Tue Apr 10 11:40:35 2018 -0400

    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 <csharp at georgialibraries.org>
    Signed-off-by: Jeff Davis <jdavis at sitka.bclibraries.ca>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

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 bf892cd..88fa018 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
@@ -800,15 +800,29 @@ function($scope , $q , $location , $routeParams , $timeout , $window , egCore ,
                 return c.year() == new Date().getFullYear();
             });
 
-            $scope.total_circs_this_year = 
-                this_year.length ? this_year[0].count() : 0;
+            $scope.total_circs_this_year = (function() {
+                total = 0;
+                if (this_year.length == 2) {
+                    total = (Number(this_year[0].count()) + Number(this_year[1].count()));
+                } else if (this_year.length == 1) {
+                    total = Number(this_year[0].count());
+                }
+                return total;
+            })();
 
             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;
+            $scope.total_circs_prev_year = (function() {
+                total = 0;
+                if (prev_year.length == 2) {
+                    total = (Number(prev_year[0].count()) + Number(prev_year[1].count()));
+                } else if (prev_year.length == 1) {
+                    total = Number(prev_year[0].count());
+                }
+                return total;
+            })();
 
         });
     }

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/web/js/ui/default/staff/cat/item/app.js |   22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list