X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=acqui%2Finvoices.pl;h=48adb80686f9e56fc3d6bbe254ec31e9c7cacf51;hb=00bb0b6d57f418f51c595eea33cd9da264481eb7;hp=6542b1818df90bc6b846201d2393f882f95c1507;hpb=e20270fec4f6d34f01050bea4c5765d5b3c4ed33;p=srvgit diff --git a/acqui/invoices.pl b/acqui/invoices.pl index 6542b1818d..48adb80686 100755 --- a/acqui/invoices.pl +++ b/acqui/invoices.pl @@ -3,18 +3,18 @@ # Copyright 2011 BibLibre SARL # This file is part of Koha. # -# Koha is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. # -# Koha is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR -# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License along -# with Koha; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . =head1 NAME @@ -36,6 +36,7 @@ use C4::Output; use C4::Acquisition qw/GetInvoices/; use C4::Branch qw/GetBranches/; use C4::Budgets; +use Koha::DateUtils; my $input = CGI->new; my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( @@ -63,19 +64,20 @@ my $publicationyear = $input->param('publicationyear'); my $branch = $input->param('branch'); my $op = $input->param('op'); +$shipmentdatefrom and $shipmentdatefrom = eval { dt_from_string( $shipmentdatefrom ) }; +$shipmentdateto and $shipmentdateto = eval { dt_from_string( $shipmentdateto ) }; +$billingdatefrom and $billingdatefrom = eval { dt_from_string( $billingdatefrom ) }; +$billingdateto and $billingdateto = eval { dt_from_string( $billingdateto ) }; + my $invoices = []; if ( $op and $op eq 'do_search' ) { - my $shipmentdatefrom_iso = C4::Dates->new($shipmentdatefrom)->output('iso'); - my $shipmentdateto_iso = C4::Dates->new($shipmentdateto)->output('iso'); - my $billingdatefrom_iso = C4::Dates->new($billingdatefrom)->output('iso'); - my $billingdateto_iso = C4::Dates->new($billingdateto)->output('iso'); @{$invoices} = GetInvoices( invoicenumber => $invoicenumber, supplierid => $supplierid, - shipmentdatefrom => $shipmentdatefrom_iso, - shipmentdateto => $shipmentdateto_iso, - billingdatefrom => $billingdatefrom_iso, - billingdateto => $billingdateto_iso, + shipmentdatefrom => $shipmentdatefrom ? output_pref( { str => $shipmentdatefrom, dateformat => 'iso' } ) : undef, + shipmentdateto => $shipmentdateto ? output_pref( { str => $shipmentdateto, dateformat => 'iso' } ) : undef, + billingdatefrom => $billingdatefrom ? output_pref( { str => $billingdatefrom, dateformat => 'iso' } ) : undef, + billingdateto => $billingdateto ? output_pref( { str => $billingdateto, dateformat => 'iso' } ) : undef, isbneanissn => $isbneanissn, title => $title, author => $author, @@ -135,6 +137,8 @@ $template->param( invoicenumber => $invoicenumber, booksellerid => $supplierid, suppliername => $suppliername, + shipmentdatefrom => $shipmentdatefrom, + shipmentdateto => $shipmentdateto, billingdatefrom => $billingdatefrom, billingdateto => $billingdateto, isbneanissn => $isbneanissn,