X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Fcust_pay_batch.cgi;h=e40e95870d23bff536f749cc32a5a4da7a8b2bd7;hp=98ea2f5a2b41fc9bfa01fa8bb69e74cdc8b6b804;hb=3ce7691203a7737406bf2d4442f7fd84b81f847e;hpb=15e561850b61b10a92a46d8f3e316d53d4970087 diff --git a/httemplate/browse/cust_pay_batch.cgi b/httemplate/browse/cust_pay_batch.cgi index 98ea2f5a2..e40e95870 100755 --- a/httemplate/browse/cust_pay_batch.cgi +++ b/httemplate/browse/cust_pay_batch.cgi @@ -1,27 +1,27 @@ -<%= include("/elements/header.html","Credit card batch details", 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; +% +% -<% -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; - -%> - -
+ Download batch in format
+

-
+ Upload results
Filename
Format

+% +% 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 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]; +% -<% - 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 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
-$<%= sprintf("%.2f", $total) %> total in batch
+<% $cards %> credit card payments batched
+$<% sprintf("%.2f", $total) %> total in batch

-<%= &table() %> +<% &table() %> # inv# @@ -62,35 +62,35 @@ $<%= sprintf("%.2f", $total) %> total in batch
Amount Status +% +%foreach my $cust_pay_batch ( sort { $a->paybatchnum <=> $b->paybatchnum } +% qsearch('cust_pay_batch', {'batchnum'=>$batchnum} ) +%) { +% my $cardnum = $cust_pay_batch->payinfo; +% #$cardnum =~ s/.{4}$/xxxx/; +% $cardnum = 'x'x(length($cardnum)-4). substr($cardnum,(length($cardnum)-4)); +% +% $cust_pay_batch->exp =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/; +% my( $mon, $year ) = ( $2, $1 ); +% $mon = "0$mon" if $mon < 10; +% my $exp = "$mon/$year"; +% +% -<% -foreach my $cust_pay_batch ( sort { $a->paybatchnum <=> $b->paybatchnum } - qsearch('cust_pay_batch', {'batchnum'=>$batchnum} ) -) { - my $cardnum = $cust_pay_batch->payinfo; - #$cardnum =~ s/.{4}$/xxxx/; - $cardnum = 'x'x(length($cardnum)-4). substr($cardnum,(length($cardnum)-4)); - - $cust_pay_batch->exp =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/; - my( $mon, $year ) = ( $2, $1 ); - $mon = "0$mon" if $mon < 10; - my $exp = "$mon/$year"; - -%> - <%= $cust_pay_batch->paybatchnum %> - <%= $cust_pay_batch->invnum %> - <%= $cust_pay_batch->custnum %> - <%= $cust_pay_batch->get('last'). ', '. $cust_pay_batch->first %> - <%= $cust_pay_batch->payname %> - <%= $cardnum %> - <%= $exp %> - $<%= $cust_pay_batch->amount %> - <%= $cust_pay_batch->status %> + <% $cust_pay_batch->paybatchnum %> + <% $cust_pay_batch->invnum %> + <% $cust_pay_batch->custnum %> + <% $cust_pay_batch->get('last'). ', '. $cust_pay_batch->first %> + <% $cust_pay_batch->payname %> + <% $cardnum %> + <% $exp %> + $<% $cust_pay_batch->amount %> + <% $cust_pay_batch->status %> +% } -<% } %>