sub process_acct_forward {
my $p = shift;
-
my($context, $session, $custnum) = _custoragent_session_custnum($p);
return { 'error' => $session } if $context eq 'error';
my $error;
if ( $old ) {
$new->svcnum($old->svcnum);
+ my $cust_svc = $old->cust_svc;
+ $new->svcpart($old->svcpart);
+ $new->pkgnuym($old->pkgnum);
$error = $new->replace($old);
} else {
+ my $conf = new FS::Conf;
+ $new->svcpart($conf->config('selfservice-svc_forward_svcpart'));
+
+ my $svc_acct = _customer_svc_x( $custnum, $p->{'svcnum'}, 'svc_acct' )
+ or return { 'error' => 'No service' }; #how would we even get here?
+
+ $new->pkgnum( $svc_acct->cust_svc->pkgnum );
+
$error = $new->insert;
}