projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix otaker upgrade for cust_main
[freeside.git]
/
FS
/
FS
/
pay_batch.pm
diff --git
a/FS/FS/pay_batch.pm
b/FS/FS/pay_batch.pm
index
c1262e0
..
6a27554
100644
(file)
--- 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 $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'};
my $hook = $info->{'hook'};
my $approved_condition = $info->{'approved'};
my $declined_condition = $info->{'declined'};
@@
-271,11
+272,12
@@
sub import_results {
};
push @all_values, [ $csv->fields(), $line ];
}elsif ($filetype eq 'fixed'){
};
push @all_values, [ $csv->fields(), $line ];
}elsif ($filetype eq 'fixed'){
- my @values = ( $line =~ /$formatre/
, $line
);
+ my @values = ( $line =~ /$formatre/ );
unless (@values) {
$dbh->rollback if $oldAutoCommit;
return "can't parse: ". $line;
};
unless (@values) {
$dbh->rollback if $oldAutoCommit;
return "can't parse: ". $line;
};
+ push @values, $line;
push @all_values, \@values;
}else{
$dbh->rollback if $oldAutoCommit;
push @all_values, \@values;
}else{
$dbh->rollback if $oldAutoCommit;
@@
-295,8
+297,13
@@
sub import_results {
$hash{$field} = $value;
}
$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) ) {
}
if ( defined($end_condition) and &{$end_condition}(\%hash, $line) ) {
@@
-309,6
+316,10
@@
sub import_results {
last;
}
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 ) {
my $cust_pay_batch =
qsearchs('cust_pay_batch', { 'paybatchnum' => $hash{'paybatchnum'}+0 } );
unless ( $cust_pay_batch ) {
@@
-455,7
+466,7
@@
sub export_batch {
if($cust_pay_batch) { # that is, it wasn't deleted
$batchcount++;
$batchtotal += $cust_pay_batch->amount;
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'};
}
}
my $f = $info->{'footer'};