X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fpay_batch.cgi;h=05415f36e479716fa0b98abdb7b1ee67314c1caa;hb=85e677b86fc37c54e6de2b06340351a28f5a5916;hp=34297a50059d37db33ce12320489e9c5475bdf40;hpb=b5c4237a34aef94976bc343c8d9e138664fc3984;p=freeside.git diff --git a/httemplate/search/pay_batch.cgi b/httemplate/search/pay_batch.cgi index 34297a500..05415f36e 100755 --- a/httemplate/search/pay_batch.cgi +++ b/httemplate/search/pay_batch.cgi @@ -7,11 +7,15 @@ 'order_by' => 'ORDER BY batchnum DESC', }, 'count_query' => "$count_query $extra_sql", + 'agent_virt' => 1, + 'agent_null_right' => 'Process batches', #'Process global batches', + 'agent_pos' => 1, 'header' => [ 'Batch', 'Type', 'First Download', 'Last Upload', - 'Item Count', + 'Items', + 'Unresolved', 'Amount', 'Status', ], @@ -43,13 +47,16 @@ } }, sub { - my $st = "SELECT COUNT(*) from cust_pay_batch WHERE batchnum=" . shift->batchnum; - my $sth = dbh->prepare($st) - or die dbh->errstr. "doing $st"; - $sth->execute - or die "Error executing \"$st\": ". $sth->errstr; - $sth->fetchrow_arrayref->[0]; - }, + FS::cust_pay_batch->count( + 'batchnum = '.$_[0]->batchnum + ) + }, + sub { + FS::cust_pay_batch->count( + 'status is null and batchnum = '. + $_[0]->batchnum + ) + }, sub { my $st = "SELECT SUM(amount) from cust_pay_batch WHERE batchnum=" . shift->batchnum; my $sth = dbh->prepare($st)