sub update_hold_impl {
my($self, $e, $hold, $values) = @_;
+ my $hold_status;
unless($hold) {
$hold = $e->retrieve_action_hold_request($values->{id})
return $e->die_event unless $e->allowed('UPDATE_HOLD_REQUEST_TIME', $hold->pickup_lib);
}
+
+ # --------------------------------------------------------------
+ # See if the hold is getting frozen while in transit. If so,
+ # make sure that's allowed.
+ # --------------------------------------------------------------
+ if ($U->is_true($hold->frozen) and !$U->is_true($orig_hold->frozen)) {
+ $hold_status = _hold_status($e, $hold);
+ if ($hold_status == 3) { # in transit
+
+ }
+ }
+
+
# --------------------------------------------------------------
# if the hold is on the holds shelf or in transit and the pickup
# lib changes we need to create a new transit.
# --------------------------------------------------------------
if($orig_hold->pickup_lib ne $hold->pickup_lib) {
- my $status = _hold_status($e, $hold);
+ $hold_status = _hold_status($e, $hold) unless $hold_status;
- if($status == 3) { # in transit
+ if($hold_status == 3) { # in transit
return $e->die_event unless $e->allowed('UPDATE_PICKUP_LIB_FROM_TRANSIT', $orig_hold->pickup_lib);
return $e->die_event unless $e->allowed('UPDATE_PICKUP_LIB_FROM_TRANSIT', $hold->pickup_lib);
$transit->dest($hold->pickup_lib);
$e->update_action_hold_transit_copy($transit) or return $e->die_event;
- } elsif($status == 4) { # on holds shelf
+ } elsif($hold_status == 4) { # on holds shelf
return $e->die_event unless $e->allowed('UPDATE_PICKUP_LIB_FROM_HOLDS_SHELF', $orig_hold->pickup_lib);
return $e->die_event unless $e->allowed('UPDATE_PICKUP_LIB_FROM_HOLDS_SHELF', $hold->pickup_lib);