DHTML progress bar for glacial rate adding and editing, closes: Bug#1100
[freeside.git] / httemplate / edit / process / cust_main.cgi
index 8183828..a1d3698 100755 (executable)
@@ -19,14 +19,15 @@ if ( $payby ) {
   $cgi->param('paydate',
     $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' ) );
   $cgi->param('payname', $cgi->param( $payby. '_payname' ) );
+  $cgi->param('paycvv', $cgi->param( $payby. '_paycvv' ) )
+    if defined $cgi->param( $payby. '_paycvv' );
 }
 
-$cgi->param('otaker', &getotaker );
-
 my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') );
 push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST');
 $cgi->param('invoicing_list', join(',', @invoicing_list) );
 
+
 #create new record object
 
 my $new = new FS::cust_main ( {
@@ -79,7 +80,7 @@ if ( $new->custnum eq '' ) {
       #later         'custnum' => $custnum,
       'pkgpart' => $pkgpart,
     } );
-    $error ||= $cust_pkg->check;
+    #$error ||= $cust_pkg->check;
 
     #$cust_svc = new FS::cust_svc ( { 'svcpart' => $svcpart } );
 
@@ -100,7 +101,7 @@ if ( $new->custnum eq '' ) {
     $svc_acct->_password($cgi->param('_password'));
     $svc_acct->popnum($cgi->param('popnum'));
 
-    $error ||= $svc_acct->check;
+    #$error ||= $svc_acct->check;
 
   } elsif ( $cgi->param('username') ) { #good thing to catch
     $error = "Can't assign username without a package!";
@@ -113,6 +114,11 @@ if ( $new->custnum eq '' ) {
 } else { #create old record object
   my $old = qsearchs( 'cust_main', { 'custnum' => $new->custnum } ); 
   $error ||= "Old record not found!" unless $old;
+  if ( defined dbdef->table('cust_main')->column('paycvv')
+       && length($old->paycvv)
+       && $new->paycvv =~ /^\s*\*+\s*$/ ) {
+    $new->paycvv($old->paycvv);
+  }
   $error ||= $new->replace($old, \@invoicing_list);
 }