sub process_acct_forward {
my $p = shift;
-
my($context, $session, $custnum) = _custoragent_session_custnum($p);
return { 'error' => $session } if $context eq 'error';
);
if ( $p->{'dst'} eq '' ) {
- warn Dumper($p);
if ( $old ) {
my $error = $old->delete;
return { 'error' => $error };
} else {
my $conf = new FS::Conf;
$new->svcpart($conf->config('selfservice-svc_forward_svcpart'));
- $new->pkgnum($old->cust_svc->pkgnum);
- warn Dumper($new);
+
+ 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;
- warn $error;
}
return { 'error' => $error };