diff options
| author | Mark Wells <mark@freeside.biz> | 2012-06-30 16:37:06 -0700 |
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2012-06-30 16:37:06 -0700 |
| commit | 92aedddd3684167abb60cd3f1d77bbc156c592e6 (patch) | |
| tree | f061fdd9dd2434ad6f490f01d682496b46a925d5 /httemplate/search/pay_batch.cgi | |
| parent | e5fd495945bc0b907cf0d4d21d52bb6b12e7051a (diff) | |
Business::BatchPayment interface, #17373
Diffstat (limited to 'httemplate/search/pay_batch.cgi')
| -rwxr-xr-x | httemplate/search/pay_batch.cgi | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/httemplate/search/pay_batch.cgi b/httemplate/search/pay_batch.cgi index b2a15ef3d..05415f36e 100755 --- a/httemplate/search/pay_batch.cgi +++ b/httemplate/search/pay_batch.cgi @@ -14,7 +14,8 @@ 'Type', 'First Download', 'Last Upload', - 'Item Count', + 'Items', + 'Unresolved', 'Amount', 'Status', ], @@ -46,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) |
