View | Details | Raw Unified | Return to bug 3638
Collapse All | Expand All

(-)a/C4/SIP/ILS.pm (-1 / +1 lines)
Lines 181-187 sub checkin { Link Here
181
    $circ->item($item = new ILS::Item $item_id);
181
    $circ->item($item = new ILS::Item $item_id);
182
182
183
    if ($item) {
183
    if ($item) {
184
        $circ->do_checkin($current_loc, $return_date);
184
        $circ->do_checkin($current_loc);
185
    } else {
185
    } else {
186
        $circ->alert(1);
186
        $circ->alert(1);
187
        $circ->alert_type(99);
187
        $circ->alert_type(99);
(-)a/C4/SIP/ILS/Transaction/Checkin.pm (-1 / +9 lines)
Lines 14-19 use ILS::Transaction; Link Here
14
14
15
use C4::Circulation;
15
use C4::Circulation;
16
use C4::Reserves qw( ModReserveAffect );
16
use C4::Reserves qw( ModReserveAffect );
17
use C4::Items qw( ModItemTransfer );
17
use C4::Debug;
18
use C4::Debug;
18
19
19
our @ISA = qw(ILS::Transaction);
20
our @ISA = qw(ILS::Transaction);
Lines 45-51 sub new { Link Here
45
46
46
sub do_checkin {
47
sub do_checkin {
47
    my $self = shift;
48
    my $self = shift;
48
    my $branch = @_ ? shift : 'SIP2' ;
49
    my $branch = shift;
50
    if (!$branch) {
51
        $branch = 'SIP2'; 
52
    }
49
    my $barcode = $self->{item}->id;
53
    my $barcode = $self->{item}->id;
50
    $debug and warn "do_checkin() calling AddReturn($barcode, $branch)";
54
    $debug and warn "do_checkin() calling AddReturn($barcode, $branch)";
51
    my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch);
55
    my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch);
Lines 85-90 sub do_checkin { Link Here
85
            $self->alert_type('02');
89
            $self->alert_type('02');
86
            ModReserveAffect( $messages->{ResFound}->{itemnumber},
90
            ModReserveAffect( $messages->{ResFound}->{itemnumber},
87
                $messages->{ResFound}->{borrowernumber}, 1);
91
                $messages->{ResFound}->{borrowernumber}, 1);
92
            ModItemTransfer( $messages->{ResFound}->{itemnumber},
93
                $branch,
94
                $messages->{ResFound}->{branchcode}
95
            );
88
96
89
        }
97
        }
90
        $self->{item}->hold_patron_id( $messages->{ResFound}->{borrowernumber} );
98
        $self->{item}->hold_patron_id( $messages->{ResFound}->{borrowernumber} );
(-)a/C4/SIP/Sip/MsgType.pm (-3 / +6 lines)
Lines 610-615 sub handle_checkin { Link Here
610
    my ($self, $server) = @_;
610
    my ($self, $server) = @_;
611
    my $account = $server->{account};
611
    my $account = $server->{account};
612
    my $ils     = $server->{ils};
612
    my $ils     = $server->{ils};
613
    my $my_branch = $ils->institution;
613
    my ($current_loc, $inst_id, $item_id, $terminal_pwd, $item_props, $cancel);
614
    my ($current_loc, $inst_id, $item_id, $terminal_pwd, $item_props, $cancel);
614
    my ($patron, $item, $status);
615
    my ($patron, $item, $status);
615
    my $resp = CHECKIN_RESP;
616
    my $resp = CHECKIN_RESP;
Lines 621-626 sub handle_checkin { Link Here
621
	$item_id     = $fields->{(FID_ITEM_ID)};
622
	$item_id     = $fields->{(FID_ITEM_ID)};
622
	$item_props  = $fields->{(FID_ITEM_PROPS)};
623
	$item_props  = $fields->{(FID_ITEM_PROPS)};
623
	$cancel      = $fields->{(FID_CANCEL)};
624
	$cancel      = $fields->{(FID_CANCEL)};
625
    if ($current_loc) {
626
        $my_branch = $current_loc;# most scm do not set $current_loc
627
    }
624
628
625
    $ils->check_inst_id($inst_id, "handle_checkin");
629
    $ils->check_inst_id($inst_id, "handle_checkin");
626
630
Lines 629-635 sub handle_checkin { Link Here
629
        syslog("LOG_WARNING", "received no-block checkin from terminal '%s'", $account->{id});
633
        syslog("LOG_WARNING", "received no-block checkin from terminal '%s'", $account->{id});
630
        $status = $ils->checkin_no_block($item_id, $trans_date, $return_date, $item_props, $cancel);
634
        $status = $ils->checkin_no_block($item_id, $trans_date, $return_date, $item_props, $cancel);
631
    } else {
635
    } else {
632
        $status = $ils->checkin($item_id, $trans_date, $return_date, $current_loc, $item_props, $cancel);
636
        $status = $ils->checkin($item_id, $trans_date, $return_date, $my_branch, $item_props, $cancel);
633
    }
637
    }
634
638
635
    $patron = $status->patron;
639
    $patron = $status->patron;
Lines 647-653 sub handle_checkin { Link Here
647
    # apparently we can't trust the returns from Checkin yet (because C4::Circulation::AddReturn is faulty)
651
    # apparently we can't trust the returns from Checkin yet (because C4::Circulation::AddReturn is faulty)
648
    # So we reproduce the alert logic here.
652
    # So we reproduce the alert logic here.
649
    if (not $status->alert) {
653
    if (not $status->alert) {
650
        if ($item->destination_loc and $item->destination_loc ne $current_loc) {
654
        if ($item->destination_loc and $item->destination_loc ne $my_branch) {
651
            $status->alert(1);
655
            $status->alert(1);
652
            $status->alert_type('04');  # no hold, just send it
656
            $status->alert_type('04');  # no hold, just send it
653
        }
657
        }
654
- 

Return to bug 3638