View | Details | Raw Unified | Return to bug 14946
Collapse All | Expand All

(-)a/acqui/finishreceive.pl (+1 lines)
Lines 62-67 my $bookfund = $input->param("bookfund"); Link Here
62
my $order            = GetOrder($ordernumber);
62
my $order            = GetOrder($ordernumber);
63
my $new_ordernumber  = $ordernumber;
63
my $new_ordernumber  = $ordernumber;
64
64
65
# Default $datereceived to today if empty or if invalid date given by user input
65
my $datereceived_dt = eval { dt_from_string( $datereceived) };
66
my $datereceived_dt = eval { dt_from_string( $datereceived) };
66
$datereceived_dt = dt_from_string unless ( $datereceived_dt );
67
$datereceived_dt = dt_from_string unless ( $datereceived_dt );
67
$datereceived = output_pref( { dt => $datereceived_dt , dateonly => 1, dateformat => 'iso' } ) ;
68
$datereceived = output_pref( { dt => $datereceived_dt , dateonly => 1, dateformat => 'iso' } ) ;
(-)a/acqui/histsearch.pl (-2 / +2 lines)
Lines 126-133 if ($do_search) { Link Here
126
    );
126
    );
127
}
127
}
128
128
129
my $from_date = output_pref( { dt => $from_placed_on, dateformat => 'iso',  dateonly => 1 } );
129
my $from_date = output_pref( { dt => $from_placed_on,  dateonly => 1 } );
130
my $to_date = output_pref( { dt => $to_placed_on, dateformat => 'iso',  dateonly => 1 } );
130
my $to_date = output_pref( { dt => $to_placed_on,  dateonly => 1 } );
131
131
132
my $budgetperiods = C4::Budgets::GetBudgetPeriods;
132
my $budgetperiods = C4::Budgets::GetBudgetPeriods;
133
my $bp_loop = $budgetperiods;
133
my $bp_loop = $budgetperiods;
(-)a/acqui/invoice.pl (-4 / +15 lines)
Lines 83-96 elsif ( $op && $op eq 'mod' ) { Link Here
83
    my $shipmentdate       = '';
83
    my $shipmentdate       = '';
84
    my $billingdate        = '';
84
    my $billingdate        = '';
85
85
86
    # Set following dates to undef if date input is an invalid date,
86
    if ( $input->param('shipmentdate') ) {
87
    if ( $input->param('shipmentdate') ) {
87
        $shipmentdate = eval { dt_from_string( $input->param('shipmentdate') ) };
88
        my $shipmentdate_dt = eval { dt_from_string( $input->param('shipmentdate') ) };
88
        $shipmentdate = output_pref( { dt => $shipmentdate, dateformat => 'iso',  dateonly => 1 } ) if ( $shipmentdate );
89
        if ( $shipmentdate_dt ) {
90
            $shipmentdate = output_pref( { dt => $shipmentdate_dt, dateformat => 'iso',  dateonly => 1 } )
91
        }
92
        else {
93
            $shipmentdate = undef;
94
        }
89
    }
95
    }
90
96
91
    if ( $input->param('billingdate') ) {
97
    if ( $input->param('billingdate') ) {
92
        $billingdate = eval { dt_from_string( $input->param('billingdate') ) };
98
        my $billingdate_dt = eval { dt_from_string( $input->param('billingdate') ) };
93
        $billingdate = output_pref( { dt => $billingdate, dateformat => 'iso',  dateonly => 1 } ) if ( $billingdate );
99
        if ( $billingdate_dt ) {
100
            $billingdate = output_pref( { dt => $billingdate_dt, dateformat => 'iso',  dateonly => 1 } );
101
        }
102
        else {
103
            $billingdate = undef;
104
        }
94
    }
105
    }
95
106
96
    ModInvoice(
107
    ModInvoice(
(-)a/acqui/invoices.pl (-9 / +5 lines)
Lines 66-76 my $op = $input->param('op'); Link Here
66
66
67
my $invoices = [];
67
my $invoices = [];
68
68
69
my $shipmentdatefrom_iso = '';
69
my ( $shipmentdatefrom_iso, $shipmentdateto_iso, $billingdatefrom_iso, $billingdateto_iso );
70
my $shipmentdateto_iso = '';
71
my $billingdatefrom_iso = '';
72
my $billingdateto_iso = '';
73
74
70
75
if ( $op and $op eq 'do_search' ) {
71
if ( $op and $op eq 'do_search' ) {
76
72
Lines 160-169 $template->param( Link Here
160
    invoicenumber    => $invoicenumber,
156
    invoicenumber    => $invoicenumber,
161
    booksellerid     => $supplierid,
157
    booksellerid     => $supplierid,
162
    suppliername     => $suppliername,
158
    suppliername     => $suppliername,
163
    shipmentdatefrom => $shipmentdatefrom_iso,
159
    shipmentdatefrom => $shipmentdatefrom,
164
    shipmentdateto   => $shipmentdateto_iso,
160
    shipmentdateto   => $shipmentdateto,
165
    billingdatefrom  => $billingdatefrom_iso,
161
    billingdatefrom  => $billingdatefrom,
166
    billingdateto    => $billingdateto_iso,
162
    billingdateto    => $billingdateto,
167
    isbneanissn      => $isbneanissn,
163
    isbneanissn      => $isbneanissn,
168
    title            => $title,
164
    title            => $title,
169
    author           => $author,
165
    author           => $author,
(-)a/acqui/orderreceive.pl (-4 / +1 lines)
Lines 73-78 use C4::Branch; # GetBranches Link Here
73
use C4::Items;
73
use C4::Items;
74
use C4::Biblio;
74
use C4::Biblio;
75
use C4::Suggestions;
75
use C4::Suggestions;
76
use Koha::Acquisition::Bookseller;
76
77
77
use Koha::DateUtils;
78
use Koha::DateUtils;
78
79
Lines 193-201 my $budget = GetBudget( $order->{budget_id} ); Link Here
193
194
194
my $datereceived = $order->{datereceived} ? dt_from_string( $order->{datereceived} ) : dt_from_string;
195
my $datereceived = $order->{datereceived} ? dt_from_string( $order->{datereceived} ) : dt_from_string;
195
196
196
my $orderentrydate =  eval{ dt_from_string( $order->{entrydate} ); };
197
$orderentrydate = output_pref( { dt => $orderentrydate, dateonly => 1 } ) if ( $orderentrydate );
198
199
$template->param(
197
$template->param(
200
    AcqCreateItem         => $AcqCreateItem,
198
    AcqCreateItem         => $AcqCreateItem,
201
    count                 => 1,
199
    count                 => 1,
Lines 205-211 $template->param( Link Here
205
    booksellerid          => $order->{'booksellerid'},
203
    booksellerid          => $order->{'booksellerid'},
206
    freight               => $freight,
204
    freight               => $freight,
207
    name                  => $bookseller->{'name'},
205
    name                  => $bookseller->{'name'},
208
    date                  => $orderentrydate,
209
    title                 => $order->{'title'},
206
    title                 => $order->{'title'},
210
    author                => $order->{'author'},
207
    author                => $order->{'author'},
211
    copyrightdate         => $order->{'copyrightdate'},
208
    copyrightdate         => $order->{'copyrightdate'},
(-)a/acqui/parcels.pl (-28 / +4 lines)
Lines 89-117 my $resultsperpage = $input->param('resultsperpage'); Link Here
89
my $op             = $input->param('op');
89
my $op             = $input->param('op');
90
$resultsperpage ||= 20;
90
$resultsperpage ||= 20;
91
91
92
my $datefrom_iso = '';
93
my $dateto_iso = '';
94
95
if ( $datefrom ) {
96
    $datefrom_iso = eval { dt_from_string( $datefrom ) };
97
    if ($datefrom_iso ) {
98
        $datefrom_iso = output_pref( { dt => $datefrom_iso, dateformat => 'iso',  dateonly => 1 } );
99
    }
100
    else {
101
        $datefrom = '';
102
    }
103
}
104
105
if ( $dateto ) {
106
    $dateto_iso = eval { dt_from_string( $dateto ) };
107
    if ($dateto_iso ) {
108
        $dateto_iso = output_pref( { dt => $dateto_iso, dateformat => 'iso',  dateonly => 1 } );
109
    }
110
    else {
111
        $dateto = '';
112
    }
113
}
114
115
our ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
92
our ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
116
    {   template_name   => 'acqui/parcels.tt',
93
    {   template_name   => 'acqui/parcels.tt',
117
        query           => $input,
94
        query           => $input,
Lines 169-176 my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid }); Link Here
169
my @parcels = GetInvoices(
146
my @parcels = GetInvoices(
170
    supplierid       => $booksellerid,
147
    supplierid       => $booksellerid,
171
    invoicenumber    => $code,
148
    invoicenumber    => $code,
172
    shipmentdatefrom => $datefrom_iso,
149
    shipmentdatefrom => ( $datefrom ? ( shipmentdatefrom => output_pref( { dt => dt_from_string($datefrom), dateformat => 'iso' } ) ) : () ),
173
    shipmentdateto   => $dateto_iso,
150
    shipmentdateto   => ( $dateto ? ( shipmentdateto => output_pref( { dt => dt_from_string($dateto), dateformat => 'iso' } ) ) : () ),
174
    order_by         => $order
151
    order_by         => $order
175
);
152
);
176
my $count_parcels = @parcels;
153
my $count_parcels = @parcels;
Lines 226-233 foreach my $r (@{$budgets}) { Link Here
226
$template->param(
203
$template->param(
227
    orderby                  => $order,
204
    orderby                  => $order,
228
    filter                   => $code,
205
    filter                   => $code,
229
    datefrom                 => $datefrom,
206
    ( $datefrom ? ( shipmentdatefrom => output_pref({ dt => dt_from_string($datefrom), dateformat => 'iso' }) ) : () ),
230
    dateto                   => $dateto,
207
    ( $dateto   ? ( shipmentdateto   => output_pref({ dt => dt_from_string($dateto),   dateformat => 'iso' }) ) : () ),
231
    resultsperpage           => $resultsperpage,
208
    resultsperpage           => $resultsperpage,
232
    name                     => $bookseller->{'name'},
209
    name                     => $bookseller->{'name'},
233
    shipmentdate_today       => output_pref( { dt => dt_from_string, dateonly =>1 } ),
210
    shipmentdate_today       => output_pref( { dt => dt_from_string, dateonly =>1 } ),
234
- 

Return to bug 14946