summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorjeff <jeff>2007-04-06 19:38:09 +0000
committerjeff <jeff>2007-04-06 19:38:09 +0000
commitc42fe413bd1b9a38e4818dcd7117a8abeee674e8 (patch)
tree07db05192513c4afb05d661697f9dc16d6650888 /httemplate/edit
parent24cd385ebf1ab6e91d02d715475d37f8c4011eac (diff)
ticket 1443 add account type and bank state for echeck processing
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-xhttemplate/edit/cust_main.cgi20
-rw-r--r--httemplate/edit/cust_main/billing.html29
-rw-r--r--httemplate/edit/cust_main/select-state.html6
3 files changed, 43 insertions, 12 deletions
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index 2c3123ccb..0a7a8c031 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -17,7 +17,7 @@
%my $error = '';
%my($custnum, $username, $password, $popnum, $cust_main, $saved_pkgpart, $saved_domsvc);
%my(@invoicing_list);
-%my $payinfo;
+%my ($ss,$stateid,$payinfo);
%my $same = '';
%if ( $cgi->param('error') ) {
% $error = $cgi->param('error');
@@ -43,6 +43,8 @@
% @invoicing_list = split( /\s*,\s*/, $cgi->param('invoicing_list') );
% $same = $cgi->param('same');
% $cust_main->setfield('paid' => $cgi->param('paid')) if $cgi->param('paid');
+% $ss = $cust_main->ss; # don't mask an entered value on errors
+% $stateid = $cust_main->stateid; # don't mask an entered value on errors
% $payinfo = $cust_main->payinfo; # don't mask an entered value on errors
%} elsif ( $cgi->keywords ) { #editing
% my( $query ) = $cgi->keywords;
@@ -61,6 +63,8 @@
% $password = '';
% $popnum = 0;
% @invoicing_list = $cust_main->invoicing_list;
+% $ss = $cust_main->masked('ss');
+% $stateid = $cust_main->masked('stateid');
% $payinfo = $cust_main->paymask;
%} else {
% $custnum='';
@@ -75,6 +79,8 @@
% @invoicing_list = ();
% push @invoicing_list, 'POST'
% unless $conf->exists('disablepostalinvoicedefault');
+% $ss = '';
+% $stateid = '';
% $payinfo = '';
%}
%$cgi->delete_all();
@@ -198,7 +204,7 @@
<BR><BR>
Billing address
-<% include('cust_main/contact.html', $cust_main, '', 'bill_changed(this)', '' ) %>
+<% include('cust_main/contact.html', $cust_main, '', 'bill_changed(this)', '', 'ss' => $ss, 'stateid' => $stateid ) %>
<!-- service address -->
% if ( defined $cust_main->dbdef_table->column('ship_last') ) {
@@ -290,6 +296,7 @@ function bottomfixup(what) {
'address1', 'address2', 'city',
'county', 'state', 'zip', 'country',
'daytime', 'night', 'fax',
+ 'stateid', 'stateid_state',
'same',
@@ -303,8 +310,8 @@ function bottomfixup(what) {
var layervars = new Array(
'payauto',
- 'payinfo', 'payinfo1', 'payinfo2',
- 'payname', 'exp_month', 'exp_year', 'paycvv',
+ 'payinfo', 'payinfo1', 'payinfo2', 'paytype',
+ 'payname', 'paystate', 'exp_month', 'exp_year', 'paycvv',
'paystart_month', 'paystart_year', 'payissue',
'payip',
'paid'
@@ -374,6 +381,7 @@ function copyelement(from, to) {
% 'address1', 'address2', 'city',
% 'county', 'state', 'zip', 'country',
% 'daytime', 'night', 'fax',
+% 'stateid', 'stateid_state',
%
% 'same',
%
@@ -385,8 +393,8 @@ function copyelement(from, to) {
% 'select', #XXX key
%
% 'payauto',
-% 'payinfo', 'payinfo1', 'payinfo2',
-% 'payname', 'exp_month', 'exp_year', 'paycvv',
+% 'payinfo', 'payinfo1', 'payinfo2', 'paytype',
+% 'payname', 'paystate', 'exp_month', 'exp_year', 'paycvv',
% 'paystart_month', 'paystart_year', 'payissue',
% 'payip',
% 'paid',
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html
index 65b4400a4..1440db4a8 100644
--- a/httemplate/edit/cust_main/billing.html
+++ b/httemplate/edit/cust_main/billing.html
@@ -10,7 +10,7 @@
<INPUT TYPE="hidden" NAME="payinfo" VALUE="<% $cust_main->paymask %>">
-% foreach my $field (qw( payname paycvv paystart_month paystart_year payissue payip )) {
+% foreach my $field (qw( payname paycvv paystart_month paystart_year payissue payip paytype paystate )) {
<INPUT TYPE="hidden" NAME="<% $field %>" VALUE="<% $cust_main->getfield($field) %>">
@@ -119,6 +119,7 @@
</SCRIPT>
% my $payby = $cust_main->payby;
+% my $paytype = $cust_main->paytype;
% my( $account, $aba ) = split('@', $payinfo);
%
% my $disabled = 'DISABLED style="background-color: #dddddd"';
@@ -189,10 +190,13 @@
% '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
%
% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Account number </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" SIZE=12 NAME="payinfo1" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $account : '' ). '"></TD></TR>'.
+% qq!<TD><INPUT TYPE="text" SIZE=12 NAME="payinfo1" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $account : '' ). '"></TD>'.
+% qq!<TD ALIGN="right">Type</TD><TD><SELECT="text" NAME="paytype">!.
+% join('', map { qq!<OPTION VALUE="$_" !.($paytype eq $_ ? 'SELECTED' : '').">$_</OPTION>" } @FS::cust_main::paytypes).
+% qq!</SELECT></TD></TR>!.
%
% qq!<TR><TD ALIGN="right" WIDTH="200">${r}ABA/Routing number </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" SIZE=10 MAXLENGTH=9 NAME="payinfo2" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $aba : '' ). qq!" SIZE=10 MAXLENGTH=9> !.
+% qq!<TD COLSPAN="3" WIDTH="408"><INPUT TYPE="text" SIZE=10 MAXLENGTH=9 NAME="payinfo2" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $aba : '' ). qq!" SIZE=10 MAXLENGTH=9> !.
% qq!(<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/ach.html', 380, 240, 'ach_popup' ), CAPTION, 'ACH Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;">help</A>)!.
% qq!</TD></TR>!.
%
@@ -200,9 +204,18 @@
% qq!<INPUT TYPE="hidden" NAME="exp_year" VALUE="2037">!.
%
% qq!<TR><TD ALIGN="right" WIDTH="200">${r}Bank name </TD>!.
-% qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payname" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $cust_main->payname : '' ). qq!"></TD></TR>!.
+% qq!<TD COLSPAN="3" WIDTH="408"><INPUT TYPE="text" NAME="payname" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $cust_main->payname : '' ). qq!"></TD></TR>!.
+% qq!<TR><TD ALIGN="right" WIDTH="200">$paystate_label</TD>!.
+% qq!<TD COLSPAN="3" WIDTH="408">!.
+% include('select-state.html',
+% 'empty' => '(choose)',
+% 'state' => $cust_main->paystate,
+% 'country' => $cust_main->country,
+% 'prefix' => 'pay',
+% ). "</TD></TR>".
%
-% qq!<TR><TD COLSPAN=2 WIDTH="608"><INPUT TYPE="checkbox" NAME="payauto" !. ( $payby eq 'DCHK' ? '' : 'CHECKED' ). '> Charge future payments to this electronic check automatically</TD></TR>'.
+%
+% qq!<TR><TD COLSPAN=4 WIDTH="608"><INPUT TYPE="checkbox" NAME="payauto" !. ( $payby eq 'DCHK' ? '' : 'CHECKED' ). '> Charge future payments to this electronic check automatically</TD></TR>'.
%
% '<TR><TD>&nbsp;</TD></TR>'.
% '<TR><TD>&nbsp;</TD></TR>'.
@@ -439,6 +452,12 @@
<% $r %> required fields
% }
+<%once>
+
+my $paystate_label = FS::Msgcat::_gettext('paystate');
+$paystate_label = 'Bank state' if $paystate_label =~/^paystate$/;
+
+</%once>
<%init>
my( $cust_main, %options ) = @_;
diff --git a/httemplate/edit/cust_main/select-state.html b/httemplate/edit/cust_main/select-state.html
index 87546e5e3..4f1c056b5 100644
--- a/httemplate/edit/cust_main/select-state.html
+++ b/httemplate/edit/cust_main/select-state.html
@@ -1,5 +1,9 @@
<SELECT NAME="<% $opt{'prefix'} %>state" onChange="<% $opt{'prefix'} %>state_changed(this); <% $opt{'onchange'} %>" <% $opt{'disabled'} %>>
+% if ($opt{empty}) {
+ <OPTION VALUE=""<% $opt{state} eq '' ? ' SELECTED' : '' %>><% $opt{empty} %>
+% }
+
% foreach my $state ( keys %states ) {
<OPTION VALUE="<% $state %>"<% $state eq $opt{'state'} ? ' SELECTED' : '' %>><% $states{$state} || '(n/a)' %>
@@ -11,7 +15,7 @@
<%init>
my %opt = @_;
-foreach my $opt (qw( county state country prefix onchange disabled )) {
+foreach my $opt (qw( county state country prefix onchange disabled empty )) {
$opt{$_} = '' unless exists($opt{$_}) && defined($opt{$_});
}