-my $from_placed_on = C4::Dates->new($input->param('from'));
-my $to_placed_on = C4::Dates->new($input->param('to'));
-if ( not $input->param('from') ) {
- # FIXME Dirty but we can't sent a Date::Calc to C4::Dates ?
- # We would use a function like Add_Delta_YM(-1, 0, 0);
- $$from_placed_on{dmy_arrayref}[5] -= 1;
+my $budget = $input->param( 'budget' );
+my $orderstatus = $input->param( 'orderstatus' );
+my $ordernumber = $input->param( 'ordernumber' );
+my $search_children_too = $input->param( 'search_children_too' );
+my @created_by = $input->multi_param('created_by');
+
+my $from_placed_on = eval { dt_from_string( scalar $input->param('from') ) } || dt_from_string;
+my $to_placed_on = eval { dt_from_string( scalar $input->param('to') ) } || dt_from_string;
+unless ( $input->param('from') ) {
+ # Fill the form with year-1
+ $from_placed_on->subtract( years => 1 );