From a9a94a2686288565fae3120aa095f6fced1042d6 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 19 Mar 2020 13:29:50 +0000 Subject: [PATCH] Bug 24907: Add 'include suspended' to holds ratio report Some libraries would like the option to ignore suspended holds when using the holds ratio report Note: this report fails with strict mode enabled, please disable to test To test: 1 - Add enough holds to a record (3) to make it show on the holds ration report 2 - Browse to Circulation->Holds ratio 3 - Run with default settings and confirm the title shows up 4 - Suspend one of the holds 5 - Run report again and confirm title still shows 6 - Apply patch 7 - Reload the report 8 - Note new option 9 - Run report - title does not show 10 - Lower ratio to 2 and confirm the hold shows Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- circ/reserveratios.pl | 4 ++++ .../intranet-tmpl/prog/en/modules/circ/reserveratios.tt | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/circ/reserveratios.pl b/circ/reserveratios.pl index b4b0b81229..77117934d0 100755 --- a/circ/reserveratios.pl +++ b/circ/reserveratios.pl @@ -37,6 +37,7 @@ my $startdate = $input->param('from'); my $enddate = $input->param('to'); my $ratio = $input->param('ratio'); my $include_ordered = $input->param('include_ordered'); +my $include_suspended = $input->param('include_suspended'); my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { @@ -104,6 +105,7 @@ my $include_aqorders_qty_join = : q{}; my $nfl_comparison = $include_ordered ? '<=' : '='; +my $sus_comparison = $include_suspended ? '<=' : '<'; my $strsth = "SELECT reservedate, reserves.borrowernumber as borrowernumber, @@ -138,6 +140,7 @@ my $strsth = $include_aqorders_qty_join WHERE notforloan $nfl_comparison 0 AND damaged = 0 AND itemlost = 0 AND withdrawn = 0 + AND suspend $sus_comparison 1 $sqldatewhere "; @@ -199,6 +202,7 @@ $template->param( to => $enddate, ratio => $ratio, include_ordered => $include_ordered, + include_suspended => $include_suspended, reserveloop => \@reservedata, ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt index 9654062c93..907d633649 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt @@ -140,6 +140,15 @@ [% END %]
  • +
  • + + [% IF include_suspended %] + + [% ELSE %] + + [% END %] +
  • +
  • -- 2.39.5