Lines 250-256
sub calculate {
Link Here
|
250 |
$linefilter[2] = @$filters[6] if ($line =~ /returndate/ ) ; |
250 |
$linefilter[2] = @$filters[6] if ($line =~ /returndate/ ) ; |
251 |
$linefilter[3] = @$filters[7] if ($line =~ /returndate/ ) ; |
251 |
$linefilter[3] = @$filters[7] if ($line =~ /returndate/ ) ; |
252 |
$linefilter[0] = @$filters[8] if ($line =~ /category/ ) ; |
252 |
$linefilter[0] = @$filters[8] if ($line =~ /category/ ) ; |
253 |
$linefilter[0] = @$filters[9] if ($line =~ /itemtype/ ) ; |
253 |
$linefilter[0] = @$filters[9] if ($line eq $itype); |
254 |
$linefilter[0] = @$filters[10] if ($line =~ /branch/ ) ; |
254 |
$linefilter[0] = @$filters[10] if ($line =~ /branch/ ) ; |
255 |
$linefilter[0] = @$filters[11] if ($line =~ /sort1/ ) ; |
255 |
$linefilter[0] = @$filters[11] if ($line =~ /sort1/ ) ; |
256 |
$linefilter[0] = @$filters[12] if ($line =~ /sort2/ ) ; |
256 |
$linefilter[0] = @$filters[12] if ($line =~ /sort2/ ) ; |
Lines 267-273
sub calculate {
Link Here
|
267 |
$colfilter[2] = @$filters[6] if ($column =~ /returndate/ ) ; |
267 |
$colfilter[2] = @$filters[6] if ($column =~ /returndate/ ) ; |
268 |
$colfilter[3] = @$filters[7] if ($column =~ /returndate/ ) ; |
268 |
$colfilter[3] = @$filters[7] if ($column =~ /returndate/ ) ; |
269 |
$colfilter[0] = @$filters[8] if ($column =~ /category/ ) ; |
269 |
$colfilter[0] = @$filters[8] if ($column =~ /category/ ) ; |
270 |
$colfilter[0] = @$filters[9] if ($column =~ $itype ) ; |
270 |
$colfilter[0] = @$filters[9] if ($column eq $itype); |
271 |
$colfilter[0] = @$filters[10] if ($column =~ /branch/ ) ; |
271 |
$colfilter[0] = @$filters[10] if ($column =~ /branch/ ) ; |
272 |
$colfilter[0] = @$filters[11] if ($column =~ /sort1/ ) ; |
272 |
$colfilter[0] = @$filters[11] if ($column =~ /sort1/ ) ; |
273 |
$colfilter[0] = @$filters[12] if ($column =~ /sort2/ ) ; |
273 |
$colfilter[0] = @$filters[12] if ($column =~ /sort2/ ) ; |
Lines 301-310
sub calculate {
Link Here
|
301 |
LEFT JOIN borrowers ON borrowers.borrowernumber=old_issues.borrowernumber |
301 |
LEFT JOIN borrowers ON borrowers.borrowernumber=old_issues.borrowernumber |
302 |
LEFT JOIN items ON old_issues.itemnumber=items.itemnumber |
302 |
LEFT JOIN items ON old_issues.itemnumber=items.itemnumber |
303 |
LEFT JOIN biblioitems ON (biblioitems.biblioitemnumber=items.biblioitemnumber) |
303 |
LEFT JOIN biblioitems ON (biblioitems.biblioitemnumber=items.biblioitemnumber) |
304 |
LEFT JOIN issuingrules ON |
|
|
305 |
(issuingrules.branchcode=old_issues.branchcode |
306 |
AND issuingrules.itemtype=$itype |
307 |
AND issuingrules.categorycode=borrowers.categorycode) |
308 |
WHERE 1"; |
304 |
WHERE 1"; |
309 |
|
305 |
|
310 |
if (($line=~/timestamp/) or ($line=~/returndate/)){ |
306 |
if (($line=~/timestamp/) or ($line=~/returndate/)){ |
Lines 371-380
sub calculate {
Link Here
|
371 |
LEFT JOIN borrowers ON borrowers.borrowernumber=old_issues.borrowernumber |
367 |
LEFT JOIN borrowers ON borrowers.borrowernumber=old_issues.borrowernumber |
372 |
LEFT JOIN items ON items.itemnumber=old_issues.itemnumber |
368 |
LEFT JOIN items ON items.itemnumber=old_issues.itemnumber |
373 |
LEFT JOIN biblioitems ON (biblioitems.biblioitemnumber=items.biblioitemnumber) |
369 |
LEFT JOIN biblioitems ON (biblioitems.biblioitemnumber=items.biblioitemnumber) |
374 |
LEFT JOIN issuingrules ON |
|
|
375 |
(issuingrules.branchcode=old_issues.branchcode |
376 |
AND issuingrules.itemtype=$itype |
377 |
AND issuingrules.categorycode=borrowers.categorycode) |
378 |
WHERE 1"; |
370 |
WHERE 1"; |
379 |
|
371 |
|
380 |
if (($column=~/timestamp/) or ($column=~/returndate/)){ |
372 |
if (($column=~/timestamp/) or ($column=~/returndate/)){ |
Lines 400-412
sub calculate {
Link Here
|
400 |
|
392 |
|
401 |
my $sth2 = $dbh->prepare( $strsth2 ); |
393 |
my $sth2 = $dbh->prepare( $strsth2 ); |
402 |
|
394 |
|
403 |
if (( @colfilter ) and ($colfilter[1])){ |
395 |
$sth2->execute; |
404 |
$sth2->execute("'".$colfilter[0]."'","'".$colfilter[1]."'"); |
|
|
405 |
} elsif ($colfilter[0]) { |
406 |
$sth2->execute; |
407 |
} else { |
408 |
$sth2->execute; |
409 |
} |
410 |
|
396 |
|
411 |
while (my ($celvalue) = $sth2->fetchrow) { |
397 |
while (my ($celvalue) = $sth2->fetchrow) { |
412 |
my %cell; |
398 |
my %cell; |
Lines 441-447
sub calculate {
Link Here
|
441 |
|
427 |
|
442 |
# Processing average loanperiods |
428 |
# Processing average loanperiods |
443 |
$strcalc .= "SELECT $linefield, $colfield, "; |
429 |
$strcalc .= "SELECT $linefield, $colfield, "; |
444 |
$strcalc .= " issuedate, returndate, old_issues.timestamp, COUNT(*), date_due, old_issues.renewals, issuelength FROM `old_issues`,borrowers,biblioitems LEFT JOIN items ON (biblioitems.biblioitemnumber=items.biblioitemnumber) LEFT JOIN issuingrules ON (issuingrules.branchcode=branchcode AND issuingrules.itemtype=$itype AND issuingrules.categorycode=categorycode) WHERE old_issues.itemnumber=items.itemnumber AND old_issues.borrowernumber=borrowers.borrowernumber"; |
430 |
$strcalc .= " issuedate, returndate, COUNT(*) FROM `old_issues`,borrowers,biblioitems LEFT JOIN items ON (biblioitems.biblioitemnumber=items.biblioitemnumber) WHERE old_issues.itemnumber=items.itemnumber AND old_issues.borrowernumber=borrowers.borrowernumber"; |
445 |
|
431 |
|
446 |
@$filters[0]=~ s/\*/%/g if (@$filters[0]); |
432 |
@$filters[0]=~ s/\*/%/g if (@$filters[0]); |
447 |
$strcalc .= " AND old_issues.timestamp > '" . @$filters[0] ."'" if ( @$filters[0] ); |
433 |
$strcalc .= " AND old_issues.timestamp > '" . @$filters[0] ."'" if ( @$filters[0] ); |
448 |
- |
|
|