View | Details | Raw Unified | Return to bug 7887
Collapse All | Expand All

(-)a/circ/reserveratios.pl (-5 / +14 lines)
Lines 36-41 my $order = $input->param('order') || ''; Link Here
36
my $startdate = $input->param('from');
36
my $startdate = $input->param('from');
37
my $enddate   = $input->param('to');
37
my $enddate   = $input->param('to');
38
my $ratio     = $input->param('ratio');
38
my $ratio     = $input->param('ratio');
39
my $include_on_order_items    = $input->param('include_on_order_items');
40
my $include_will_be_available = $input->param('include_will_be_available');
39
41
40
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
42
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
41
    {
43
    {
Lines 101-106 if ($order eq "biblio") { Link Here
101
} else {
103
} else {
102
	$sqlorderby = " ORDER BY reservecount DESC ";
104
	$sqlorderby = " ORDER BY reservecount DESC ";
103
}
105
}
106
107
my $on_order_sql = ( $include_on_order_items ) ? "+ aqorders.quantity" : "";
108
my $not_for_loan_comparison = ( $include_will_be_available ) ? "<=" : "=";
109
104
my $strsth =
110
my $strsth =
105
"SELECT reservedate,
111
"SELECT reservedate,
106
        reserves.borrowernumber as borrowernumber,
112
        reserves.borrowernumber as borrowernumber,
Lines 117-133 my $strsth = Link Here
117
        		ORDER BY items.itemnumber SEPARATOR '<br/>') as l_location,
123
        		ORDER BY items.itemnumber SEPARATOR '<br/>') as l_location,
118
        GROUP_CONCAT(DISTINCT items.itype 
124
        GROUP_CONCAT(DISTINCT items.itype 
119
        		ORDER BY items.itemnumber SEPARATOR '<br/>') as l_itype,
125
        		ORDER BY items.itemnumber SEPARATOR '<br/>') as l_itype,
120
        notes,
126
        biblio.notes,
121
        reserves.found,
127
        reserves.found,
122
        biblio.title,
128
        biblio.title,
123
        biblio.author,
129
        biblio.author,
124
        count(DISTINCT reserves.borrowernumber) as reservecount, 
130
        count(DISTINCT reserves.borrowernumber) as reservecount, 
125
        count(DISTINCT items.itemnumber) as itemcount 
131
        count(DISTINCT items.itemnumber) $on_order_sql as itemcount 
126
 FROM  reserves
132
 FROM  reserves
127
 LEFT JOIN items ON items.biblionumber=reserves.biblionumber 
133
 LEFT JOIN items ON items.biblionumber=reserves.biblionumber 
128
 LEFT JOIN biblio ON reserves.biblionumber=biblio.biblionumber
134
 LEFT JOIN biblio ON reserves.biblionumber=biblio.biblionumber
135
 LEFT JOIN aqorders ON reserves.biblionumber=aqorders.biblionumber
129
 WHERE 
136
 WHERE 
130
notforloan = 0 AND damaged = 0 AND itemlost = 0 AND wthdrawn = 0
137
notforloan $not_for_loan_comparison 0 AND damaged = 0 AND itemlost = 0 AND wthdrawn = 0
131
 $sqldatewhere
138
 $sqldatewhere
132
";
139
";
133
140
Lines 157-163 while ( my $data = $sth->fetchrow_hashref ) { Link Here
157
            priority         => $data->{priority},
164
            priority         => $data->{priority},
158
            name             => $data->{borrower},
165
            name             => $data->{borrower},
159
            title            => $data->{title},
166
            title            => $data->{title},
160
            subtitle            => $data->{subtitle},
167
            subtitle         => $data->{subtitle},
161
            author           => $data->{author},
168
            author           => $data->{author},
162
            notes            => $data->{notes},
169
            notes            => $data->{notes},
163
            itemnum          => $data->{itemnumber},
170
            itemnum          => $data->{itemnumber},
Lines 185-191 $template->param( Link Here
185
    to              => $enddate,
192
    to              => $enddate,
186
    ratio           => $ratio,
193
    ratio           => $ratio,
187
    reserveloop     => \@reservedata,
194
    reserveloop     => \@reservedata,
188
    DHTMLcalendar_dateformat =>  C4::Dates->DHTMLcalendar(),
195
    DHTMLcalendar_dateformat  => C4::Dates->DHTMLcalendar(),
196
    include_on_order_items    => $include_on_order_items,
197
    include_will_be_available => $include_will_be_available,
189
);
198
);
190
199
191
output_html_with_http_headers $input, $cookie, $template->output;
200
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt (+10 lines)
Lines 179-184 Calendar.setup( Link Here
179
</script></li></ol>
179
</script></li></ol>
180
(inclusive)
180
(inclusive)
181
181
182
<li><ol>
183
<label for="include_on_order_items">Include on order items:</label>
184
<input type="checkbox" value="1" name="include_on_order_items" [% IF include_on_order_items %]checked="checked"[% END %]/>
185
</ol></li>
186
187
<li><ol>
188
<label for="include_will_be_available">Include items that will be available:</label>
189
<input type="checkbox" value="1" name="include_will_be_available" [% IF include_will_be_available %]checked="checked"[% END %]/>
190
</ol></li>
191
182
<fieldset class="action"><input type="submit" value="Go" class="submit"/></fieldset>
192
<fieldset class="action"><input type="submit" value="Go" class="submit"/></fieldset>
183
</fieldset>
193
</fieldset>
184
</form>
194
</form>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/reserveratios.tt (-1 / +4 lines)
Lines 4-9 Link Here
4
4
5
<p>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.</p>
5
<p>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.</p>
6
6
7
<p>If the checkbox for "Include on order items" is checked, the count of items will include items on order via the acquisitions module.</p>
8
9
<p>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. ).</p>
10
7
<p><strong>See the full documentation for Hold Ratios in the <a href="http://manual.koha-community.org/3.6/en/circreports.html#holdratios">manual</a> (online).</strong></p>
11
<p><strong>See the full documentation for Hold Ratios in the <a href="http://manual.koha-community.org/3.6/en/circreports.html#holdratios">manual</a> (online).</strong></p>
8
12
9
[% INCLUDE 'help-bottom.inc' %]
13
[% INCLUDE 'help-bottom.inc' %]
10
- 

Return to bug 7887