# warn "can't find domain $domain\n";
}
+ my $exist = qsearchs('svc_external', { 'id' => $serial } );
+ next if $exist;
+
my $svc_external = new FS::svc_external {
'svcpart' => $svcpart,
'pkgnum' => ( $cust_svc ? $cust_svc->pkgnum : '' ),
};
#my $error = $svc_external->check;
my $error = $svc_external->insert;
- die $error if $error;
+ if ( $cust_svc && $error =~ /^Already/ ) {
+ warn $error;
+ $svc_external->pkgnum('');
+ $error = $svc_external->insert;
+ }
+ warn $error if $error;
$num++;
$linked++ if $cust_svc;