You can return items now BUT we need to get the branch to do this properly
[koha.git] / C4 / SIP / ILS / Transaction / Checkin.pm
1 #
2 # An object to handle checkin status
3 #
4
5 package ILS::Transaction::Checkin;
6
7 use warnings;
8 use strict;
9
10 use POSIX qw(strftime);
11
12 use ILS;
13 use ILS::Transaction;
14
15 use C4::Circulation;
16
17 our @ISA = qw(ILS::Transaction);
18
19 my %fields = (
20               magnetic => 0,
21               sort_bin => undef,
22               );
23
24 sub new {
25     my $class = shift;;
26     my $self = $class->SUPER::new();
27     my $element;
28
29     foreach $element (keys %fields) {
30         $self->{_permitted}->{$element} = $fields{$element};
31     }
32
33     @{$self}{keys %fields} = values %fields;
34
35     return bless $self, $class;
36 }
37
38 sub do_checkin {
39         my $self = shift;
40         my $barcode = $self->{item}->{id};
41         my $branch='ALB'; # gotta set this
42         my $return = AddReturn($barcode,$branch);
43         $self->ok($return);
44         return $self;
45 }
46
47
48 sub resensitize {
49     my $self = shift;
50
51     return !$self->{item}->magnetic;
52 }
53
54 1;