From de4e68f4f96d9b8ac67bb70b7b24f3db33ed3c84 Mon Sep 17 00:00:00 2001 From: senator Date: Thu, 2 Dec 2010 21:16:39 +0000 Subject: [PATCH] Belated backport of r18688 from trunk Booking: fix bug reported by Robert Soulliere wherein the items associated with picked-up reservations didn't actually get their status set to 'checked out' like they should have. Robert reported this bug on Launchpad (#672748) and provided a patch, but there were some neighboring bugs in the circulation logic anyway, so they've all been fixed together. Update: Robert and I aren't yet actually certain whether this fixed the problem when using legacy circ scripts. Investigation continues on Launchpad. git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6_1@18904 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Circ/Circulate.pm | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm index 4f4cd571a0..6fbd351136 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -1696,10 +1696,11 @@ sub do_reservation_pickup { if ( $self->reservation->current_resource && - $self->reservation->current_resource->catalog_item + $U->is_true($self->reservation->target_resource_type->catalog_item) ) { - $self->copy( $self->reservation->current_resource->catalog_item ); - $self->patron( $self->reservation->usr ); + # We used to try to set $self->copy and $self->patron here, + # but that should already be done. + $self->run_checkout_scripts(1); my $duration = $self->duration_rule; @@ -1713,7 +1714,7 @@ sub do_reservation_pickup { my $mname = $max->name; my $rname = $recurring->name; - $logger->debug("circulator: building reservation ". + $logger->debug("circulator: updating reservation ". "with duration=$dname, maxfine=$mname, recurring=$rname"); $self->reservation->fine_amount($policy->{recurring_fine}); @@ -1725,9 +1726,15 @@ sub do_reservation_pickup { $self->update_copy(); } else { - $self->reservation->fine_amount($self->reservation->fine_amount); - $self->reservation->max_fine($self->reservation->max_fine); - $self->reservation->fine_interval($self->reservation->fine_interval); + $self->reservation->fine_amount( + $self->reservation->target_resource_type->fine_amount + ); + $self->reservation->max_fine( + $self->reservation->target_resource_type->max_fine + ); + $self->reservation->fine_interval( + $self->reservation->target_resource_type->fine_interval + ); } $self->update_reservation(); -- 2.11.0