From 42d892b7fc643c6131c9047a337c55828e440783 Mon Sep 17 00:00:00 2001 From: Amit Gupta Date: Tue, 24 Feb 2026 13:04:08 +0530 Subject: [PATCH] Bug 41914: Add patron category description to account payment notice template To Test: 1. Apply the patch 2. Change the notice Account payment and add below Dear <> <> Category: <> [%- USE Price -%] A payment of [% credit.amount * -1 | $Price %] has been applied to your account. This payment affected the following fees: [%- FOREACH o IN offsets %] Description: [% o.debit.description %] Amount paid: [% o.amount * -1 | $Price %] Amount remaining: [% o.debit.amountoutstanding | $Price %] [% END %] 3. Save the notice. 4. Turn on the system preference 'AutomaticEmailReceipts to send' and save the preferenes. 5. Go to the patron account and Create the manual invoice and collect the payment. 6. Go to notices tab and click on the message you can find the category description in the messange and receive the mail also. Signed-off-by: Andrew Fuerste Henry --- C4/Letters.pm | 1 + Koha/Account.pm | 1 + tools/letter.pl | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 1db40371776..5ddcdc4be50 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -801,6 +801,7 @@ sub _parseletter_sth { : ( $table eq 'reserves' ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?" : ( $table eq 'borrowers' ) ? "SELECT * FROM $table WHERE borrowernumber = ?" : ( $table eq 'branches' ) ? "SELECT * FROM $table WHERE branchcode = ?" + : ( $table eq 'categories' ) ? "SELECT * FROM $table WHERE categorycode = ?" : ( $table eq 'suggestions' ) ? "SELECT * FROM $table WHERE suggestionid = ?" : ( $table eq 'aqbooksellers' ) ? "SELECT * FROM $table WHERE id = ?" : ( $table eq 'aqorders' ) ? "SELECT * FROM $table WHERE ordernumber = ?" diff --git a/Koha/Account.pm b/Koha/Account.pm index d78247409de..3d59181ee9a 100644 --- a/Koha/Account.pm +++ b/Koha/Account.pm @@ -140,6 +140,7 @@ sub pay { tables => { borrowers => $self->{patron_id}, branches => $library_id, + categories => $patron->categorycode, }, substitute => { credit => $payment, diff --git a/tools/letter.pl b/tools/letter.pl index 631cfa2646d..4a3b7a1cbce 100755 --- a/tools/letter.pl +++ b/tools/letter.pl @@ -250,7 +250,7 @@ sub add_form { ); my $field_selection; - push @{$field_selection}, add_fields('branches'); + push @{$field_selection}, add_fields('branches','categories'); if ( $module eq 'reserves' ) { push @{$field_selection}, add_fields( 'borrowers', 'reserves', 'biblio', 'biblioitems', 'items' ); } elsif ( $module eq 'acquisition' ) { -- 2.39.5