From: jeff Date: Fri, 6 Apr 2007 19:38:09 +0000 (+0000) Subject: ticket 1443 add account type and bank state for echeck processing X-Git-Tag: TRIXBOX_2_6~561 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=c42fe413bd1b9a38e4818dcd7117a8abeee674e8 ticket 1443 add account type and bank state for echeck processing --- diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 2c26ba271..591793b6e 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -447,6 +447,8 @@ sub tables_hashref { 'paystart_year', 'int', 'NULL', '', '', '', 'payissue', 'varchar', 'NULL', 2, '', '', 'payname', 'varchar', 'NULL', $char_d, '', '', + 'paystate', 'varchar', 'NULL', $char_d, '', '', + 'paytype', 'varchar', 'NULL', $char_d, '', '', 'payip', 'varchar', 'NULL', 15, '', '', 'tax', 'char', 'NULL', 1, '', '', 'otaker', 'varchar', '', 32, '', '', diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index f6867224a..e834d59e4 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2,7 +2,7 @@ package FS::cust_main; use strict; use vars qw( @ISA @EXPORT_OK $DEBUG $me $conf @encrypted_fields - $import $skip_fuzzyfiles $ignore_expired_card ); + $import $skip_fuzzyfiles $ignore_expired_card @paytypes); use vars qw( $realtime_bop_decline_quiet ); #ugh use Safe; use Carp; @@ -70,6 +70,7 @@ $skip_fuzzyfiles = 0; $ignore_expired_card = 0; @encrypted_fields = ('payinfo', 'paycvv'); +@paytypes = ('Personal checking', 'Personal savings', 'Business checking', 'Business savings'); #ask FS::UID to run this stuff for us later #$FS::UID::callback{'FS::cust_main'} = sub { @@ -1336,6 +1337,7 @@ sub check { $error = $self->ut_numbern('paystart_month') || $self->ut_numbern('paystart_year') || $self->ut_numbern('payissue') + || $self->ut_textn('paytype') ; return $error if $error; 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 @@

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 ) %> % 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 @@ -% 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 )) { @@ -119,6 +119,7 @@ % 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 @@ % ''. % % qq!!. -% qq!'. +% qq!'. +% qq!!. % % qq!!. -% qq!!. % @@ -200,9 +204,18 @@ % qq!!. % % qq!!. -% qq!!. +% qq!!. +% qq!!. +% qq!". % -% qq!'. +% +% qq!'. % % ''. % ''. @@ -439,6 +452,12 @@ <% $r %> required fields % } +<%once> + +my $paystate_label = FS::Msgcat::_gettext('paystate'); +$paystate_label = 'Bank state' if $paystate_label =~/^paystate$/; + + <%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 @@
${r}Account number
Type!. +% join('', map { qq!" } @FS::cust_main::paytypes). +% qq!
${r}ABA/Routing number !. +% qq! !. % qq!(help)!. % qq!
${r}Bank name
$paystate_label!. +% include('select-state.html', +% 'empty' => '(choose)', +% 'state' => $cust_main->paystate, +% 'country' => $cust_main->country, +% 'prefix' => 'pay', +% ). "
Charge future payments to this electronic check automatically
Charge future payments to this electronic check automatically