From 8984b31987390ea2ff2dcc83fdcf7340b0531daf Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Mon, 7 Aug 2017 16:21:09 -0400 Subject: [PATCH] RT# 76992 - Added 3 new import formats that combine Location and Phone Service --- FS/FS/cust_pkg/Import.pm | 20 +++++++++++++------- httemplate/misc/cust_pkg-import.html | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/FS/FS/cust_pkg/Import.pm b/FS/FS/cust_pkg/Import.pm index 26f62f241..d3d4e8a60 100644 --- a/FS/FS/cust_pkg/Import.pm +++ b/FS/FS/cust_pkg/Import.pm @@ -286,17 +286,23 @@ sub batch_import { }; } - my $formatfields = _formatfields(); + #probably can delete below - moved to line 292 + #my $formatfields = _formatfields(); - die "unknown format $format" unless $formatfields->{$format}; + my @formats = split /-/, $format; + foreach my $f (@formats){ - foreach my $field ( @{ $formatfields->{$format} } ) { + my $formatfields = _formatfields(); + die "unknown format $format" unless $formatfields->{$f}; - push @fields, sub { - my( $self, $value, $conf, $param ) = @_; - $param->{"$format.$field"} = $value; - }; + foreach my $field ( @{ $formatfields->{$f} } ) { + push @fields, sub { + my( $self, $value, $conf, $param ) = @_; + $param->{"$f.$field"} = $value; + }; + + } } $opt->{'fields'} = \@fields; diff --git a/httemplate/misc/cust_pkg-import.html b/httemplate/misc/cust_pkg-import.html index 2ed3c48f1..ac25e9314 100644 --- a/httemplate/misc/cust_pkg-import.html +++ b/httemplate/misc/cust_pkg-import.html @@ -48,6 +48,9 @@ Import a file containing customer packages.