RT#33582: RBC return batch processing failure
[freeside.git] / FS / FS / pay_batch / RBC.pm
index 7536266..a9b670d 100644 (file)
@@ -14,7 +14,7 @@ $name = 'RBC';
 %import_info = (
   'filetype'    => 'fixed',
   'formatre'    => 
-  '^(.).{18}(.{4}).{3}(.).{11}(.{19}).{6}(.{30}).{17}(.{9})(.{18}).{6}(.{14}).{23}(.).{9}\r?$',
+  '^([0134]).{18}(.{4}).{3}(.).{11}(.{19}).{6}(.{30}).{17}(.{9})(.{18}).{6}(.{14}).{23}(.).{9}\r?$',
   'fields' => [ qw(
     recordtype
     batchnum
@@ -61,7 +61,8 @@ $name = 'RBC';
   },
   'skip_condition' => sub {
       my $hash = shift;
-      $hash->{'subtype'} ne '0';
+      $hash->{'recordtype'} eq '3' ||
+        $hash->{'subtype'} ne '0';
   },
 );
 
@@ -110,9 +111,9 @@ $name = 'RBC';
     ' '.
     sprintf("%-19s", $cust_pay_batch->paybatchnum).
     '00'.
-    sprintf("%04u", $bankno).
-    sprintf("%05u", $branch).
-    sprintf("%-18u", $account).
+    sprintf("%04s", $bankno).
+    sprintf("%05s", $branch).
+    sprintf("%-18s", $account).
     ' '.
     sprintf("%010.0f",$cust_pay_batch->amount*100).
     '      '.