X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_pkg%2FImport.pm;h=fe69f82fd1d7c325b20e661e89e92bb3cedcbdf8;hb=db3e520bad7240b3f6f0d53a2b55a64ef116890b;hp=e113d171269c997849767d163affb9a9b8483557;hpb=0ba11069f2cc969e5e873db82d2b108e64f50c6a;p=freeside.git diff --git a/FS/FS/cust_pkg/Import.pm b/FS/FS/cust_pkg/Import.pm index e113d1712..fe69f82fd 100644 --- a/FS/FS/cust_pkg/Import.pm +++ b/FS/FS/cust_pkg/Import.pm @@ -138,14 +138,14 @@ my %import_options = ( 'domain' => $domain, }; unless ( $svc_domain->svcnum ) { my $error = $svc_domain->insert; - return $error if $error; + return "error auto-inserting domain: $error" if $error; } $svc->username($username); $svc->domsvc($svc_domain->svcnum); } my $error = $svc->insert; - return $error if $error; + return "error inserting service: $error" if $error; } } @@ -170,8 +170,9 @@ sub batch_import { my $format = delete $opt->{'format'}; my @fields = (); - if ( $format =~ /^(.*)-agent_custid$/ ) { + if ( $format =~ /^(.*)-agent_custid(-agent_pkgid)?$/ ) { $format = $1; + my $agent_pkgid = $2; @fields = ( sub { my( $self, $value ) = @_; # $conf, $param @@ -182,6 +183,7 @@ sub batch_import { $self->custnum($cust_main->custnum) if $cust_main; }, ); + push @fields, 'agent_pkgid' if $agent_pkgid; } else { @fields = ( 'custnum' ); }