Browse Source

Bug 3224 : inventory tool fails on DOS newlines

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
3.2.x
Ryan Higgins 15 years ago
committed by Galen Charlton
parent
commit
890f673d64
  1. 7
      tools/inventory.pl

7
tools/inventory.pl

@ -118,18 +118,17 @@ if ($uploadbarcodes && length($uploadbarcodes)>0){
# warn "$date";
my $strsth="select * from issues, items where items.itemnumber=issues.itemnumber and items.barcode =?";
my $qonloan = $dbh->prepare($strsth);
$strsth="select * from items where items.barcode =? and issues.wthdrawn=1";
$strsth="select * from items where items.barcode =? and items.wthdrawn = 1";
my $qwthdrawn = $dbh->prepare($strsth);
my @errorloop;
my $count=0;
while (my $barcode=<$uploadbarcodes>){
chomp $barcode;
# warn "$barcode";
$barcode =~ s/\r?\n$//;
if ($qwthdrawn->execute($barcode) &&$qwthdrawn->rows){
push @errorloop, {'barcode'=>$barcode,'ERR_WTHDRAWN'=>1};
}else{
my $item = GetItem('', $barcode);
if (defined $item){
if (defined $item && $item->{'itemnumber'}){
ModItem({ datelastseen => $date }, undef, $item->{'itemnumber'});
$count++;
$qonloan->execute($barcode);

Loading…
Cancel
Save