@@ -, +, @@ Koha::DateUtils and Koha::ItemTypes --- reports/suggestions_stats.pl | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) --- a/reports/suggestions_stats.pl +++ a/reports/suggestions_stats.pl @@ -27,8 +27,7 @@ use C4::Output; use C4::Branch; use C4::Budgets; use C4::Category; -use C4::Dates qw/format_date format_date_in_iso/; -use C4::ItemType; +use Koha::DateUtils qw/output_pref dt_from_string/; use C4::Koha; use C4::Reports; @@ -123,7 +122,7 @@ foreach my $branch (@$branches) { $display_values->{branchcode}->{$branchcode} = $branch->{branchname}; } -my @itemtypes = C4::ItemType->all; +my @itemtypes = Koha::ItemTypes->search; foreach my $itemtype (@itemtypes) { my $itype = $itemtype->itemtype; $display_values->{itemtype}->{$itype} = $itemtype->description; @@ -184,11 +183,15 @@ sub calculate { foreach my $filter (qw(suggesteddate rejecteddate ordereddate)) { if ($filters->{"${filter}_from"}) { push @conditions, "$filter >= ?"; - push @bind_values, format_date_in_iso($filters->{"${filter}_from"}); + push @bind_values, output_pref({ + dt => dt_from_string( $filters->{"${filter}_from"} ), + dateformat => 'iso', dateonly => 1 }); } if ($filters->{"${filter}_to"}) { push @conditions, "$filter <= ?"; - push @bind_values, format_date_in_iso($filters->{"${filter}_to"}); + push @bind_values, output_pref({ + dt => dt_from_string( $filters->{"${filter}_to"} ), + dateformat => 'iso', dateonly => 1 }); } } --