diff options
author | Mark Wells <mark@freeside.biz> | 2012-03-29 14:27:55 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2012-03-29 14:32:13 -0700 |
commit | 8f43e32350b7f8a0925959f747f7296b9b42c09e (patch) | |
tree | 0ab9172972d9eea243bf7667a1c9609332769e1f | |
parent | 09bdd45e0a95601b7c51c5dbbef03793f320a61d (diff) |
additional fields for cash payments, #16821
-rw-r--r-- | FS/FS/Conf.pm | 7 | ||||
-rw-r--r-- | FS/FS/Schema.pm | 7 | ||||
-rw-r--r-- | FS/FS/cust_pay.pm | 27 | ||||
-rwxr-xr-x | httemplate/edit/cust_pay.cgi | 26 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_pay.cgi | 5 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history.html | 2 | ||||
-rw-r--r-- | httemplate/view/cust_pay.html | 22 |
7 files changed, 91 insertions, 5 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index ee7f2b4be..9c7710b22 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -2291,6 +2291,13 @@ and customer address. Include units.', }, { + 'key' => 'require_cash_deposit_info', + 'section' => 'billing', + 'description' => 'When recording cash payments, display bank deposit information fields.', + 'type' => 'checkbox', + }, + + { 'key' => 'paymentforcedtobatch', 'section' => 'deprecated', 'description' => 'See batch-enable_payby and realtime-disable_payby. Used to (for CHEK): Cause per customer payment entry to be forced to a batch processor rather than performed realtime.', diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 9b21dfc11..5147432a1 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -1343,12 +1343,17 @@ sub tables_hashref { # index into payby table # eventually 'payinfo', 'varchar', 'NULL', 512, '', '', #see cust_main above - 'paymask', 'varchar', 'NULL', $char_d, '', '', + 'paymask', 'varchar', 'NULL', $char_d, '', '', 'paydate', 'varchar', 'NULL', 10, '', '', 'paybatch', 'varchar', 'NULL', $char_d, '', '', #for auditing purposes. 'payunique', 'varchar', 'NULL', $char_d, '', '', #separate paybatch "unique" functions from current usage 'closed', 'char', 'NULL', 1, '', '', 'pkgnum', 'int', 'NULL', '', '', '', #desired pkgnum for pkg-balances + # cash/check deposit info fields + 'bank', 'varchar', 'NULL', $char_d, '', '', + 'depositor', 'varchar', 'NULL', $char_d, '', '', + 'account', 'varchar', 'NULL', 20, '', '', + 'teller', 'varchar', 'NULL', 20, '', '', ], 'primary_key' => 'paynum', #i guess not now, with cust_pay_pending, if we actually make it here, we _do_ want to record it# 'unique' => [ [ 'payunique' ] ], diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index d98d11ecb..ef30809b0 100644 --- a/FS/FS/cust_pay.pm +++ b/FS/FS/cust_pay.pm @@ -113,6 +113,22 @@ books closed flag, empty or `Y' Desired pkgnum when using experimental package balances. +=item bank + +The bank where the payment was deposited. + +=item depositor + +The name of the depositor. + +=item account + +The deposit account number. + +=item teller + +The teller number. + =back =head1 METHODS @@ -493,8 +509,11 @@ sub check { || $self->ut_textn('payunique') || $self->ut_enum('closed', [ '', 'Y' ]) || $self->ut_foreign_keyn('pkgnum', 'cust_pkg', 'pkgnum') + || $self->ut_textn('bank') + || $self->ut_alphan('depositor') + || $self->ut_numbern('account') + || $self->ut_numbern('teller') || $self->payinfo_check() - || $self->ut_numbern('discount_term') ; return $error if $error; @@ -509,6 +528,12 @@ sub check { return "invalid discount_term" if ($self->discount_term && $self->discount_term < 2); + if ( $self->payby eq 'CASH' and $conf->exists('require_cash_deposit_info') ) { + foreach (qw(bank depositor account teller)) { + return "$_ required" if $self->get($_) eq ''; + } + } + #i guess not now, with cust_pay_pending, if we actually make it here, we _do_ want to record it # # UNIQUE index should catch this too, without race conditions, but this # # should give a better error message the other 99.9% of the time... diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi index 3fd9c79eb..7a1bb00fa 100755 --- a/httemplate/edit/cust_pay.cgi +++ b/httemplate/edit/cust_pay.cgi @@ -18,7 +18,7 @@ <INPUT TYPE="hidden" NAME="payby" VALUE="<% $payby %>"> <INPUT TYPE="hidden" NAME="paybatch" VALUE="<% $paybatch %>"> -<BR><BR> +<BR> <% mt('Payment') |h %> <% ntable("#cccccc", 2) %> @@ -56,7 +56,29 @@ <TD ALIGN="right"><% mt('Check #') |h %></TD> <TD COLSPAN=2><INPUT TYPE="text" NAME="payinfo" VALUE="<% $payinfo %>" SIZE=10></TD> </TR> -% } +% } +% elsif ( $payby eq 'CASH' and $conf->exists('require_cash_deposit_info') ) { + <TR> + <TD ALIGN="right"><% mt('Bank') |h %></TD> + <TD COLSPAN=3><INPUT TYPE="text" NAME="bank" VALUE="<% $cgi->param('bank') %>"></TD> + </TR> + <TR> + <TD ALIGN="right"><% mt('Check #') |h %></TD> + <TD COLSPAN=2><INPUT TYPE="text" NAME="payinfo" VALUE="<% $payinfo %>" SIZE=10></TD> + </TR> + <TR> + <TD ALIGN="right"><% mt('Teller #') |h %></TD> + <TD COLSPAN=2><INPUT TYPE="text" NAME="teller" VALUE="<% $cgi->param('teller') %>" SIZE=10></TD> + </TR> + <TR> + <TD ALIGN="right"><% mt('Depositor') |h %></TD> + <TD COLSPAN=3><INPUT TYPE="text" NAME="depositor" VALUE="<% $cgi->param('depositor') %>"></TD> + </TR> + <TR> + <TD ALIGN="right"><% mt('Account #') |h %></TD> + <TD COLSPAN=2><INPUT TYPE="text" NAME="account" VALUE="<% $cgi->param('account') %>" SIZE=18></TD> + </TR> +% } <TR> % if ( $link eq 'custnum' || $link eq 'popup' ) { diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index e74f9022f..06f5e64d5 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -28,6 +28,8 @@ %} <%init> +my $conf = FS::Conf->new; + $cgi->param('linknum') =~ /^(\d+)$/ or die "Illegal linknum: ". $cgi->param('linknum'); my $linknum = $1; @@ -46,6 +48,7 @@ my $new = new FS::cust_pay ( { $_, scalar($cgi->param($_)); } qw( paid payby payinfo paybatch pkgnum discount_term + bank depositor account teller ) #} fields('cust_pay') } ); @@ -57,6 +60,6 @@ push @rights, 'Post cash payment' if $new->payby eq 'CASH'; die "access denied" unless $FS::CurrentUser::CurrentUser->access_right(\@rights); -my $error = $new->insert( 'manual' => 1 ); +my $error ||= $new->insert( 'manual' => 1 ); </%init> diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index b5b716199..c453ffadc 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -13,6 +13,7 @@ 'cust_main' => $cust_main, 'actionlabel' => emt('Enter check payment'), 'width' => 392, + 'height' => 392, &> % } @@ -24,6 +25,7 @@ 'cust_main' => $cust_main, 'actionlabel' => emt('Enter cash payment'), 'width' => 392, + 'height' => 392, &> % } diff --git a/httemplate/view/cust_pay.html b/httemplate/view/cust_pay.html index d02f1543d..f9c8bc19c 100644 --- a/httemplate/view/cust_pay.html +++ b/httemplate/view/cust_pay.html @@ -98,6 +98,28 @@ % } +% if ( $cust_pay->payby eq 'CASH' && $cust_pay->payinfo ) { + <TR> + <TD ALIGN="right"><% mt('Bank') |h %></TD> + <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->bank %></B></TD> + </TR> + + <TR> + <TD ALIGN="right"><% mt('Teller #') |h %></TD> + <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->teller %></B></TD> + </TR> + + <TR> + <TD ALIGN="right"><% mt('Depositor') |h %></TD> + <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->depositor %></B></TD> + </TR> + + <TR> + <TD ALIGN="right"><% mt('Account #') |h %></TD> + <TD BGCOLOR="#FFFFFF"><B><% $cust_pay->account %></B></TD> + </TR> +% } + % if ( $conf->exists('pkg-balances') && $cust_pay->pkgnum ) { % my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_pay->pkgnum } ); <TR> |