2 # An object to handle checkin status
5 package ILS::Transaction::Checkin;
10 use POSIX qw(strftime);
17 our @ISA = qw(ILS::Transaction);
22 collection_code => undef,
25 destination_loc => undef,
26 alert_type => undef, # 00,01,02,03,04 or 99
27 hold_patron_id => undef,
28 hold_patron_name => "",
34 my $self = $class->SUPER::new();
36 foreach (keys %fields) {
37 $self->{_permitted}->{$_} = $fields{$_}; # overlaying _permitted
40 @{$self}{keys %fields} = values %fields; # copying defaults into object
41 return bless $self, $class;
46 my $branch = @_ ? shift : 'SIP2' ;
47 my $barcode = $self->{item}->id;
48 my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch);
49 $self->alert(!$return);
50 if ($messages->{BadBarcode}) {
51 $self->alert_type('99');
53 # ignoring: NotIssued, IsPermanent
54 if ($messages->{wthdrawn}) {
55 $self->alert_type('99');
57 if ($messages->{ResFound}) {
58 if ($self->hold($messages->{ResFound}->{ResFound})) {
59 $self->alert_type('99');
62 defined $self->alert_type and $self->alert(1); # alert_type could be "00"
68 unless ($self->{item}) {
69 warn "no item found in object to resensitize";
72 return !$self->{item}->magnetic;
77 unless ($self->{patron}) {
78 warn "no patron found in object";
81 return !$self->{patron}->id;