Bug 22043: SIP Checkin Response alert flag set to often set to Y incorrectly
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 21 Dec 2018 18:54:18 +0000 (13:54 -0500)
committerroot <root@f1ebe1bec408>
Fri, 15 Mar 2019 12:10:46 +0000 (12:10 +0000)
If a checkin has any messages at all, even informational like LocalUse, the alert flag ( 4th character of the response ) will be set to Y, even if we do not prove a corresponding alert code in the CV field. We should only set the alert flag if we are going to send a value in the CV field.If a checkin has any messages at all, even informational like LocalUse, the alert flag ( 4th character of the response ) will be set to Y, even if we do not prove a corresponding alert code in the CV field. We should only set the alert flag if we are going to send a value in the CV field.

Test Plan:
1) Set the checked_in_ok sip account flag to 1 for an account
2) Check in an already checked in item via SIP
3) Note the alert flag is set to Y
4) Apply this patch
5) Restart SIP
6) Check the item in again
7) Note the alert flag is set to N

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jill Kleven <jill.kleven@pueblolibrary.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
C4/SIP/ILS/Transaction/Checkin.pm

index a35009f..77eb361 100644 (file)
@@ -66,8 +66,6 @@ sub do_checkin {
 
     $debug and warn "do_checkin() calling AddReturn($barcode, $branch)";
     my ($return, $messages, $issue, $borrower) = AddReturn($barcode, $branch, undef, undef, $return_date);
-    $self->alert(!$return);
-    # ignoring messages: NotIssued, WasLost, WasTransfered
 
     # biblionumber, biblioitemnumber, itemnumber
     # borrowernumber, reservedate, branchcode
@@ -117,7 +115,7 @@ sub do_checkin {
         $self->{item}->hold_patron_id( $messages->{ResFound}->{borrowernumber} );
         $self->{item}->destination_loc( $messages->{ResFound}->{branchcode} );
     }
-    $self->alert(1) if defined $self->alert_type;  # alert_type could be "00", hypothetically
+    $self->alert(defined $self->alert_type);  # alert_type could be "00", hypothetically
     $self->ok($return);
 }