From 3ca5e017bc0a2e0c4dd3dd0c2a688e297752972b Mon Sep 17 00:00:00 2001 From: "Joe Atzberger (siptest" Date: Wed, 4 Jun 2008 18:14:46 -0500 Subject: [PATCH] Add check to resensitize sub. Signed-off-by: Joshua Ferraro --- C4/SIP/ILS/Transaction/Checkin.pm | 34 ++++++++++++++++--------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/C4/SIP/ILS/Transaction/Checkin.pm b/C4/SIP/ILS/Transaction/Checkin.pm index 01fb0d0abf..bcf5c787a8 100644 --- a/C4/SIP/ILS/Transaction/Checkin.pm +++ b/C4/SIP/ILS/Transaction/Checkin.pm @@ -17,38 +17,40 @@ use C4::Circulation; our @ISA = qw(ILS::Transaction); my %fields = ( - magnetic => 0, - sort_bin => undef, - ); + magnetic => 0, + sort_bin => undef, +); sub new { - my $class = shift;; - my $self = $class->SUPER::new(); - my $element; + my $class = shift;; + my $self = $class->SUPER::new(); + my $element; - foreach $element (keys %fields) { - $self->{_permitted}->{$element} = $fields{$element}; - } + foreach $element (keys %fields) { + $self->{_permitted}->{$element} = $fields{$element}; + } - @{$self}{keys %fields} = values %fields; - - return bless $self, $class; + @{$self}{keys %fields} = values %fields; + return bless $self, $class; } sub do_checkin { my $self = shift; my $barcode = $self->{item}->{id}; my $branch='ALB'; # gotta set this + # FIXME: hardcoded branch not good. my $return = AddReturn($barcode,$branch); $self->ok($return); return 1; } - sub resensitize { - my $self = shift; - - return !$self->{item}->magnetic; + my $self = shift; + unless ($self->{item}) { + warn "no item found in object to resensitize"; + return undef; + } + return !$self->{item}->magnetic; } 1; -- 2.39.5