my @signup_bools = qw( no_company recommend_daytime recommend_email );
- my @signup_server_scalars = qw( default_pkgpart default_svcpart );
+ my @signup_server_scalars = qw( default_pkgpart default_svcpart default_domain );
my @selfservice_textareas = qw( head body_header body_footer );
my $template_cust = qsearchs('cust_main', { 'custnum' => $template_custnum } );
return { 'error' => 'Configuration error' } unless $template_cust;
- #XXX Copy template customer's locations
$cust_main = new FS::cust_main ( {
'agentnum' => $agentnum,
'refnum' => $packet->{refnum}
|| $conf->config('signup_server-default_refnum'),
( map { $_ => $template_cust->$_ } qw(
- last first company address1 address2
- city county state zip country
- daytime night fax
-
- ship_last ship_first ship_company ship_address1 ship_address2
- ship_city ship_county ship_state ship_zip ship_country
- ship_daytime ship_night ship_fax
+ last first company daytime night fax
)
),
} );
+ $bill_hash = { $template_cust->bill_location->location_hash };
+ $ship_hash = { $template_cust->ship_location->location_hash };
+
} else {
$cust_main = new FS::cust_main ( {
# " new customer: $bill_error"
# if $bill_error;
- $bill_error = $cust_main->realtime_collect(
- method => FS::payby->payby2bop( $packet->{payby} ),
- depend_jobnum => $placeholder->jobnum,
- selfservice => 1,
- );
- #warn "$me error collecting from new customer: $bill_error"
- # if $bill_error;
+ unless ( $packet->{payby} eq 'PREPAY' ) {
+ $bill_error = $cust_main->realtime_collect(
+ method => FS::payby->payby2bop( $packet->{payby} ),
+ depend_jobnum => $placeholder->jobnum,
+ selfservice => 1,
+ );
+ #warn "$me error collecting from new customer: $bill_error"
+ # if $bill_error;
+ }
if ($bill_error && ref($bill_error) eq 'HASH') {
return { 'error' => '_collect',