summaryrefslogtreecommitdiff
path: root/FS/FS/pay_batch.pm
diff options
context:
space:
mode:
authormark <mark>2010-01-07 09:48:51 +0000
committermark <mark>2010-01-07 09:48:51 +0000
commit20b563c398c5c9264a998d31ae0d3d95454d526e (patch)
tree20f7c173af9c18b6ec59c52cab97780f03baa0cf /FS/FS/pay_batch.pm
parent90c18c7cbe323bf4072335745d250cd0fbdd5f5e (diff)
Fix problems with RBC batch import (RT#6967)
Diffstat (limited to 'FS/FS/pay_batch.pm')
-rw-r--r--FS/FS/pay_batch.pm16
1 files changed, 13 insertions, 3 deletions
diff --git a/FS/FS/pay_batch.pm b/FS/FS/pay_batch.pm
index c1262e0..59ff2c3 100644
--- a/FS/FS/pay_batch.pm
+++ b/FS/FS/pay_batch.pm
@@ -202,6 +202,7 @@ sub import_results {
my $begin_condition = $info->{'begin_condition'};
my $end_condition = $info->{'end_condition'};
my $end_hook = $info->{'end_hook'};
+ my $skip_condition = $info->{'skip_condition'};
my $hook = $info->{'hook'};
my $approved_condition = $info->{'approved'};
my $declined_condition = $info->{'declined'};
@@ -295,8 +296,13 @@ sub import_results {
$hash{$field} = $value;
}
- if ( defined($begin_condition) and &{$begin_condition}(\%hash, $line)) {
- undef $begin_condition;
+ if ( defined($begin_condition) ) {
+ if ( &{$begin_condition}(\%hash, $line) ) {
+ undef $begin_condition;
+ }
+ else {
+ next;
+ }
}
if ( defined($end_condition) and &{$end_condition}(\%hash, $line) ) {
@@ -309,6 +315,10 @@ sub import_results {
last;
}
+ if ( defined($skip_condition) and &{$skip_condition}(\%hash, $line) ) {
+ next;
+ }
+
my $cust_pay_batch =
qsearchs('cust_pay_batch', { 'paybatchnum' => $hash{'paybatchnum'}+0 } );
unless ( $cust_pay_batch ) {
@@ -455,7 +465,7 @@ sub export_batch {
if($cust_pay_batch) { # that is, it wasn't deleted
$batchcount++;
$batchtotal += $cust_pay_batch->amount;
- $batch .= &{$info->{'row'}}($cust_pay_batch, $self) . "\n";
+ $batch .= &{$info->{'row'}}($cust_pay_batch, $self, $batchcount, $batchtotal) . "\n";
}
}
my $f = $info->{'footer'};