summaryrefslogtreecommitdiff
path: root/FS/FS/pay_batch.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-08-07 18:39:05 -0700
committerMark Wells <mark@freeside.biz>2012-08-07 18:39:05 -0700
commit21254f0e0062b92c19530c49c6eacc9ce3e93827 (patch)
tree34115abe005a554f676e552f07575751865ef99e /FS/FS/pay_batch.pm
parent21891ab9181cb54c36d78d6aacccadc1aaf910d7 (diff)
Business::BatchPayment fixes for TD EFT format, #17878
Diffstat (limited to 'FS/FS/pay_batch.pm')
-rw-r--r--FS/FS/pay_batch.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/FS/FS/pay_batch.pm b/FS/FS/pay_batch.pm
index 813d096..e98cf5a 100644
--- a/FS/FS/pay_batch.pm
+++ b/FS/FS/pay_batch.pm
@@ -807,8 +807,8 @@ sub try_to_resolve {
}
);
- if ( @unresolved ) {
- my $days = $conf->config('batch-auto_resolve_days') || '';
+ if ( @unresolved and $conf->exists('batch-auto_resolve_days') ) {
+ my $days = $conf->config('batch-auto_resolve_days'); # can be zero
# either 'approve' or 'decline'
my $action = $conf->config('batch-auto_resolve_status') || '';
return unless
@@ -861,6 +861,9 @@ sub prepare_for_export {
return "error updating pay_batch status: $error\n" if $error;
} elsif ($status eq 'I' && $curuser->access_right('Reprocess batches')) {
$first_download = 0;
+ } elsif ($status eq 'R' &&
+ $curuser->access_right('Redownload resolved batches')) {
+ $first_download = 0;
} else {
die "No pending batch.\n";
}
@@ -1080,7 +1083,7 @@ sub _upgrade_data {
for my $format (keys %export_info) {
my $mod = "FS::pay_batch::$format";
if ( $mod->can('_upgrade_gateway')
- and length( $conf->config("batchconfig-$format") ) ) {
+ and exists( $conf->config("batchconfig-$format") ) ) {
local $@;
my ($module, %gw_options) = $mod->_upgrade_gateway;
@@ -1109,7 +1112,7 @@ sub _upgrade_data {
# and if appropriate, make it the system default
for my $payby (qw(CARD CHEK)) {
- if ( $conf->config("batch-fixed_format-$payby") eq $format ) {
+ if ( ($conf->config("batch-fixed_format-$payby") || '') eq $format ) {
warn "Setting as default for $payby.\n";
$conf->set("batch-gateway-$payby", $gateway->gatewaynum);
$conf->delete("batch-fixed_format-$payby");