X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpay_batch.pm;h=a7628f6e06666dea971930f96738a18672e7b4dc;hb=892ffefd1fda5aea9c6a3fe980613a3ab2e976b9;hp=f41b3e38b21da552de74139c5a6cd3146631902b;hpb=771e64b732c69902be5552d53d4a7a1199d5fca3;p=freeside.git diff --git a/FS/FS/pay_batch.pm b/FS/FS/pay_batch.pm index f41b3e38b..a7628f6e0 100644 --- a/FS/FS/pay_batch.pm +++ b/FS/FS/pay_batch.pm @@ -222,17 +222,17 @@ takes precedence over I. Supported format keys (defined in the specified FS::pay_batch module) are: -I - CSV, fixed, variable, XML +I - required, can be CSV, fixed, variable, XML -I - list of field names for each row/line +I - required list of field names for each row/line I - regular expression for fixed filetype -I - for variable filetype +I - required for variable filetype -I - for XML filetype +I - required for XML filetype -I - for XML filetype +I - required for XML filetype I - sub, ignore all lines before this returns true @@ -242,11 +242,11 @@ I - sub, runs immediately after end_condition returns true I - sub, skip lines when this returns true -I - sub, runs before approved/declined conditions are checked +I - required, sub, runs before approved/declined conditions are checked -I - sub, returns true when approved +I - required, sub, returns true when approved -I - sub, returns true when declined +I - required, sub, returns true when declined I - sub, decide whether or not to close the batch @@ -558,7 +558,14 @@ sub import_from_gateway { my $processor = $gateway->batch_processor(%proc_opt); - my @batches = $processor->receive; + my @processor_ids = map { $_->processor_id } + qsearch({ + 'table' => 'pay_batch', + 'hashref' => { 'status' => 'I' }, + 'extra_sql' => q( AND processor_id != '' AND processor_id IS NOT NULL) + }); + + my @batches = $processor->receive(@processor_ids); my $num = 0; @@ -1044,6 +1051,11 @@ sub export_to_gateway { ); $processor->submit($batch); + if ($batch->processor_id) { + $self->set('processor_id',$batch->processor_id); + $self->replace; + } + $dbh->commit or die $dbh->errstr if $oldAutoCommit; ''; }