[freeside-commits] branch FREESIDE_2_3_BRANCH updated. b1a9256d101cc8e0e69239e84b3049c66600cc00
Mark Wells
mark at 420.am
Fri Feb 8 11:02:44 PST 2013
The branch, FREESIDE_2_3_BRANCH has been updated
via b1a9256d101cc8e0e69239e84b3049c66600cc00 (commit)
from 47f7a3e61064184284833ba0e9c59e34e16d1678 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b1a9256d101cc8e0e69239e84b3049c66600cc00
Author: Mark Wells <mark at freeside.biz>
Date: Fri Feb 8 11:00:50 2013 -0800
file format quirk, #18333
diff --git a/FS/bin/freeside-ipifony-download b/FS/bin/freeside-ipifony-download
index 837cc33..12c2dc6 100755
--- a/FS/bin/freeside-ipifony-download
+++ b/FS/bin/freeside-ipifony-download
@@ -9,6 +9,7 @@ use FS::UID qw(adminsuidsetup);
use FS::Record qw(qsearch qsearchs);
use FS::cust_main;
use FS::Conf;
+use File::Copy qw(copy);
use Text::CSV;
my %opt;
@@ -159,11 +160,6 @@ FILE: foreach my $filename (@$files) {
}
open my $fh, "<$tmpdir/$filename";
- my $header = <$fh>;
- if ($header !~ /^"cust_id"/) {
- warn "warning: $filename has incorrect header row:\n$header\n";
- # but try anyway
- }
my $csv = Text::CSV->new; # orthodox CSV
my %hash;
while (my $line = <$fh>) {
@@ -172,6 +168,11 @@ FILE: foreach my $filename (@$files) {
next FILE;
};
@hash{@fields} = $csv->fields();
+ if ( $hash{custnum} =~ /^cust/ ) {
+ # there appears to be a header row
+ print STDERR "skipping header row\n" if $opt{v};
+ next;
+ }
my $cust_main =
$cust_main{$hash{custnum}} ||= FS::cust_main->by_key($hash{custnum});
if (!$cust_main) {
-----------------------------------------------------------------------
Summary of changes:
FS/bin/freeside-ipifony-download | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
More information about the freeside-commits
mailing list