Lines 30-35
use C4::Reports qw( GetDelimiterChoices );
Link Here
|
30 |
use Koha::AuthorisedValues; |
30 |
use Koha::AuthorisedValues; |
31 |
use Koha::ItemTypes; |
31 |
use Koha::ItemTypes; |
32 |
use Koha::Patron::Attribute::Types; |
32 |
use Koha::Patron::Attribute::Types; |
|
|
33 |
use Array::Utils qw( intersect ); |
33 |
|
34 |
|
34 |
=head1 NAME |
35 |
=head1 NAME |
35 |
|
36 |
|
Lines 495-501
sub calculate {
Link Here
|
495 |
$strcalc .= " LEFT JOIN borrower_attributes AS attribute_$_ ON (statistics.borrowernumber = attribute_$_.borrowernumber AND attribute_$_.code = '$_') "; |
496 |
$strcalc .= " LEFT JOIN borrower_attributes AS attribute_$_ ON (statistics.borrowernumber = attribute_$_.borrowernumber AND attribute_$_.code = '$_') "; |
496 |
} |
497 |
} |
497 |
} |
498 |
} |
498 |
$strcalc .= "LEFT JOIN (SELECT * FROM items UNION SELECT * FROM deleteditems) items ON statistics.itemnumber=items.itemnumber " |
499 |
my @listfield_items; |
|
|
500 |
my @listfield_deleteditems; |
501 |
my $colunmlist; |
502 |
my $sth3 = $dbh->prepare("SHOW COLUMNS FROM items;"); |
503 |
$sth3->execute; |
504 |
while ( (my $field) = $sth3->fetchrow_array ) { |
505 |
push @listfield_items, $field; |
506 |
} |
507 |
$sth3 = $dbh->prepare("SHOW COLUMNS FROM deleteditems;"); |
508 |
$sth3->execute; |
509 |
while ( (my $field) = $sth3->fetchrow_array ) { |
510 |
push @listfield_deleteditems, $field; |
511 |
} |
512 |
$colunmlist = join(",",intersect(@listfield_items, @listfield_deleteditems)); |
513 |
$strcalc .= "LEFT JOIN (SELECT $colunmlist FROM items UNION SELECT $colunmlist FROM deleteditems) items ON statistics.itemnumber=items.itemnumber " |
499 |
if ( $linefield =~ /^items\./ |
514 |
if ( $linefield =~ /^items\./ |
500 |
or $colfield =~ /^items\./ |
515 |
or $colfield =~ /^items\./ |
501 |
or $process == 5 |
516 |
or $process == 5 |
502 |
- |
|
|