Bug 40500

Summary: Include credit/debit type code in runtime parameter selection dropdown for reports
Product: Koha Reporter: Andrew Fuerste-Henry <andrew>
Component: ReportsAssignee: Andrew Fuerste-Henry <andrew>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: lisette, nick
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 40500: Include credit and debit codes in runtime dropdown
Bug 40500: Include credit and debit codes in runtime dropdown

Description Andrew Fuerste-Henry 2025-07-24 17:47:52 UTC
When one sets a runtime parameter in a report for credit or debit type, the dropdown one gets at runtime only includes the description. In many cases it'd be helpful to also include the code itself.
Comment 1 Andrew Fuerste-Henry 2025-07-24 18:35:01 UTC
Created attachment 184602 [details] [review]
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
Comment 2 Andrew Fuerste-Henry 2025-07-24 19:21:38 UTC
Created attachment 184603 [details] [review]
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
Comment 3 Andrew Fuerste-Henry 2025-07-25 13:31:06 UTC
Nick suggested this would make sense as an option to be set in the parameter, applicable to all types of parameters. Something like "<<Debit type|debit_types:show_codes". This sounds like a good approach, but is more complicated than I can figure out just now.

The current options ":in" and ":all" are exclusive so the code only knows how to take one option at a time. We'd want to be able to combine ":show_code" with either of the other two options.