summaryrefslogtreecommitdiff
path: root/FS/bin/freeside-eftca-upload
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2015-12-22 00:28:53 -0600
committerJonathan Prykop <jonathan@freeside.biz>2016-01-05 21:06:41 -0600
commit1667ab631f9fbd0f4ceeb6ec000b0f4ff3ddb51a (patch)
treef1fae9a3e8f6a01782a45528c04e6e9d9ded749a /FS/bin/freeside-eftca-upload
parent9088495eea6c836c7086dec1e76839ed8e93e0be (diff)
RT#34295: Error when attempting to create batch payments [better handling of empty batches]
Diffstat (limited to 'FS/bin/freeside-eftca-upload')
-rwxr-xr-xFS/bin/freeside-eftca-upload4
1 files changed, 4 insertions, 0 deletions
diff --git a/FS/bin/freeside-eftca-upload b/FS/bin/freeside-eftca-upload
index b66765af3..107aa19ce 100755
--- a/FS/bin/freeside-eftca-upload
+++ b/FS/bin/freeside-eftca-upload
@@ -47,6 +47,10 @@ foreach my $pay_batch (@batches) {
my $filename = time2str('%Y%m%d', time) . '-' . sprintf('%06d.csv',$batchnum);
print STDERR "Exporting batch $batchnum to $filename...\n" if $opt_v;
my $text = $pay_batch->export_batch(format => 'eft_canada');
+ unless ($text) {
+ print STDERR "Batch is empty, resolving..." if $opt_v;
+ next;
+ }
open OUT, ">$tmpdir/$filename";
print OUT $text;
close OUT;