From 4978ead0608a0c45a7e0f0c77380d0548a80e1e1 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Thu, 25 Jul 2013 11:47:21 -0400 Subject: [PATCH] Fixing LP#1203734 - "Show Last Few Circulations" interface not counting archived circulations. 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 --- .../lib/OpenILS/Application/Storage/CDBI/action.pm | 14 ++++++++++++++ .../lib/OpenILS/Application/Storage/Driver/Pg/dbi.pm | 6 ++++++ .../lib/OpenILS/Application/Storage/Publisher/asset.pm | 4 ++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/action.pm index e46b0fb632..6d8b1d3845 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/action.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/action.pm @@ -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/); #------------------------------------------------------------------------------- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/dbi.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/dbi.pm index 59f72f5c6d..dacb264489 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/dbi.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/dbi.pm @@ -185,6 +185,12 @@ 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' ); diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/asset.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/asset.pm index 4dc3e47cb1..74bd535d39 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/asset.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/asset.pm @@ -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', -- 2.11.0