X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpay_batch%2FRBC.pm;h=3d1d98b17c4b09000b30a9360dfdef674eaed281;hb=3e6b291920daf5546efa5355e3ea6199e875d9db;hp=b0136786bc7af1f918208ac013771476ecbc8d5e;hpb=755f6730e6bc4b59db2041db09403c31136c814d;p=freeside.git diff --git a/FS/FS/pay_batch/RBC.pm b/FS/FS/pay_batch/RBC.pm index b0136786b..3d1d98b17 100644 --- a/FS/FS/pay_batch/RBC.pm +++ b/FS/FS/pay_batch/RBC.pm @@ -174,9 +174,17 @@ $name = 'RBC'; die "invalid branch/routing number '$aba'\n"; } + ## set custname to business name if business checking or savings account is used otherwise leave as first and last name. + my $custname = $cust_pay_batch->cust_main->batch_payment_payname($cust_pay_batch); + $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). ' '. @@ -189,8 +197,7 @@ $name = 'RBC'; sprintf("%010.0f",$cust_pay_batch->amount*100). ' '. time2str("%Y%j", time + 86400). - sprintf("%-30.30s", encode('utf8', $cust_pay_batch->cust_main->first . ' ' . - $cust_pay_batch->cust_main->last)). + sprintf("%-30.30s", encode('utf8', $custname)). 'E'. # English ' '. sprintf("%-15s", $shortname). @@ -221,5 +228,10 @@ $name = 'RBC'; }, ); +## this format can handle credit transactions +sub can_handle_credits { + 1; +} + 1;