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

(-)a/C4/SIP/ILS/Transaction/Checkin.pm (-10 / +12 lines)
Lines 70-82 sub do_checkin { Link Here
70
70
71
    $debug and warn "do_checkin() calling AddReturn($barcode, $branch)";
71
    $debug and warn "do_checkin() calling AddReturn($barcode, $branch)";
72
    my ($return, $messages, $issue, $borrower) = AddReturn($barcode, $branch, undef, dt_from_string($return_date));
72
    my ($return, $messages, $issue, $borrower) = AddReturn($barcode, $branch, undef, dt_from_string($return_date));
73
    if ($checked_in_ok){
73
74
        $debug and warn 'not raising alert when AddReturn() does not return a value for $return due to $checked_in_ok being set to true';
74
    if ( $checked_in_ok ) {
75
    }
75
        delete $messages->{NotIssued};
76
    else {
76
        delete $messages->{LocalUse};
77
        $self->alert(!$return);
77
        $return = 1 unless keys %$messages;
78
    }
78
    }
79
    # ignoring messages: NotIssued, WasLost, WasTransfered
80
79
81
    # biblionumber, biblioitemnumber, itemnumber
80
    # biblionumber, biblioitemnumber, itemnumber
82
    # borrowernumber, reservedate, branchcode
81
    # borrowernumber, reservedate, branchcode
Lines 126-137 sub do_checkin { Link Here
126
        $self->{item}->hold_patron_id( $messages->{ResFound}->{borrowernumber} );
125
        $self->{item}->hold_patron_id( $messages->{ResFound}->{borrowernumber} );
127
        $self->{item}->destination_loc( $messages->{ResFound}->{branchcode} );
126
        $self->{item}->destination_loc( $messages->{ResFound}->{branchcode} );
128
    }
127
    }
128
    # ignoring messages: NotIssued, WasLost, WasTransfered
129
130
    $self->alert(!$return) unless $checked_in_ok;
131
    $debug and $checked_in_ok and warn 'Not raising alert when AddReturn() does not return a value for $return due to $checked_in_ok being set to true';
129
132
130
    my $alert = defined $self->alert_type;
133
    my $has_alert_type = defined $self->alert_type;
131
    if ( $cv_triggers_alert ) {
134
    if ( $cv_triggers_alert ) {
132
        $self->alert($alert); # Overwrites existing alert value, should set to 0 if there is no alert type
135
        $self->alert($has_alert_type); # Overwrites existing alert value, should set to 0 if there is no alert type
133
    } else {
136
    } else {
134
        $self->alert($alert) if $alert; # Doesn't affect alert value unless an alert type is set
137
        $self->alert($has_alert_type) if $has_alert_type; # Doesn't affect alert value unless an alert type is set
135
    }
138
    }
136
139
137
    $self->ok($return);
140
    $self->ok($return);
138
- 

Return to bug 23057