X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fcust_main.cgi;h=b27e722aa05c93f8420b63de3df4e0cd6211185b;hb=22c7daa1fd079e3ec9dee4da241f83e174132e4e;hp=d5d127b2d045a831f934e23a53d7c2b20fb7a781;hpb=7c1d5f4ce778b4ab56301a042076e7c1dce46152;p=freeside.git diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index d5d127b2d..b27e722aa 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -1,5 +1,3 @@ -% -% %my $error = ''; % %#unmunge stuff @@ -46,6 +44,9 @@ % } fields('cust_main') %} ); % +% delete( $new->hashref->{'agent_custid'} ) +% unless $new->hashref->{'agent_custid'}; +% %if ( defined($cgi->param('same')) && $cgi->param('same') eq "Y" ) { % $new->setfield("ship_$_", '') foreach qw( % last first company address1 address2 city county state zip @@ -53,15 +54,21 @@ % ); %} % -%if ( $cgi->param('birthdate') && $cgi->param('birthdate') =~ /^([ 0-9\-\/]{0,10})$/ ) { -% eval "use DateTime::Format::Strptime;"; -% die $@ if $@; +%if ( $cgi->param('birthdate') && $cgi->param('birthdate') =~ /^([ 0-9\-\/]{0,10})$/) { % my $conf = new FS::Conf; % my $format = $conf->config('date_format') || "%m/%d/%Y"; % my $parser = DateTime::Format::Strptime->new(pattern => $format, % time_zone => 'floating', % ); -% $new->setfield('birthdate', $parser->parse_datetime($1)->epoch); +% my $dt = $parser->parse_datetime($1); +% if ($dt) { +% $new->setfield('birthdate', $dt->epoch); +% $cgi->param('birthdate', $dt->epoch); +% } else { +%# $error ||= $cgi->param('birthdate') . " is an invalid birthdate:" . $parser->errmsg; +% $error ||= "Invalid birthdate: " . $cgi->param('birthdate') . "."; +% $cgi->param('birthdate', ''); +% } %} % %$new->setfield('paid', $cgi->param('paid') ) @@ -107,12 +114,16 @@ % % #$error ||= $cust_svc->check; % -% $svc_acct = new FS::svc_acct ( { -% 'svcpart' => $svcpart, -% 'username' => $cgi->param('username'), -% '_password' => $cgi->param('_password'), -% 'popnum' => $cgi->param('popnum'), -% } ); +% my %svc_acct = ( +% 'svcpart' => $svcpart, +% 'username' => $cgi->param('username'), +% '_password' => $cgi->param('_password'), +% 'popnum' => $cgi->param('popnum'), +% ); +% $svc_acct{'domsvc'} = $cgi->param('domsvc') +% if $cgi->param('domsvc'); +% +% $svc_acct = new FS::svc_acct \%svc_acct; % % #and just in case you were silly % $svc_acct->svcpart($svcpart); @@ -134,10 +145,9 @@ % my $conf = new FS::Conf; % if ( $conf->exists('backend-realtime') && ! $error ) { % -% my $berror = $new->bill; -% $new->apply_payments; -% $new->apply_credits; -% $berror ||= $new->collect( 'realtime' => 1 ); +% my $berror = $new->bill +% || $new->apply_payments_and_credits +% || $new->collect( 'realtime' => 1 ); % warn "Warning, error billing during backend-realtime: $berror" if $berror; % % } @@ -151,6 +161,15 @@ % && $new->paycvv =~ /^\s*\*+\s*$/ ) { % $new->paycvv($old->paycvv); % } +% if ($new->ss =~ /xx/) { +% $new->ss($old->ss); +% } +% if ($new->stateid =~ /^xxx/) { +% $new->stateid($old->stateid); +% } +% if ($new->payby =~ /^(CARD|DCRD|CHEK|DCHK)$/ && $new->payinfo =~ /xx/) { +% $new->payinfo($old->payinfo); +% } % $error ||= $new->replace($old, \@invoicing_list); % %} @@ -161,6 +180,3 @@ %} else { % print $cgi->redirect(popurl(3). "view/cust_main.cgi?". $new->custnum); %} -% - -