summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2017-05-18 11:58:26 -0400
committerChristopher Burger <burgerc@freeside.biz>2017-05-18 11:58:26 -0400
commit386c1c45a7cb9e8ad93862d9aa2d59cdb4ed0d3a (patch)
treeb994f7a4938b146b26991b6e5b18d7eb62a5c813 /FS
parenta8d055471f77f59883f921d9eeda056a2e7ad279 (diff)
RT# 74435 - Adding option to allow refunds using electronic check batch with RBC format.
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Schema.pm1
-rw-r--r--FS/FS/cust_main/Billing_Batch.pm3
-rw-r--r--FS/FS/pay_batch/RBC.pm7
3 files changed, 9 insertions, 2 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index f3e7c4efb..086fcff0f 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -2705,6 +2705,7 @@ sub tables_hashref {
'status', 'varchar', 'NULL', $char_d, '', '',
'failure_status','varchar', 'NULL', 16, '', '',
'error_message', 'varchar', 'NULL', $char_d, '', '',
+ 'paycode', 'varchar', 'NULL', $char_d, '', '',
],
'primary_key' => 'paybatchnum',
'unique' => [],
diff --git a/FS/FS/cust_main/Billing_Batch.pm b/FS/FS/cust_main/Billing_Batch.pm
index d8e6f8a35..d8ae3b40f 100644
--- a/FS/FS/cust_main/Billing_Batch.pm
+++ b/FS/FS/cust_main/Billing_Batch.pm
@@ -114,7 +114,7 @@ sub batch_card {
} );
foreach (qw( address1 address2 city state zip country latitude longitude
- payby payinfo paydate payname ))
+ payby payinfo paydate payname paycode ))
{
$options{$_} = '' unless exists($options{$_});
}
@@ -142,6 +142,7 @@ sub batch_card {
'payname' => $options{payname} || $cust_payby->payname,
'paytype' => $options{paytype} || $cust_payby->paytype,
'amount' => $amount, # consolidating
+ 'paycode' => $options{paycode} || $cust_payby->paycode,
} );
$cust_pay_batch->paybatchnum($old_cust_pay_batch->paybatchnum)
diff --git a/FS/FS/pay_batch/RBC.pm b/FS/FS/pay_batch/RBC.pm
index b0136786b..21dae4256 100644
--- a/FS/FS/pay_batch/RBC.pm
+++ b/FS/FS/pay_batch/RBC.pm
@@ -175,8 +175,13 @@ $name = 'RBC';
}
$i++;
+
+ ## set to D for debit by default, then override to what cust_pay_batch has as payments may not have paycode.
+ my $debitorcredit = 'D';
+ $debitorcredit = $cust_pay_batch->paycode unless !$cust_pay_batch->paycode;
+
sprintf("%06u", $i).
- 'D'.
+ $debitorcredit.
sprintf("%3s",$trans_code).
sprintf("%10s",$client_num).
' '.