fixed renewal bug caused by renewing non-existant copies
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 8 Sep 2006 07:24:28 +0000 (07:24 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 8 Sep 2006 07:24:28 +0000 (07:24 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6027 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm

index 6e13ae8..60e9c0e 100644 (file)
@@ -456,6 +456,10 @@ sub mk_script_runner {
 
        $self->is_precat(1) if $self->copy and $self->copy->call_number == OILS_PRECAT_CALL_NUMBER;
 
+       # We can't renew if there is no copy
+       return $self->bail_on_events(@evts) if 
+               $self->is_renewal and !$self->copy;
+
        # Set some circ-specific flags in the script environment
        my $evt = "environment";
        $self->script_runner->insert("$evt.isRenewal", ($self->is_renewal) ? 1 : undef);