RT# 74435 - Adding option to allow refunds using electronic check batch with RBC...
[freeside.git] / FS / FS / pay_batch / RBC.pm
index 142c50b..05ee4e5 100644 (file)
@@ -180,8 +180,13 @@ $name = 'RBC';
       if (($cust_pay_batch->cust_main->paytype eq "Business checking" || $cust_pay_batch->cust_main->paytype eq "Business savings") && $cust_pay_batch->cust_main->company);
 
     $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).
     ' '.