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

This reverts commit 73d6cdb259.

Reason for revert: not needed to support windows line terminator

Change-Id: Icce72b4d9f971da1747f5dd27a4916398c016c92
mr10.1
Rene Krenn 4 years ago
parent 41a647f55c
commit cd99dc55d2

@ -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();
@ -309,12 +308,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