@@ -, +, @@ - Makes relevant the date entered at the top (Set Inventory date to). - Makes relevant the date entered at the bottow (Inventory date). - Doesn't brake most functionalities. - Doesn't fix any of the many other bugs and issues with this broken tool. - remove a warning that was flooding the logs on every call. - Just makes the UI intuitive for common usage regarding dates. - set item.datelastseen to some date in the past - Datelastseen specified at the top is the one you entered. - Date Last Seen in the table is the old from the DB - item.datelastseen is now today - item.datelastseen is now the date you entered. --- tools/inventory.pl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) --- a/tools/inventory.pl +++ a/tools/inventory.pl @@ -46,7 +46,7 @@ $maxlocation=$minlocation.'Z' unless ( $maxlocation || ! $minlocation ); my $location=$input->param('location') || ''; my $itemtype=$input->param('itemtype'); # FIXME note, template does not currently supply this my $ignoreissued=$input->param('ignoreissued'); -my $datelastseen = $input->param('datelastseen'); +my $datelastseen = $input->param('datelastseen') || $input->param('setdate'); my $markseen = $input->param('markseen'); my $branchcode = $input->param('branchcode') || ''; my $branch = $input->param('branch'); @@ -277,10 +277,9 @@ if ( $markseen or $op ) { } # If "compare barcodes list to results" has been checked, we want to alert for missing items +my $dls = output_pref( { dt => dt_from_string( $datelastseen ), dateformat => 'iso' } ); if ( $compareinv2barcd ) { # set "missing" flags for all items with a datelastseen (dls) before the chosen datelastseen (cdls) - my $dls = output_pref( { dt => dt_from_string( $datelastseen ), - dateformat => 'iso' } ); foreach my $item ( @$inventorylist ) { my $cdls = output_pref( { dt => dt_from_string( $item->{datelastseen} ), dateformat => 'iso' } ); @@ -298,7 +297,6 @@ if ( $compareinv2barcd ) { # note this list is always displayed, whatever the librarian has chosen for comparison my $moddatecount = 0; foreach my $item ( @scanned_items ) { - # Saving notforloan code before it's replaced by it's authorised value for later comparison $item->{notforloancode} = $item->{notforloan}; @@ -323,13 +321,13 @@ foreach my $item ( @scanned_items ) { $item->{problem} = 'changestatus'; push @items_with_problems, { %$item }; } - if (none { $item->{barcode} eq $_->{barcode} && !$_->{'onloan'} } @$wrongplacelist) { + if (none { $_->{barcode} && $item->{barcode} eq $_->{barcode} && !$_->{'onloan'} } @$wrongplacelist) { $item->{problem} = 'wrongplace'; push @items_with_problems, { %$item }; } # Modify date last seen for scanned items - ModDateLastSeen($item->{'itemnumber'}); + ModItem({ itemlost => 0, datelastseen => $dls }, undef, $item->{'itemnumber'}); $moddatecount++; } --