From 64b2a7d85c08eaa2829308c6ec6340c06b4a344b Mon Sep 17 00:00:00 2001 From: erickson Date: Sat, 16 Sep 2006 17:02:23 +0000 Subject: [PATCH] fixed the due_date method to always return due date if any open circ exists added some logging git-svn-id: svn://svn.open-ils.org/ILS/trunk@6125 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/SIP/Item.pm | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/SIP/Item.pm b/Open-ILS/src/perlmods/OpenILS/SIP/Item.pm index 0ba4de55fa..b931cc4af1 100644 --- a/Open-ILS/src/perlmods/OpenILS/SIP/Item.pm +++ b/Open-ILS/src/perlmods/OpenILS/SIP/Item.pm @@ -230,21 +230,15 @@ sub due_date { my $e = OpenILS::SIP->editor(); my $circ = $e->search_action_circulation( - { target_copy => $self->{copy}->id, stop_fines => undef } )->[0]; - - if(!$circ) { - # if not, lets look for other circs we can check in - $circ = $e->search_action_circulation( - { - target_copy => $self->{copy}->id, - xact_finish => undef, - stop_fines => [ 'CLAIMSRETURNED', 'LOST', 'LONGOVERDUE' ] - } )->[0]; + { target_copy => $self->{copy}->id, checkin_time => undef } )->[0]; + + if( !$circ ) { + syslog('LOG_INFO', "OILS: No open circ found for copy"); + return 0; } - return 0 unless $circ; my $due = OpenILS::SIP->format_date($circ->due_date); - syslog('LOG_DEBUG', "Item due date = $due"); + syslog('LOG_DEBUG', "OILS: Found item due date = $due"); return $due; } -- 2.11.0