Revert "TT#144300 accept Windows .csv file uploads"

This reverts commit 5445c72cc7.

Reason for revert: not needed to support windows line terminator

Change-Id: I00f22993e17ec7c9bcb6ee331d07b6da0495586a
mr10.3
Rene Krenn 4 years ago
parent 5d9618e642
commit 8fac1ef383

@ -8,7 +8,6 @@ use NGCP::Schema;
use NGCP::Panel::Utils::Preferences qw();
use NGCP::Panel::Utils::DateTime;
use DateTime::Format::Strptime qw();
use NGCP::Panel::Utils::Generic qw(trim);
use NGCP::Panel::Utils::IntervalTree::Simple;
@ -236,13 +235,11 @@ sub process_billing_fees{
my $linenum = 0;
my @fees = ();
my %zones = ();
local $/ = "/n";
open(my $fh, '<:encoding(utf8)', $data);
#to don't stop on first failed parse - don't use "while($csv->getline)"
while ( my $line = <$fh> ){
++$linenum;
next unless length $line;
$line = trim($line);
unless($csv->parse($line)) {
push @fails, $linenum;
next;

@ -166,13 +166,11 @@ sub upload_csv {
$c->model('DB')->txn_do(sub {
local $/ = "/n";
open(my $fh, '<:encoding(utf8)', $data);
while ( my $line = <$fh> ){
++$linenum;
next unless length $line;
$line = trim($line);
unless($csv->parse($line)) {
push @fails, $linenum;
next;

@ -28,7 +28,6 @@ use NGCP::Panel::Utils::ProfilePackages qw();
use NGCP::Panel::Utils::Subscriber qw();
use NGCP::Panel::Utils::Preferences qw();
use NGCP::Panel::Utils::Kamailio qw();
use NGCP::Panel::Utils::Generic qw(trim);
use JE::Destroyer qw();
use JE qw();
@ -317,12 +316,10 @@ sub process_csv {
c => $c,
purge => $purge,
);
local $/ = "/n";
open(my $fh, '<:encoding(utf8)', $data);
while ( my $line = <$fh> ){
++$linenum;
next unless length $line;
$line = trim($line);
unless($csv->parse($line)) {
push(@fails,{ linenum => $linenum, });
next;

Loading…
Cancel
Save