Lines 235-241
sub calculate {
Link Here
|
235 |
$linefilter[2] = @$filters[6] if ($line =~ /returndate/ ) ; |
235 |
$linefilter[2] = @$filters[6] if ($line =~ /returndate/ ) ; |
236 |
$linefilter[3] = @$filters[7] if ($line =~ /returndate/ ) ; |
236 |
$linefilter[3] = @$filters[7] if ($line =~ /returndate/ ) ; |
237 |
$linefilter[0] = @$filters[8] if ($line =~ /category/ ) ; |
237 |
$linefilter[0] = @$filters[8] if ($line =~ /category/ ) ; |
238 |
$linefilter[0] = @$filters[9] if ($line =~ /itemtype/ ) ; |
238 |
$linefilter[0] = @$filters[9] if ($line eq $itype); |
239 |
$linefilter[0] = @$filters[10] if ($line =~ /branch/ ) ; |
239 |
$linefilter[0] = @$filters[10] if ($line =~ /branch/ ) ; |
240 |
$linefilter[0] = @$filters[11] if ($line =~ /sort1/ ) ; |
240 |
$linefilter[0] = @$filters[11] if ($line =~ /sort1/ ) ; |
241 |
$linefilter[0] = @$filters[12] if ($line =~ /sort2/ ) ; |
241 |
$linefilter[0] = @$filters[12] if ($line =~ /sort2/ ) ; |
Lines 252-258
sub calculate {
Link Here
|
252 |
$colfilter[2] = @$filters[6] if ($column =~ /returndate/ ) ; |
252 |
$colfilter[2] = @$filters[6] if ($column =~ /returndate/ ) ; |
253 |
$colfilter[3] = @$filters[7] if ($column =~ /returndate/ ) ; |
253 |
$colfilter[3] = @$filters[7] if ($column =~ /returndate/ ) ; |
254 |
$colfilter[0] = @$filters[8] if ($column =~ /category/ ) ; |
254 |
$colfilter[0] = @$filters[8] if ($column =~ /category/ ) ; |
255 |
$colfilter[0] = @$filters[9] if ($column =~ $itype ) ; |
255 |
$colfilter[0] = @$filters[9] if ($column eq $itype); |
256 |
$colfilter[0] = @$filters[10] if ($column =~ /branch/ ) ; |
256 |
$colfilter[0] = @$filters[10] if ($column =~ /branch/ ) ; |
257 |
$colfilter[0] = @$filters[11] if ($column =~ /sort1/ ) ; |
257 |
$colfilter[0] = @$filters[11] if ($column =~ /sort1/ ) ; |
258 |
$colfilter[0] = @$filters[12] if ($column =~ /sort2/ ) ; |
258 |
$colfilter[0] = @$filters[12] if ($column =~ /sort2/ ) ; |
Lines 286-295
sub calculate {
Link Here
|
286 |
LEFT JOIN borrowers ON borrowers.borrowernumber=old_issues.borrowernumber |
286 |
LEFT JOIN borrowers ON borrowers.borrowernumber=old_issues.borrowernumber |
287 |
LEFT JOIN items ON old_issues.itemnumber=items.itemnumber |
287 |
LEFT JOIN items ON old_issues.itemnumber=items.itemnumber |
288 |
LEFT JOIN biblioitems ON (biblioitems.biblioitemnumber=items.biblioitemnumber) |
288 |
LEFT JOIN biblioitems ON (biblioitems.biblioitemnumber=items.biblioitemnumber) |
289 |
LEFT JOIN issuingrules ON |
|
|
290 |
(issuingrules.branchcode=old_issues.branchcode |
291 |
AND issuingrules.itemtype=$itype |
292 |
AND issuingrules.categorycode=borrowers.categorycode) |
293 |
WHERE 1"; |
289 |
WHERE 1"; |
294 |
|
290 |
|
295 |
if (($line=~/timestamp/) or ($line=~/returndate/)){ |
291 |
if (($line=~/timestamp/) or ($line=~/returndate/)){ |
Lines 356-365
sub calculate {
Link Here
|
356 |
LEFT JOIN borrowers ON borrowers.borrowernumber=old_issues.borrowernumber |
352 |
LEFT JOIN borrowers ON borrowers.borrowernumber=old_issues.borrowernumber |
357 |
LEFT JOIN items ON items.itemnumber=old_issues.itemnumber |
353 |
LEFT JOIN items ON items.itemnumber=old_issues.itemnumber |
358 |
LEFT JOIN biblioitems ON (biblioitems.biblioitemnumber=items.biblioitemnumber) |
354 |
LEFT JOIN biblioitems ON (biblioitems.biblioitemnumber=items.biblioitemnumber) |
359 |
LEFT JOIN issuingrules ON |
|
|
360 |
(issuingrules.branchcode=old_issues.branchcode |
361 |
AND issuingrules.itemtype=$itype |
362 |
AND issuingrules.categorycode=borrowers.categorycode) |
363 |
WHERE 1"; |
355 |
WHERE 1"; |
364 |
|
356 |
|
365 |
if (($column=~/timestamp/) or ($column=~/returndate/)){ |
357 |
if (($column=~/timestamp/) or ($column=~/returndate/)){ |
Lines 385-397
sub calculate {
Link Here
|
385 |
|
377 |
|
386 |
my $sth2 = $dbh->prepare( $strsth2 ); |
378 |
my $sth2 = $dbh->prepare( $strsth2 ); |
387 |
|
379 |
|
388 |
if (( @colfilter ) and ($colfilter[1])){ |
380 |
$sth2->execute; |
389 |
$sth2->execute("'".$colfilter[0]."'","'".$colfilter[1]."'"); |
|
|
390 |
} elsif ($colfilter[0]) { |
391 |
$sth2->execute; |
392 |
} else { |
393 |
$sth2->execute; |
394 |
} |
395 |
|
381 |
|
396 |
while (my ($celvalue) = $sth2->fetchrow) { |
382 |
while (my ($celvalue) = $sth2->fetchrow) { |
397 |
my %cell; |
383 |
my %cell; |
Lines 426-432
sub calculate {
Link Here
|
426 |
|
412 |
|
427 |
# Processing average loanperiods |
413 |
# Processing average loanperiods |
428 |
$strcalc .= "SELECT $linefield, $colfield, "; |
414 |
$strcalc .= "SELECT $linefield, $colfield, "; |
429 |
$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"; |
415 |
$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"; |
430 |
|
416 |
|
431 |
@$filters[0]=~ s/\*/%/g if (@$filters[0]); |
417 |
@$filters[0]=~ s/\*/%/g if (@$filters[0]); |
432 |
$strcalc .= " AND old_issues.timestamp > '" . @$filters[0] ."'" if ( @$filters[0] ); |
418 |
$strcalc .= " AND old_issues.timestamp > '" . @$filters[0] ."'" if ( @$filters[0] ); |
433 |
- |
|
|