},
{
+ '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.',
# 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' ] ],
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
|| $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;
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...
<INPUT TYPE="hidden" NAME="payby" VALUE="<% $payby %>">
<INPUT TYPE="hidden" NAME="paybatch" VALUE="<% $paybatch %>">
-<BR><BR>
+<BR>
<% mt('Payment') |h %>
<% ntable("#cccccc", 2) %>
<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' ) {
%}
<%init>
+my $conf = FS::Conf->new;
+
$cgi->param('linknum') =~ /^(\d+)$/
or die "Illegal linknum: ". $cgi->param('linknum');
my $linknum = $1;
$_, scalar($cgi->param($_));
} qw( paid payby payinfo paybatch
pkgnum discount_term
+ bank depositor account teller
)
#} fields('cust_pay')
} );
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right(\@rights);
-my $error = $new->insert( 'manual' => 1 );
+my $error ||= $new->insert( 'manual' => 1 );
</%init>
'cust_main' => $cust_main,
'actionlabel' => emt('Enter check payment'),
'width' => 392,
+ 'height' => 392,
&>
% }
'cust_main' => $cust_main,
'actionlabel' => emt('Enter cash payment'),
'width' => 392,
+ 'height' => 392,
&>
% }
% }
+% 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>