our $itemtypes = Koha::ItemTypes->search_with_localization->unblessed;
-our @patron_categories = Koha::Patron::Categories->search_with_library_limits({}, {order_by => ['description']});
+our @patron_categories = Koha::Patron::Categories->search_with_library_limits({}, {order_by => ['description']})->as_list;
our $locations = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' }, { order_by => ['description'] } ) };
our $ccodes = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.ccode' }, { order_by => ['description'] } ) };
( $linesource eq 'items' )
? " LEFT JOIN items ON (statistics.itemnumber = items.itemnumber) "
: " LEFT JOIN borrowers ON (statistics.borrowernumber = borrowers.borrowernumber) ";
- $strsth .= " WHERE $line is not null AND $line != '' ";
+ $strsth .= " WHERE $line IS NOT NULL ";
+ $strsth .= " AND $line != '' " if $line ne "datetime";
}
if ( $line =~ /datetime/ ) {
( $colsource eq 'items' )
? "LEFT JOIN items ON (statistics.itemnumber = items.itemnumber) "
: "LEFT JOIN borrowers ON (statistics.borrowernumber = borrowers.borrowernumber) ";
- $strsth2 .= " WHERE $column IS NOT NULL AND $column != '' ";
+ $strsth2 .= " WHERE $column IS NOT NULL";
+ $strsth2 .= " AND $column != '' " if $column ne "datetime";
}
if ( $column =~ /datetime/ ) {