From 8f4d5720b683857c8bd1df2da4e86ba90d8d90fb Mon Sep 17 00:00:00 2001 From: Emmi Takkinen Date: Mon, 11 Apr 2022 11:57:09 +0300 Subject: [PATCH 6/6] Bug 12285: Determine patrons preferred languge Fineslip is not printed by patrons preferred language choice. To test: 1) Add content to fineslip under "en" tab. 2) Find patron with fines. 3) Set patrons preferred language as "en". 4) Print fines. => Fineslip has default content. 5) Apply patch. 6) Print slip. => Fineslip has "en" content. Sponsored-by: Koha-Suomi Oy --- C4/Members.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/C4/Members.pm b/C4/Members.pm index 494c02a83f..d3a038d6b0 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -697,6 +697,9 @@ WHERE borrowernumber = 0 AND DATEDIFF( NOW(), timestamp ) > ?|; sub FineSlip { my ($borrowernumber, $branch) = @_; + my $patron = Koha::Patrons->find( $borrowernumber ); + return unless $patron; + my $lines = Koha::Account::Lines->search({ borrowernumber => $borrowernumber }); my $total = $lines->total_outstanding; my @issueslist; @@ -732,6 +735,7 @@ sub FineSlip { module => 'circulation', letter_code => 'FINESLIP', branchcode => $branch, + lang => $patron->lang, tables => { 'branches' => $branch, 'borrowers' => $borrowernumber, -- 2.25.1