From 9c8f412a367ae2c6ebc649ad31bc517657da3200 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 6 Jan 2015 16:35:48 +0100 Subject: [PATCH] [PASSED QA] Bug 4402: Date filter on parcels.tt required db date format The date filters on the parcel page would only work with dates formatted YYYY-MM-DD. To test: - Select a vendor, that already has a few invoices - "Receive shipment" - you are on the parcels page - Use the From and To filters on the left, notice there is now a date picker on those fields - Verify the search works correctly for different date formats Signed-off-by: Nicole Signed-off-by: Katrin Fischer --- acqui/parcels.pl | 6 +++--- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/acqui/parcels.pl b/acqui/parcels.pl index ba91abd..3985ae0 100755 --- a/acqui/parcels.pl +++ b/acqui/parcels.pl @@ -72,11 +72,11 @@ use CGI qw ( -utf8 ); use C4::Auth; use C4::Output; -use C4::Dates qw/format_date/; use C4::Acquisition; use C4::Budgets; use Koha::Acquisition::Bookseller; +use Koha::DateUtils qw( output_pref dt_from_string ); my $input = CGI->new; my $booksellerid = $input->param('booksellerid'); @@ -145,8 +145,8 @@ my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid }); my @parcels = GetInvoices( supplierid => $booksellerid, invoicenumber => $code, - shipmentdatefrom => $datefrom, - shipmentdateto => $dateto, + ( $datefrom ? ( shipmentdatefrom => output_pref({ dt => dt_from_string($datefrom), dateformat => 'iso' }) ) : () ), + ( $dateto ? ( shipmentdateto => output_pref({ dt => dt_from_string($dateto), dateformat => 'iso' }) ) : () ), order_by => $order ); my $count_parcels = @parcels; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt index 147a26f..e446c0c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt @@ -209,8 +209,8 @@
  1. -

  2. -
  3. +

  4. +