diff --git a/tools/inventory.pl b/tools/inventory.pl index 632968219d..b16238c2f1 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -151,8 +151,8 @@ my @errorloop; my $moddatecount = 0; if ( ($uploadbarcodes && length($uploadbarcodes) > 0) || ($barcodelist && length($barcodelist) > 0) ) { my $dbh = C4::Context->dbh; - my $date = dt_from_string( scalar $input->param('setdate') ); - $date = output_pref ( { dt => $date, dateformat => 'iso' } ); + my $date = $input->param('setdate'); + my $date_dt = dt_from_string($date); my $strsth = "select * from issues, items where items.itemnumber=issues.itemnumber and items.barcode =?"; my $qonloan = $dbh->prepare($strsth); @@ -209,7 +209,7 @@ if ( ($uploadbarcodes && length($uploadbarcodes) > 0) || ($barcodelist && length my $item = Koha::Items->find({barcode => $barcode}); if ( $item ) { # Modify date last seen for scanned items, remove lost status - $item->set({ itemlost => 0, datelastseen => $date })->store; + $item->set({ itemlost => 0, datelastseen => $date_dt })->store; my $item_unblessed = $item->unblessed; $moddatecount++; unless ( $dont_checkin ) { @@ -231,7 +231,7 @@ if ( ($uploadbarcodes && length($uploadbarcodes) > 0) || ($barcodelist && length } } } - $template->param( date => $date ); + $template->param( date => output_pref ( { str => $date, dateformat => 'iso' } ) ); $template->param( errorloop => \@errorloop ) if (@errorloop); }