summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm7
-rw-r--r--FS/FS/Schema.pm7
-rw-r--r--FS/FS/cust_pay.pm27
3 files changed, 39 insertions, 2 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...