use per-agent config for all EFT Canada batch options, #23757, from #14859
authorMark Wells <mark@freeside.biz>
Tue, 9 Jul 2013 21:57:49 +0000 (14:57 -0700)
committerMark Wells <mark@freeside.biz>
Tue, 9 Jul 2013 21:57:49 +0000 (14:57 -0700)
FS/FS/pay_batch.pm
FS/FS/pay_batch/eft_canada.pm

index 2a048a1..3a06914 100644 (file)
@@ -946,7 +946,7 @@ sub export_batch {
 
   my $info = $export_info{$format} or die "Format not found: '$format'\n";
 
-  &{$info->{'init'}}($conf) if exists($info->{'init'});
+  &{$info->{'init'}}($conf, $self->agentnum) if exists($info->{'init'});
 
   my $oldAutoCommit = $FS::UID::AutoCommit;
   local $FS::UID::AutoCommit = 0;
index b24c9c3..64fd2f9 100644 (file)
@@ -58,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];