From 6d3314354ef86e4577a36fb82e4594a5c88e9b51 Mon Sep 17 00:00:00 2001 From: Lari Strand Date: Wed, 31 Aug 2022 15:39:42 +0300 Subject: [PATCH] Bug 31496: Fix branch in printslip.pl to logged in staff user's library When you print a receipt slip in SCO, the library/branch you are at in should be fetched from the logged in staff member's data (staff login done before entering SCO view) instead of the patron's own who has signed in to the SCO. Printing a slip shows patron's own home branch in the slip as the branch they're in. This causes confusion with patrons who want to print receipts/slips. Test plan: 1) Make sure the staff user's library (used to login into SCO patron view) is not the same as the patron's who is logging into SCO 2) Print a slip in SCO and notice patron's home library printed on the slip 3) Apply patch 4) Print a slip in SCO and notice the library is now the staff user's library used to sign in to SCO patron view. Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- opac/sco/printslip.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opac/sco/printslip.pl b/opac/sco/printslip.pl index ae0f58314a..adac4dff2f 100755 --- a/opac/sco/printslip.pl +++ b/opac/sco/printslip.pl @@ -80,7 +80,7 @@ my $print = $input->param('print'); my $error = $input->param('error'); my ($slip, $is_html); -if (my $letter = IssueSlip ($patron->branchcode, $patron->borrowernumber, $print eq "qslip")) { +if (my $letter = IssueSlip (Koha::Patrons->find( $loggedinuser )->branchcode, $patron->borrowernumber, $print eq "qslip")) { $slip = $letter->{content}; $is_html = $letter->{is_html}; } -- 2.39.5