From 3b517b18a90149bfd854843a7d34e25d20a61b74 Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Thu, 8 Dec 2022 14:10:18 +0000 Subject: [PATCH] Bug 32431: Display expiry date on SIP checkout when patron is expired Test plan: - Set up an expired patron - Do a SIP checkout - Check that the message is "Patron expired" - Apply the patch - Check that the message is "Patron expired on " - Prove t//db_dependent/SIP/Transaction.t Signed-off-by: Lucas Gass Signed-off-by: Kyle M Hall --- C4/SIP/ILS.pm | 3 ++- t/db_dependent/SIP/Transaction.t | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/C4/SIP/ILS.pm b/C4/SIP/ILS.pm index ff9ee74067..bebeaf6b6d 100644 --- a/C4/SIP/ILS.pm +++ b/C4/SIP/ILS.pm @@ -7,6 +7,7 @@ package C4::SIP::ILS; use warnings; use strict; use C4::SIP::Sip qw( siplog ); +use Koha::DateUtils qw( dt_from_string output_pref ); use Data::Dumper; use C4::SIP::ILS::Item; @@ -137,7 +138,7 @@ sub checkout { if ($patron->debarred) { $circ->screen_msg("Patron debarred"); } elsif ($patron->expired) { - $circ->screen_msg("Patron expired"); + $circ->screen_msg("Patron expired on " . output_pref({ dt => dt_from_string( $patron->dateexpiry_iso, 'iso' ), dateonly => 1 })); } elsif ($patron->fine_blocked) { $circ->screen_msg("Patron has fines"); } else { diff --git a/t/db_dependent/SIP/Transaction.t b/t/db_dependent/SIP/Transaction.t index e1e15ccb95..ffabc838c1 100755 --- a/t/db_dependent/SIP/Transaction.t +++ b/t/db_dependent/SIP/Transaction.t @@ -466,12 +466,12 @@ subtest do_checkout_with_patron_blocked => sub { class => 'Koha::Patrons', value => { branchcode => $library->branchcode, - dateexpiry => '2020/01/01', + dateexpiry => '2020/01/03', } } ); my $circ = $ils->checkout($expired_patron->cardnumber, $item->barcode); - is( $circ->{screen_msg}, 'Patron expired', "Got correct expired screen message" ); + is( $circ->{screen_msg}, 'Patron expired on 01/03/2020', "Got correct expired screen message" ); my $fines_patron = $builder->build_object( { -- 2.30.2