From cf84664ba3fcb969ff28cc429cde6f9797d9e892 Mon Sep 17 00:00:00 2001 From: senator Date: Wed, 10 Nov 2010 21:29:51 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.open-ils.org/ILS/trunk@18688 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../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 9083544699..24a3bd7f50 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -1880,10 +1880,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; @@ -1897,7 +1898,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}); @@ -1909,9 +1910,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.43.2