summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2002-03-18 16:05:35 +0000
committerivan <ivan>2002-03-18 16:05:35 +0000
commitdd12d8bcbb33acb0ffa087a70c566e8328fbe9c3 (patch)
tree0d825809628e4a6dbe38759bee8c96ed553f4398 /FS
parent14d6b3092a296ada5a0252752fd15a0087c63374 (diff)
handle inserting cust_svc and svc_acct records separately also, to handle
imports preserving svcnum
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/svc_Common.pm10
-rw-r--r--FS/FS/svc_acct.pm10
2 files changed, 19 insertions, 1 deletions
diff --git a/FS/FS/svc_Common.pm b/FS/FS/svc_Common.pm
index 042c243fd..ee190fb8d 100644
--- a/FS/FS/svc_Common.pm
+++ b/FS/FS/svc_Common.pm
@@ -69,6 +69,14 @@ sub insert {
return $error;
}
$svcnum = $self->svcnum($cust_svc->svcnum);
+ } else {
+ $cust_svc = qsearchs('cust_svc',{'svcnum'=>$self->svcnum});
+ unless ( $cust_svc ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "no cust_svc record found for svcnum ". $self->svcnum;
+ }
+ $self->pkgnum($cust_svc->pkgnum);
+ $self->svcpart($cust_svc->svcpart);
}
$error = $self->SUPER::insert;
@@ -207,7 +215,7 @@ sub cancel { ''; }
=head1 VERSION
-$Id: svc_Common.pm,v 1.7 2001-11-30 00:04:38 ivan Exp $
+$Id: svc_Common.pm,v 1.8 2002-03-18 16:05:35 ivan Exp $
=head1 BUGS
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm
index 3c564ec9d..bb9fe67b3 100644
--- a/FS/FS/svc_acct.pm
+++ b/FS/FS/svc_acct.pm
@@ -273,6 +273,16 @@ sub insert {
'domsvc' => $self->domsvc,
} );
+ if ( $self->svcnum ) {
+ my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$self->svcnum});
+ unless ( $cust_svc ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "no cust_svc record found for svcnum ". $self->svcnum;
+ }
+ $self->pkgnum($cust_svc->pkgnum);
+ $self->svcpart($cust_svc->svcpart);
+ }
+
my $part_svc = qsearchs( 'part_svc', { 'svcpart' => $self->svcpart } );
return "Unknown svcpart" unless $part_svc;
return "uid in use"