use per-agent config for all EFT Canada batch options, #23757, from #14859
[freeside.git] / FS / FS / pay_batch / eft_canada.pm
index ea9d584..64fd2f9 100644 (file)
@@ -25,12 +25,6 @@ my %holiday_yearly = (
   12 => { map {$_=>1} 26 }, #boxing day
 );
 my %holiday = (
-  2012 => {
-             7 => { map {$_=>1}  2 }, #canada day
-             8 => { map {$_=>1}  6 }, #First Monday of August Civic Holiday
-             9 => { map {$_=>1}  3 }, #labour day
-            10 => { map {$_=>1}  8 }, #thanksgiving
-          },
   2013 => {  2 => { map {$_=>1} 18 }, #family day
              3 => { map {$_=>1} 29 }, #good friday
              4 => { map {$_=>1}  1 }, #easter monday
@@ -64,7 +58,13 @@ my %holiday = (
 
   init => sub {
     my $conf = shift;
-    my @config = $conf->config('batchconfig-eft_canada'); 
+    my $agentnum = shift;
+    my @config;
+    if ( $conf->exists('batch-spoolagent') ) {
+      @config = $conf->config('batchconfig-eft_canada', $agentnum);
+    } else {
+      @config = $conf->config('batchconfig-eft_canada');
+    }
     # SFTP login, password, trans code, delay time
     my $process_delay;
     ($trans_code, $process_delay) = @config[2,3];
@@ -112,7 +112,7 @@ my %holiday = (
     }
     push @fields, sprintf('%05s', $branch),
                   sprintf('%03s', $bankno),
-                  sprintf('%012s', $account),
+                  $account,
                   sprintf('%.02f', $cust_pay_batch->amount);
     # DB = debit
     push @fields, 'DB', $trans_code, $process_date;