From 6906c40ead87f3ebcb3cae69c2933ebd193d5344 Mon Sep 17 00:00:00 2001 From: Andrew Fuerste Henry Date: Thu, 24 Jul 2025 19:21:14 +0000 Subject: [PATCH] Bug 40500: Include credit and debit codes in runtime dropdown To test: 1 - save and run a sql query using both debit type and credit type parameters 2 - run your report and see your dropdowns only include desciptions 3 - apply patch, restart services 4 - re-run your report and see your dropdowns have both the description and the code --- reports/guided_reports.pl | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index 2c08d20cba1..8254f542ef7 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -900,22 +900,18 @@ if ( $op eq 'run' ) { $authorised_lib{$id} = $name; } } elsif ( $authorised_value eq "debit_types" ) { - my $sth = $dbh->prepare( - "SELECT code, concat(description,' (',code,')') as display_value FROM account_debit_types ORDER BY code" - ); + my $sth = $dbh->prepare("SELECT code, description FROM account_debit_types ORDER BY code"); $sth->execute; while ( my ( $code, $description ) = $sth->fetchrow_array ) { push @authorised_values, $code; - $authorised_lib{$code} = $description; + $authorised_lib{$code} = "$description ($code)"; } } elsif ( $authorised_value eq "credit_types" ) { - my $sth = $dbh->prepare( - "SELECT code, concat(description,' (',code,')') as display_value FROM account_credit_types ORDER BY code" - ); + my $sth = $dbh->prepare("SELECT code, description FROM account_credit_types ORDER BY code"); $sth->execute; while ( my ( $code, $description ) = $sth->fetchrow_array ) { push @authorised_values, $code; - $authorised_lib{$code} = $description; + $authorised_lib{$code} = "$description ($code)"; } } else { if ( Koha::AuthorisedValues->search( { category => $authorised_value } )->count ) { -- 2.39.5