X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Fcust_pay_batch.cgi;h=3420e97b65c2f9f2b4a1f58843be1cb249def07f;hp=960843adfda9a6e72e4c44ad89cb6a109db8baa1;hb=a800fde5d31fb9b9cfe46b1ce2f68ea8e56bff53;hpb=1fd6d8cf5d7854860ef4fd10ed89828e0c04ec39 diff --git a/httemplate/browse/cust_pay_batch.cgi b/httemplate/browse/cust_pay_batch.cgi index 960843adf..3420e97b6 100755 --- a/httemplate/browse/cust_pay_batch.cgi +++ b/httemplate/browse/cust_pay_batch.cgi @@ -1,10 +1,38 @@ - + +<%= header("Pending credit card batch", menubar( 'Main Menu' => $p,)) %> + +
+Download batch in format
+

+ +
+Upload results
+Filename
+Format
+
+
+ <% + my $statement = "SELECT SUM(amount) from cust_pay_batch"; + 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]; -print header("Pending credit card batch", menubar( - 'Main Menu' => $p, -# 'Add new referral' => "../edit/part_referral.cgi", -)), &table(), <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 pending batch
+ +
+<%= &table() %> # inv# @@ -14,39 +42,35 @@ print header("Pending credit card batch", menubar( Exp Amount -END - -foreach my $cust_pay_batch ( sort { - $a->getfield('paybatchnum') <=> $b->getfield('paybatchnum') -} qsearch('cust_pay_batch',{}) ) { -# my $date = time2str( "%a %b %e %T %Y", $queue->_date ); -# my $status = $hashref->{status}; -# if ( $status eq 'failed' || $status eq 'locked' ) { -# $status .= -# qq! ( retry |!. -# qq! remove )!; -# } - my $cardnum = $cust_pay_batch->{cardnum}; - $cardnum =~ s/.{4}$/xxxx/; - print <paybatchnum <=> $b->paybatchnum } + qsearch('cust_pay_batch', {} ) +) { + my $cardnum = $cust_pay_batch->cardnum; + #$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->{last}, $cust_pay_batch->{last} - $cust_pay_batch->{payname} - $cardnum - $cust_pay_batch->{exp} - \$$cust_pay_batch->{amount} + <%= $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 %> -END -} +<% } %> -print < -END - -%>