[freeside-commits] freeside/FS/FS pay_batch.pm,1.17,1.18

Mark Wells mark at wavetail.420.am
Thu Jan 7 01:48:53 PST 2010


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv12146/FS/FS

Modified Files:
	pay_batch.pm 
Log Message:
Fix problems with RBC batch import (RT#6967)

Index: pay_batch.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/pay_batch.pm,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- pay_batch.pm	3 Nov 2009 20:44:04 -0000	1.17
+++ pay_batch.pm	7 Jan 2010 09:48:50 -0000	1.18
@@ -202,6 +202,7 @@
   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 @@
       $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 @@
       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 @@
     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'};



More information about the freeside-commits mailing list