LP1901930 tweaks to SIP2 Checkout Response
authorJason Etheridge <jason@EquinoxOLI.org>
Thu, 26 May 2022 18:45:51 +0000 (14:45 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 28 Nov 2022 20:00:35 +0000 (15:00 -0500)
Signed-off-by: Jason Etheridge <jason@EquinoxOLI.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/SIP2.pm

index 680dd51..5174ed3 100644 (file)
@@ -529,12 +529,15 @@ sub checkout_renew_common {
         ],
         fields => [
             {AA => $patron_barcode},
-            {AB => $item_barcode}
+            {AB => $item_barcode},
+            {AO => $config->{institution}},
+            {AH => ''}
         ]
     };
 
     my $item_details = OpenILS::Application::SIP2::Item->get_item_details(
         $session, barcode => $item_barcode);
+    push @{ $stub->{fields} }, {AJ => $item_details->{title}};
 
     return $stub unless $item_details;
 
@@ -567,7 +570,9 @@ sub checkout_renew_common {
         code => $code,
         fixed_fields => [
             $circ ? 1 : 0,              # checkout ok
-            $SC->sipbool($can_renew),   # renewal ok
+            # Per SIP spec, "renewal ok" is a bit dumber than $can_renew, and returns Y if the item was already circulating to the patron, N otherwise)
+            # FIXME: Hardcoded for now, but need to revisit
+            $SC->sipbool(0),            # renewal ok
             $SC->sipbool($magnetic),    # magnetic media
             $SC->sipbool(!$magnetic),   # desensitize
             $SC->sipdate,               # transaction date
@@ -578,7 +583,7 @@ sub checkout_renew_common {
             {AJ => $item_details->{title}},
             {AO => $config->{institution}},
             {BT => $item_details->{fee_type}},
-            {CI => 0}, # security inhibit
+            {CI => 'N'}, # security inhibit
             {CK => $item_details->{media_type}},
             $screen_msg ? {AF => $screen_msg}   : (),
             $due_date   ? {AH => $due_date}     : (),