Lines 83-88
push @query_params, output_pref({ dt => $startdate, dateformat => 'iso' }) ;
Link Here
|
83 |
$sqldatewhere .= " AND reservedate <= ?"; |
83 |
$sqldatewhere .= " AND reservedate <= ?"; |
84 |
push @query_params, output_pref({ dt => $enddate, dateformat => 'iso' }); |
84 |
push @query_params, output_pref({ dt => $enddate, dateformat => 'iso' }); |
85 |
|
85 |
|
|
|
86 |
my $include_aqorders_qty = |
87 |
C4::Context->preference('AcqCreateItem') eq 'receiving' |
88 |
? '+ COALESCE(aqorders.quantity, 0) - COALESCE(aqorders.quantityreceived, 0)' |
89 |
: q{}; |
90 |
|
86 |
my $nfl_comparison = $include_ordered ? '<=' : '='; |
91 |
my $nfl_comparison = $include_ordered ? '<=' : '='; |
87 |
my $strsth = |
92 |
my $strsth = |
88 |
"SELECT reservedate, |
93 |
"SELECT reservedate, |
Lines 107-116
my $strsth =
Link Here
|
107 |
biblio.title, |
112 |
biblio.title, |
108 |
biblio.author, |
113 |
biblio.author, |
109 |
count(DISTINCT reserves.borrowernumber) as reservecount, |
114 |
count(DISTINCT reserves.borrowernumber) as reservecount, |
110 |
count(DISTINCT items.itemnumber) as itemcount |
115 |
count(DISTINCT items.itemnumber) $include_aqorders_qty as itemcount |
111 |
FROM reserves |
116 |
FROM reserves |
112 |
LEFT JOIN items ON items.biblionumber=reserves.biblionumber |
117 |
LEFT JOIN items ON items.biblionumber=reserves.biblionumber |
113 |
LEFT JOIN biblio ON reserves.biblionumber=biblio.biblionumber |
118 |
LEFT JOIN biblio ON reserves.biblionumber=biblio.biblionumber |
|
|
119 |
LEFT JOIN aqorders ON reserves.biblionumber=aqorders.biblionumber |
114 |
WHERE |
120 |
WHERE |
115 |
notforloan $nfl_comparison 0 AND damaged = 0 AND itemlost = 0 AND withdrawn = 0 |
121 |
notforloan $nfl_comparison 0 AND damaged = 0 AND itemlost = 0 AND withdrawn = 0 |
116 |
$sqldatewhere |
122 |
$sqldatewhere |
117 |
- |
|
|