Fixing LP#1203734 - "Show Last Few Circulations" interface not counting archived... user/csharp/fix_show_last_few_circulations_circ_count
authorChris Sharp <csharp@georgialibraries.org>
Thu, 25 Jul 2013 15:47:21 +0000 (11:47 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Thu, 25 Jul 2013 15:47:21 +0000 (11:47 -0400)
open-ils.storage.asset.copy.circ_count was only pulling information from
action.circulation.  This changes that table to action.all_circulation instead.
It does not factor values in extend_reporter.legacy_circ_count.

Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/action.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/dbi.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/asset.pm

index e46b0fb..6d8b1d3 100644 (file)
@@ -70,6 +70,20 @@ __PACKAGE__->columns(Essential => qw/xact_start usr target_copy circ_lib
                      checkin_staff circ_staff circ_lib checkin_lib
                      stop_fines_time checkin_time desk_renewal
                      phone_renewal create_time copy_location/);
+#-------------------------------------------------------------------------------
+
+package action::all_circulation;
+use base qw/action/;
+__PACKAGE__->table('action_all_circulation');
+__PACKAGE__->columns(Primary => 'id');
+__PACKAGE__->columns(Essential => qw/xact_start target_copy circ_lib
+                     duration duration_rule renewal_remaining grace_period
+                     recurring_fine_rule recurring_fine stop_fines
+                     max_fine max_fine_rule fine_interval
+                     stop_fines xact_finish due_date opac_renewal
+                     checkin_staff circ_staff circ_lib checkin_lib
+                     stop_fines_time checkin_time desk_renewal
+                     phone_renewal create_time copy_location/);
 
 #-------------------------------------------------------------------------------
 
index 59f72f5..dacb264 100644 (file)
     action::circulation->sequence( 'money.billable_xact_id_seq' );
 
     #---------------------------------------------------------------------
+    package action::all_circulation;
+
+    action::all_circulation->table( 'action.all_circulation' );
+
+
+    #---------------------------------------------------------------------
     package booking::resource_type;
     
     booking::resource_type->table( 'booking.resource_type' );
index 4dc3e47..74bd535 100644 (file)
@@ -19,7 +19,7 @@ sub circ_count {
     my $copy = shift;
     my $granularity = shift;
 
-    my $c_table = action::circulation->table;
+    my $c_table = action::all_circulation->table;
 
     if (lc($granularity) eq 'year') {
         $granularity = ", to_char(xact_start, 'YYYY') as when";
@@ -44,7 +44,7 @@ sub circ_count {
 
     $log->debug("Circ count SQL [$SQL]", DEBUG);
 
-    return action::circulation->db_Main->selectall_hashref($SQL, 'when', {}, $copy);
+    return action::all_circulation->db_Main->selectall_hashref($SQL, 'when', {}, $copy);
 }
 __PACKAGE__->register_method(
     method      => 'circ_count',