From 933edf33269f87d1245fc270819a6294ef048ab5 Mon Sep 17 00:00:00 2001 From: phasefx Date: Wed, 30 Sep 2009 17:30:14 +0000 Subject: [PATCH] dedicated fields for Total Circs - Current Year and Previous Field in alternate item details interface git-svn-id: svn://svn.open-ils.org/ILS/trunk@14225 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/server/circ/alternate_copy_summary.js | 8 +++++++- .../xul/staff_client/server/circ/alternate_copy_summary.xul | 12 ++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js index c1fa411b0c..e5c1436d00 100644 --- a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js +++ b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js @@ -121,6 +121,8 @@ function load_item() { set("circulations", ''); set("total_circ_count", ''); set_tooltip("total_circ_count", ''); + set("total_circ_count_prev_year", ''); + set("total_circ_count_curr_year", ''); set("holds", ''); if (details.copy) { @@ -163,9 +165,13 @@ function load_item() { for (var i = 0; i < r.length; i++) { total += Number( r[i].count() ); if (typeof year[ r[i].year() ] == 'undefined') year[ r[i].year() ] = 0; - year[ r[i].year() ] += r[i].count(); // Add original circs and renewals together + year[ r[i].year() ] += Number( r[i].count() ); // Add original circs and renewals together } set( 'total_circ_count', total ); + var curr_year = (new Date()).getFullYear(); + var prev_year = curr_year - 1; + set( 'total_circ_count_curr_year', year[ curr_year ] || 0 ); + set( 'total_circ_count_prev_year', year[ prev_year ] || 0 ); var keys = []; for (var i in year) { keys.push( i ); }; keys.sort(); for (var i = 0; i < keys.length; i++) { tooltip += document.getElementById('circStrings').getFormattedString( diff --git a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul index 60ecf3d379..b158c33ba6 100644 --- a/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul +++ b/Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul @@ -122,8 +122,8 @@