@@ -, +, @@ handle windows file uploads $barcode = ; $barcode =~ s/\r/\n/g; $barcode =~ s/\n\n/\n/g; my @data = split(/\n/, $barcode); push @uploadedbarcodes,@data; --------- 1) Back up your database 2) Download the three sample files (or create your own) 3) Log in to staff client 4) Create a branch with no inventory. 5) Home -> Tools -> Inventory/Stocktaking 6) Browse for your '\r' test file. 7) Limit to just that branch 8) Click 'Submit' -- Confirm expected errors 9) Repeat steps 5-8 with the '\n' test file. -- one of these repetitions should have problems. -- there should be no issues. I have reset it to needs sign off again. --- tools/inventory.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- a/tools/inventory.pl +++ a/tools/inventory.pl @@ -161,6 +161,7 @@ if ( $uploadbarcodes && length($uploadbarcodes) > 0 ) { my $count = 0; my @barcodes; + my @uploadedbarcodes; my $sth = $dbh->column_info(undef,undef,"items","barcode"); my $barcode_def = $sth->fetchall_hashref('COLUMN_NAME'); @@ -169,8 +170,13 @@ if ( $uploadbarcodes && length($uploadbarcodes) > 0 ) { my $err_data=0; my $lines_read=0; binmode($uploadbarcodes, ":encoding(UTF-8)"); - while (my $barcode=<$uploadbarcodes>){ - $barcode =~ s/\r?\n$//; + while (my $barcode=<$uploadbarcodes>) { + $barcode =~ s/\r/\n/g; + $barcode =~ s/\n\n/\n/g; + my @data = split(/\n/,$barcode); + push @uploadedbarcodes, @data; + } + for my $barcode (@uploadedbarcodes) { next unless $barcode; ++$lines_read; if (length($barcode)>$barcode_size) { --