dedicated fields for Total Circs - Current Year and Previous Field in alternate item...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 30 Sep 2009 17:30:14 +0000 (17:30 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 30 Sep 2009 17:30:14 +0000 (17:30 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14225 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js
Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.xul

index c1fa411..e5c1436 100644 (file)
@@ -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( 
index 60ecf3d..b158c33 100644 (file)
                                 <textbox name="date_created" readonly="true" context="clipboard"/>
                                 <label value="Reference" />
                                 <textbox name="reference" readonly="true" context="clipboard"/>
-                                <label value="Pub Date" />
-                                <textbox name="pubdate" readonly="true" context="clipboard"/>
+                                <label value="Total Circs" />
+                                <textbox name="total_circ_count" readonly="true" context="clipboard"/>
                                 <label value="Checkout Library" />
                                 <textbox name="circ_circ_lib" readonly="true" context="clipboard"/>
                             </row>
                                 <textbox name="copy_id" readonly="true" context="clipboard"/>
                                 <label value="OPAC Visible" />
                                 <textbox name="opac_visible" readonly="true" context="clipboard"/>
-                                <label value="Edition" />
-                                <textbox name="edition" readonly="true" context="clipboard"/>
+                                <label value="Total Circs - Current Year" />
+                                <textbox name="total_circ_count_curr_year" readonly="true" context="clipboard"/>
                                 <label value="Checkin Time" />
                                 <textbox name="checkin_time" readonly="true" context="clipboard"/>
                             </row>
                                 <textbox name="tcn" readonly="true" context="clipboard"/>
                                 <label value="Holdable" />
                                 <textbox name="holdable" readonly="true" context="clipboard"/>
-                                <label value="Total Circs" />
-                                <textbox name="total_circ_count" readonly="true" context="clipboard"/>
+                                <label value="Total Circs - Prev Year" />
+                                <textbox name="total_circ_count_prev_year" readonly="true" context="clipboard"/>
                                 <label value="Checkin Scan Time" />
                                 <textbox name="checkin_scan_time" readonly="true" context="clipboard"/>
                             </row>