diff options
-rw-r--r-- | FS/FS/svc_Common.pm | 10 | ||||
-rw-r--r-- | FS/FS/svc_acct.pm | 10 |
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" |