From e18b4206307c97055e6a450dc522b0fd9263a3f6 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 3 Apr 2012 09:27:25 -0400 Subject: [PATCH] Bug 7887 - Add Option To Include Items That Will Be Available When Calculating Holds Ratios This commit adds the ability to include items that are on order in the aquisitions module, and items whose notforloan attribute is less than 1 ( i.e. will be available in the future ) when calculating holds ratios. --- circ/reserveratios.pl | 19 ++++++++++++++----- .../prog/en/modules/circ/reserveratios.tt | 10 ++++++++++ .../prog/en/modules/help/circ/reserveratios.tt | 4 ++++ 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/circ/reserveratios.pl b/circ/reserveratios.pl index 1517adf..4584cba 100755 --- a/circ/reserveratios.pl +++ b/circ/reserveratios.pl @@ -36,6 +36,8 @@ my $order = $input->param('order') || ''; my $startdate = $input->param('from'); my $enddate = $input->param('to'); my $ratio = $input->param('ratio'); +my $include_on_order_items = $input->param('include_on_order_items'); +my $include_will_be_available = $input->param('include_will_be_available'); my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { @@ -101,6 +103,10 @@ if ($order eq "biblio") { } else { $sqlorderby = " ORDER BY reservecount DESC "; } + +my $on_order_sql = ( $include_on_order_items ) ? "+ aqorders.quantity" : ""; +my $not_for_loan_comparison = ( $include_will_be_available ) ? "<=" : "="; + my $strsth = "SELECT reservedate, reserves.borrowernumber as borrowernumber, @@ -117,17 +123,18 @@ my $strsth = ORDER BY items.itemnumber SEPARATOR '
') as l_location, GROUP_CONCAT(DISTINCT items.itype ORDER BY items.itemnumber SEPARATOR '
') as l_itype, - notes, + biblio.notes, reserves.found, biblio.title, biblio.author, count(DISTINCT reserves.borrowernumber) as reservecount, - count(DISTINCT items.itemnumber) as itemcount + count(DISTINCT items.itemnumber) $on_order_sql as itemcount FROM reserves LEFT JOIN items ON items.biblionumber=reserves.biblionumber LEFT JOIN biblio ON reserves.biblionumber=biblio.biblionumber + LEFT JOIN aqorders ON reserves.biblionumber=aqorders.biblionumber WHERE -notforloan = 0 AND damaged = 0 AND itemlost = 0 AND wthdrawn = 0 +notforloan $not_for_loan_comparison 0 AND damaged = 0 AND itemlost = 0 AND wthdrawn = 0 $sqldatewhere "; @@ -157,7 +164,7 @@ while ( my $data = $sth->fetchrow_hashref ) { priority => $data->{priority}, name => $data->{borrower}, title => $data->{title}, - subtitle => $data->{subtitle}, + subtitle => $data->{subtitle}, author => $data->{author}, notes => $data->{notes}, itemnum => $data->{itemnumber}, @@ -185,7 +192,9 @@ $template->param( to => $enddate, ratio => $ratio, reserveloop => \@reservedata, - DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), + DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), + include_on_order_items => $include_on_order_items, + include_will_be_available => $include_will_be_available, ); output_html_with_http_headers $input, $cookie, $template->output; 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 da6292d..c1172e2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt @@ -179,6 +179,16 @@ Calendar.setup( (inclusive) +
    1. + + +
  • + +
    1. + + +
  • +
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/reserveratios.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/reserveratios.tt index ab3b231..7ff5c94 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/reserveratios.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/reserveratios.tt @@ -4,6 +4,10 @@

    Hold ratios help with collection development. Using this report you will be able to see how many of your patrons have holds on items and whether you should buy more. By default it will be set to the library needing 3 items per hold that has been placed. The report will tell you how many additional items need to be purchased to meet this quota.

    +

    If the checkbox for "Include on order items" is checked, the count of items will include items on order via the acquisitions module.

    + +

    If the checkbox for "Include items that will be available" is checked, the count of items will include items that are currently not for loan but will be ( e.g. items on order, being repaired, etc. ).

    +

    See the full documentation for Hold Ratios in the manual (online).

    [% INCLUDE 'help-bottom.inc' %] -- 1.7.2.5