2 <%= include("/elements/header.html","Credit card batches", menubar( 'Main Menu' => $p,)) %>
7 my %statusmap = ('I'=>'In Transit', 'O'=>'Open', 'R'=>'Resolved');
14 <TH>First Download</TH>
22 foreach my $pay_batch ( sort { $b->batchnum <=> $a->batchnum }
23 qsearch('pay_batch', {} )
26 my $statement = "SELECT SUM(amount) from cust_pay_batch WHERE batchnum=" .
28 my $sth = dbh->prepare($statement) or die dbh->errstr. "doing $statement";
29 $sth->execute or die "Error executing \"$statement\": ". $sth->errstr;
30 my $total = $sth->fetchrow_arrayref->[0];
32 my $c_statement = "SELECT COUNT(*) from cust_pay_batch WHERE batchnum=" .
34 my $c_sth = dbh->prepare($c_statement)
35 or die dbh->errstr. "doing $c_statement";
36 $c_sth->execute or die "Error executing \"$c_statement\": ". $c_sth->errstr;
37 my $cards = $c_sth->fetchrow_arrayref->[0];
42 <TD><A HREF="cust_pay_batch.cgi?<%= $pay_batch->batchnum %>"><%= $pay_batch->batchnum %></TD>
43 <TD><%= $pay_batch->download ? time2str("%a %b %e %T %Y", $pay_batch->download) : '' %></TD>
44 <TD><%= $pay_batch->upload ? time2str("%a %b %e %T %Y", $pay_batch->upload) : '' %></TD>
45 <TD><%= $cards %></TD>
46 <TD align="right"><%= $total %></TD>
47 <TD><%= $statusmap{$pay_batch->status} %></TD>