From 1dd53679b4f5175aac2a86e6fd8d8787b671dc0b Mon Sep 17 00:00:00 2001 From: Andrew Fuerste Henry Date: Thu, 24 Jul 2025 18:34:25 +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 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index fe47501ee7f..2c08d20cba1 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -900,14 +900,18 @@ if ( $op eq 'run' ) { $authorised_lib{$id} = $name; } } elsif ( $authorised_value eq "debit_types" ) { - my $sth = $dbh->prepare("SELECT code, description FROM account_debit_types ORDER BY code"); + my $sth = $dbh->prepare( + "SELECT code, concat(description,' (',code,')') as display_value FROM account_debit_types ORDER BY code" + ); $sth->execute; while ( my ( $code, $description ) = $sth->fetchrow_array ) { push @authorised_values, $code; $authorised_lib{$code} = $description; } } elsif ( $authorised_value eq "credit_types" ) { - my $sth = $dbh->prepare("SELECT code, description FROM account_credit_types ORDER BY code"); + my $sth = $dbh->prepare( + "SELECT code, concat(description,' (',code,')') as display_value FROM account_credit_types ORDER BY code" + ); $sth->execute; while ( my ( $code, $description ) = $sth->fetchrow_array ) { push @authorised_values, $code; -- 2.39.5