From da757c2af713bedd8706e30ac002658b0c97ce28 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 24 Dec 2006 01:28:38 +0000 Subject: fix more paymask regressions: allow editing records with existing expired cards, fix masking just-entered values when erroring out, fix echeck entry inserting as empty routing code and "xxEK" account number, remove old/deprecated/unused payinfo_maksed subs and calls --- httemplate/edit/cust_main.cgi | 5 +++ httemplate/edit/cust_main/billing.html | 62 ++++++++++++++-------------------- 2 files changed, 30 insertions(+), 37 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 748cdde5f..e2ed0f1da 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -17,6 +17,7 @@ %my $error = ''; %my($custnum, $username, $password, $popnum, $cust_main, $saved_pkgpart); %my(@invoicing_list); +%my $payinfo; %my $same = ''; %if ( $cgi->param('error') ) { % $error = $cgi->param('error'); @@ -36,6 +37,7 @@ % @invoicing_list = split( /\s*,\s*/, $cgi->param('invoicing_list') ); % $same = $cgi->param('same'); % $cust_main->setfield('paid' => $cgi->param('paid')) if $cgi->param('paid'); +% $payinfo = $cust_main->payinfo; # don't mask an entered value on errors %} elsif ( $cgi->keywords ) { #editing % my( $query ) = $cgi->keywords; % $query =~ /^(\d+)$/; @@ -52,6 +54,7 @@ % $password = ''; % $popnum = 0; % @invoicing_list = $cust_main->invoicing_list; +% $payinfo = $cust_main->paymask; %} else { % $custnum=''; % $cust_main = new FS::cust_main ( {} ); @@ -64,6 +67,7 @@ % @invoicing_list = (); % push @invoicing_list, 'POST' % unless $conf->exists('disablepostalinvoicedefault'); +% $payinfo = ''; %} %$cgi->delete_all(); % @@ -259,6 +263,7 @@ Service address <% include( 'cust_main/billing.html', $cust_main, + 'payinfo' => $payinfo, 'invoicing_list' => \@invoicing_list, ) %> diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index d3cd77dbb..b38d284c4 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -1,37 +1,21 @@ -% -% -%my( $cust_main, %options ) = @_; -%my @invoicing_list = @{ $options{'invoicing_list'} }; -%my $conf = new FS::Conf; -%my $payby_default = $conf->config('payby-default'); -% -%my @payby = grep /\w/, $conf->config('payby'); -%#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) -%@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) -% unless @payby; -% %if ( $payby_default eq 'HIDE' ) { % % $cust_main->payby('BILL') unless $cust_main->payby; -% -% -
-% # XXX key - -% foreach my $field (qw( payname paycvv paystart_month paystart_year payissue payip )) { +% foreach my $field (qw( payname paycvv paystart_month paystart_year payissue payip )) { + % } -% + % #false laziness w/elements/select-month_year.html & view/cust_main/billing.html % my( $mon, $year ); % my $date = $cust_main->paydate || '12-2037'; @@ -42,8 +26,6 @@ % } else { % die "unrecognized expiration date format: $date"; % } -% - @@ -57,12 +39,10 @@
+ % } else { % % my $r = qq!* !; -% -% -
Billing information <% &ntable("#cccccc") %> @@ -137,19 +117,14 @@ +'
[iframe not supported]
'); } -% -% -% my($payby, $paymask, $payname)=( -% $cust_main->payby, -% $cust_main->paymask, -% $cust_main->payname, -% ); -% my( $account, $aba ) = split('@', $paymask); + +% my $payby = $cust_main->payby; +% my( $account, $aba ) = split('@', $payinfo); % % my $disabled = 'DISABLED style="background-color: #dddddd"'; % my $text_disabled = 'style="color: #999999"'; % -% if ( $payby =~ /^(CARD|DCRD)$/ && cardtype($paymask) =~ /^(Switch|Solo)$/ ) { +% if ( $payby =~ /^(CARD|DCRD)$/ && cardtype($payinfo) =~ /^(Switch|Solo)$/ ) { % $disabled = 'style="background-color: #ffffff"'; % $text_disabled = 'style="color: #000000";' % } @@ -161,7 +136,7 @@ % ''. % % qq!!. -% qq!!. +% qq!!. % % qq!!. % '
${r}Card number
${r}Expiration '. @@ -192,7 +167,7 @@ % 'end_year' => (localtime())[5] + 1900, % 'selected_date' => ( % ( $payby =~ /^(CARD|DCRD)$/ -% && cardtype($paymask) =~ /^(Switch|Solo)$/ ) +% && cardtype($payinfo) =~ /^(Switch|Solo)$/ ) % ? $cust_main->paystart_month. '-'. % $cust_main->paystart_year % : '' @@ -240,7 +215,7 @@ % ''. % % qq!!. -% qq!!. +% qq!!. % % qq!!. % qq!!. @@ -260,7 +235,7 @@ % '
${r}Phone number
'. % % qq!!. -% qq!!. +% qq!!. % % qq!!. % qq!!. @@ -451,4 +426,17 @@ <% $r %> required fields % } +<%init> + +my( $cust_main, %options ) = @_; +my @invoicing_list = @{ $options{'invoicing_list'} }; +my $payinfo = $options{'payinfo'}; +my $conf = new FS::Conf; +my $payby_default = $conf->config('payby-default'); + +my @payby = grep /\w/, $conf->config('payby'); +#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) +@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) + unless @payby; + -- cgit v1.2.1
P.O.