Browse Source

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 <nicole@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
3.20.x
Jonathan Druart 10 years ago
committed by Tomas Cohen Arazi
parent
commit
30a8843529
  1. 6
      acqui/parcels.pl
  2. 4
      koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt

6
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;

4
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt

@ -209,8 +209,8 @@
<ol>
<li> <input type="hidden" name="booksellerid" value="[% booksellerid %]" /></li>
<li><label for="filter">Invoice number:</label><input type="text" size="20" name="filter" value="[% filter %]" id="filter" /></li>
<li><label for="datefrom">From:</label><input type="text" size="9" id="datefrom" name="datefrom" value="[% datefrom %]" /><br />
<label for="dateto">To:</label><input type="text" size="9" id="dateto" name="dateto" value="[% dateto %]" /></li>
<li><label for="datefrom">From:</label><input type="text" size="9" id="datefrom" name="datefrom" value="[% datefrom %]" class="datepicker" /><br />
<label for="dateto">To:</label><input type="text" size="9" id="dateto" name="dateto" value="[% dateto %]" class="datepicker" /></li>
<li><label for="orderby">Sort by :</label><select name="orderby" id="orderby">
<option value="invoicenumber">Invoice number</option>
<option value="shipmentdate">Shipment date</option>

Loading…
Cancel
Save