From 25fd16609834dd7f9c93b7137124b18e1d9238cb Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Tue, 19 Sep 2023 21:02:06 +0000 Subject: [PATCH] Bug 34829: Cash register report reverts to 'All libraries' after every search To test: 1. Have at least two libraries (Library A & Library B) and at least two patrons. One patron for Library A & one for Library B. 2. Create a manual fee for both patrons and write them off. 3. Go to the cash register statistics report and change the transaction type to "Write off" and your transaction library to Library A. 4. Notice that when you submit the report the transaction library defaults back to "All" and shows both patrons instead of just the patron from Library A. 5. Apply patch 6. Verify that the library chosen now remains selected Note: the export format is faulty, but this is unrelated to this patch. Signed-off-by: Laura Escamilla --- .../prog/en/modules/reports/cash_register_stats.tt | 10 +++++----- reports/cash_register_stats.pl | 14 ++++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt index 5667a6defe..d234a08226 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt @@ -119,12 +119,12 @@
  • diff --git a/reports/cash_register_stats.pl b/reports/cash_register_stats.pl index 1dde63b114..27c219ee3c 100755 --- a/reports/cash_register_stats.pl +++ b/reports/cash_register_stats.pl @@ -39,11 +39,13 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user({ flagsrequired => {reports => '*'}, }); -my $do_it = $input->param('do_it'); -my $output = $input->param("output"); -my $basename = $input->param("basename"); -my $transaction_type = $input->param("transaction_type") || 'ACT'; -my $manager_branchcode = $input->param("branch") || C4::Context->userenv->{'branch'}; +my $do_it = $input->param('do_it'); +my $output = $input->param("output"); +my $basename = $input->param("basename"); +my $transaction_type = $input->param("transaction_type") || 'ACT'; +my $branch = $input->param("branch"); +my $manager_branchcode = $input->param("branch") || C4::Context->userenv->{'branch'}; + $template->param( do_it => $do_it, @@ -196,7 +198,7 @@ $template->param( beginDate => $fromDate, endDate => $toDate, transaction_type => $transaction_type, - branchloop => Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed, + selected_library => $branch, debit_types => \@debit_types, credit_types => \@credit_types, registerid => $registerid, -- 2.30.2