properly setting opac/desk/phone renewal flag on circs created from renewals based...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 8 Dec 2006 18:36:06 +0000 (18:36 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 8 Dec 2006 18:36:06 +0000 (18:36 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6669 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 1836a83..72e87a1 100644 (file)
@@ -257,6 +257,7 @@ sub translate_legacy_args {
                $$args{is_precat} = $$args{precat};
                delete $$args{precat};
        }
+
 }
 
 
@@ -347,6 +348,9 @@ my @AUTOLOAD_FIELDS = qw/
        permit_override
        pending_checkouts
        cancelled_hold_transit
+       opac_renewal
+       phone_renewal
+       desk_renewal
 /;
 
 
@@ -396,6 +400,10 @@ sub new {
        $self->circ_lib(
                ($self->circ_lib) ? $self->circ_lib : $self->editor->requestor->ws_ou);
 
+       # if this is a renewal, default to desk_renewal
+       $self->desk_renewal(1) unless 
+               $self->opac_renewal or $self->phone_renewal;
+
        return $self;
 }
 
@@ -1087,11 +1095,14 @@ sub build_checkout_circ_object {
    $circ->circ_lib( $self->circ_lib );
 
    if( $self->is_renewal ) {
-      $circ->opac_renewal(1);
+      $circ->opac_renewal('t') if $self->opac_renewal;
+      $circ->phone_renewal('t') if $self->phone_renewal;
+      $circ->desk_renewal('t') if $self->desk_renewal;
       $circ->renewal_remaining($self->renewal_remaining);
       $circ->circ_staff($self->editor->requestor->id);
    }
 
+
    # if the user provided an overiding checkout time,
    # (e.g. the checkout really happened several hours ago), then
    # we apply that here.  Does this need a perm??
@@ -1728,7 +1739,6 @@ sub checkin_handle_circ {
                $self->update_copy;
        }
 
-
        return $self->bail_on_events($self->editor->event)
                unless $self->editor->update_action_circulation($circ);
 }