[freeside-commits] freeside/httemplate/browse cust_pay_batch.cgi,
1.10, 1.11 pay_batch.cgi, NONE, 1.1
Jeff Finucane,420,,
jeff at wavetail.420.am
Tue Aug 8 23:43:03 PDT 2006
- Previous message: [freeside-commits] freeside README.1.7.0,1.7,1.8
- Next message: [freeside-commits] freeside/FS/FS Schema.pm, 1.19, 1.20 Setup.pm,
1.3, 1.4 cust_bill.pm, 1.149, 1.150 cust_main.pm, 1.220,
1.221 cust_pay_batch.pm, 1.12, 1.13 part_bill_event.pm, 1.22,
1.23 pay_batch.pm, 1.2, 1.3 payby.pm, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/httemplate/browse
In directory wavetail:/tmp/cvs-serv27643/httemplate/browse
Modified Files:
cust_pay_batch.cgi
Added Files:
pay_batch.cgi
Log Message:
batch refactor
Index: cust_pay_batch.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/cust_pay_batch.cgi,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cust_pay_batch.cgi 16 Jul 2006 00:55:05 -0000 1.10
+++ cust_pay_batch.cgi 9 Aug 2006 06:43:01 -0000 1.11
@@ -1,12 +1,24 @@
<!-- mason kludge -->
-<%= include("/elements/header.html","Pending credit card batch", menubar( 'Main Menu' => $p,)) %>
+<%= include("/elements/header.html","Credit card batch details", menubar( 'Main Menu' => $p,)) %>
+
+<%
+
+die "No batch specified (bad URL)!" unless $cgi->keywords;
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/;
+my $batchnum = $1;
+my $pay_batch = qsearchs('pay_batch',{'batchnum'=>$batchnum});
+die "Batch not found!" unless $pay_batch;
+
+%>
<FORM ACTION="<%=$p%>misc/download-batch.cgi" METHOD="POST">
Download batch in format <SELECT NAME="format">
<OPTION VALUE="">Default batch mode</OPTION>
<OPTION VALUE="csv-td_canada_trust-merchant_pc_batch">CSV file for TD Canada Trust Merchant PC Batch</OPTION>
-<OPTION VALUE="BoM">Bank of Montreal ECA results</OPTION>
-</SELECT><INPUT TYPE="submit" VALUE="Download"></FORM>
+<OPTION VALUE="PAP">80 byte file for TD Canada Trust PAP Batch</OPTION>
+<OPTION VALUE="BoM">Bank of Montreal ECA batch</OPTION>
+</SELECT><INPUT TYPE="hidden" NAME="batchnum" VALUE="<%= $batchnum %>"><INPUT TYPE="submit" VALUE="Download"></FORM>
<BR><BR>
<FORM ACTION="<%=$p%>misc/upload-batch.cgi" METHOD="POST" ENCTYPE="multipart/form-data">
@@ -15,25 +27,28 @@
Format <SELECT NAME="format">
<OPTION VALUE="">Default batch mode</OPTION>
<OPTION VALUE="csv-td_canada_trust-merchant_pc_batch">CSV results from TD Canada Trust Merchant PC Batch</OPTION>
-<OPTION VALUE="BoM">Bank of Montreal ECA batch</OPTION>
+<OPTION VALUE="PAP">264 byte results for TD Canada Trust PAP Batch</OPTION>
+<OPTION VALUE="BoM">Bank of Montreal ECA results</OPTION>
</SELECT><BR>
<INPUT TYPE="submit" VALUE="Upload"></FORM>
<BR>
<%
- my $statement = "SELECT SUM(amount) from cust_pay_batch";
+ my $statement = "SELECT SUM(amount) from cust_pay_batch WHERE batchnum=".
+ $batchnum;
my $sth = dbh->prepare($statement) or die dbh->errstr. "doing $statement";
$sth->execute or die "Error executing \"$statement\": ". $sth->errstr;
my $total = $sth->fetchrow_arrayref->[0];
- my $c_statement = "SELECT COUNT(*) from cust_pay_batch";
+ my $c_statement = "SELECT COUNT(*) from cust_pay_batch WHERE batchnum=".
+ $batchnum;
my $c_sth = dbh->prepare($c_statement)
or die dbh->errstr. "doing $c_statement";
$c_sth->execute or die "Error executing \"$c_statement\": ". $c_sth->errstr;
my $cards = $c_sth->fetchrow_arrayref->[0];
%>
<%= $cards %> credit card payments batched<BR>
-$<%= sprintf("%.2f", $total) %> total in pending batch<BR>
+$<%= sprintf("%.2f", $total) %> total in batch<BR>
<BR>
<%= &table() %>
@@ -45,11 +60,12 @@
<TH>Card</TH>
<TH>Exp</TH>
<TH>Amount</TH>
+ <TH>Status</TH>
</TR>
<%
foreach my $cust_pay_batch ( sort { $a->paybatchnum <=> $b->paybatchnum }
- qsearch('cust_pay_batch', {} )
+ qsearch('cust_pay_batch', {'batchnum'=>$batchnum} )
) {
my $cardnum = $cust_pay_batch->payinfo;
#$cardnum =~ s/.{4}$/xxxx/;
@@ -71,6 +87,7 @@
<TD><%= $cardnum %></TD>
<TD><%= $exp %></TD>
<TD align="right">$<%= $cust_pay_batch->amount %></TD>
+ <TD><%= $cust_pay_batch->status %></TD>
</TR>
<% } %>
--- NEW FILE: pay_batch.cgi ---
<!-- mason kludge -->
<%= include("/elements/header.html","Credit card batches", menubar( 'Main Menu' => $p,)) %>
<BR><BR>
<%
my %statusmap = ('I'=>'In Transit', 'O'=>'Open', 'R'=>'Resolved');
%>
<BR>
<%= &table() %>
<TR>
<TH>Batch</TH>
<TH>First Download</TH>
<TH>Last Upload</TH>
<TH>Item Count</TH>
<TH>Amount</TH>
<TH>Status</TH>
</TR>
<%
foreach my $pay_batch ( sort { $b->batchnum <=> $a->batchnum }
qsearch('pay_batch', {} )
) {
my $statement = "SELECT SUM(amount) from cust_pay_batch WHERE batchnum=" .
$pay_batch->batchnum;
my $sth = dbh->prepare($statement) or die dbh->errstr. "doing $statement";
$sth->execute or die "Error executing \"$statement\": ". $sth->errstr;
my $total = $sth->fetchrow_arrayref->[0];
my $c_statement = "SELECT COUNT(*) from cust_pay_batch WHERE batchnum=" .
$pay_batch->batchnum;
my $c_sth = dbh->prepare($c_statement)
or die dbh->errstr. "doing $c_statement";
$c_sth->execute or die "Error executing \"$c_statement\": ". $c_sth->errstr;
my $cards = $c_sth->fetchrow_arrayref->[0];
%>
<TR>
<TD><A HREF="cust_pay_batch.cgi?<%= $pay_batch->batchnum %>"><%= $pay_batch->batchnum %></TD>
<TD><%= $pay_batch->download ? time2str("%a %b %e %T %Y", $pay_batch->download) : '' %></TD>
<TD><%= $pay_batch->upload ? time2str("%a %b %e %T %Y", $pay_batch->upload) : '' %></TD>
<TD><%= $cards %></TD>
<TD align="right"><%= $total %></TD>
<TD><%= $statusmap{$pay_batch->status} %></TD>
</TR>
<% } %>
</TABLE>
</BODY>
</HTML>
- Previous message: [freeside-commits] freeside README.1.7.0,1.7,1.8
- Next message: [freeside-commits] freeside/FS/FS Schema.pm, 1.19, 1.20 Setup.pm,
1.3, 1.4 cust_bill.pm, 1.149, 1.150 cust_main.pm, 1.220,
1.221 cust_pay_batch.pm, 1.12, 1.13 part_bill_event.pm, 1.22,
1.23 pay_batch.pm, 1.2, 1.3 payby.pm, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list