From c1bb4ddb71147d0571bd301a6d8c452fdf0e1bc9 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 31 Jan 2006 04:26:54 +0000 Subject: move header() to include(/elements/header.html) so it can be changed in one place, thanks to Scott Edwards --- httemplate/browse/cust_pay_batch.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/browse/cust_pay_batch.cgi') diff --git a/httemplate/browse/cust_pay_batch.cgi b/httemplate/browse/cust_pay_batch.cgi index 3420e97b6..0f05ecb25 100755 --- a/httemplate/browse/cust_pay_batch.cgi +++ b/httemplate/browse/cust_pay_batch.cgi @@ -1,5 +1,5 @@ -<%= header("Pending credit card batch", menubar( 'Main Menu' => $p,)) %> +<%= include("/elements/header.html","Pending credit card batch", menubar( 'Main Menu' => $p,)) %>
Download batch in format + +


@@ -11,7 +13,9 @@ Download batch in format
Format

@@ -47,7 +51,7 @@ $<%= sprintf("%.2f", $total) %> total in pending batch
foreach my $cust_pay_batch ( sort { $a->paybatchnum <=> $b->paybatchnum } qsearch('cust_pay_batch', {} ) ) { - my $cardnum = $cust_pay_batch->cardnum; + my $cardnum = $cust_pay_batch->payinfo; #$cardnum =~ s/.{4}$/xxxx/; $cardnum = 'x'x(length($cardnum)-4). substr($cardnum,(length($cardnum)-4)); -- cgit v1.2.1 From 580330233cbf32c58d9f29dc391bd2ebd83e16d5 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 16 Jul 2006 00:55:06 +0000 Subject: odds and ends --- httemplate/browse/cust_pay_batch.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/browse/cust_pay_batch.cgi') diff --git a/httemplate/browse/cust_pay_batch.cgi b/httemplate/browse/cust_pay_batch.cgi index 6ee983ab4..c7f0afe76 100755 --- a/httemplate/browse/cust_pay_batch.cgi +++ b/httemplate/browse/cust_pay_batch.cgi @@ -15,7 +15,7 @@ Filename
Format

-- cgit v1.2.1 From 6c375156081be5d2023001ed8eaac9b6db568e95 Mon Sep 17 00:00:00 2001 From: jeff Date: Wed, 9 Aug 2006 06:43:02 +0000 Subject: batch refactor --- httemplate/browse/cust_pay_batch.cgi | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'httemplate/browse/cust_pay_batch.cgi') diff --git a/httemplate/browse/cust_pay_batch.cgi b/httemplate/browse/cust_pay_batch.cgi index c7f0afe76..98ea2f5a2 100755 --- a/httemplate/browse/cust_pay_batch.cgi +++ b/httemplate/browse/cust_pay_batch.cgi @@ -1,12 +1,24 @@ -<%= 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; + +%>
Download batch in format
+ + +

@@ -15,25 +27,28 @@ Filename
Format

<% - 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
-$<%= sprintf("%.2f", $total) %> total in pending batch
+$<%= sprintf("%.2f", $total) %> total in batch

<%= &table() %> @@ -45,11 +60,12 @@ $<%= sprintf("%.2f", $total) %> total in pending batch
Card Exp Amount + Status <% 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 @@ foreach my $cust_pay_batch ( sort { $a->paybatchnum <=> $b->paybatchnum } <%= $cardnum %> <%= $exp %> $<%= $cust_pay_batch->amount %> + <%= $cust_pay_batch->status %> <% } %> -- cgit v1.2.1 From 3ce7691203a7737406bf2d4442f7fd84b81f847e Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 23 Aug 2006 22:25:39 +0000 Subject: Will things ever be the same again? It's the final masonize --- httemplate/browse/cust_pay_batch.cgi | 110 +++++++++++++++++------------------ 1 file changed, 55 insertions(+), 55 deletions(-) (limited to 'httemplate/browse/cust_pay_batch.cgi') 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 %> +% } -<% } %> -- cgit v1.2.1 From 6af1b1bfa25e5ececef5e0dcd38b55917121cee2 Mon Sep 17 00:00:00 2001 From: jeff Date: Sat, 26 Aug 2006 23:15:14 +0000 Subject: batch refactor continued --- httemplate/browse/cust_pay_batch.cgi | 97 ------------------------------------ 1 file changed, 97 deletions(-) delete mode 100755 httemplate/browse/cust_pay_batch.cgi (limited to 'httemplate/browse/cust_pay_batch.cgi') diff --git a/httemplate/browse/cust_pay_batch.cgi b/httemplate/browse/cust_pay_batch.cgi deleted file mode 100755 index e40e95870..000000000 --- a/httemplate/browse/cust_pay_batch.cgi +++ /dev/null @@ -1,97 +0,0 @@ - -<% 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; -% -% - - -
-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]; -% - -<% $cards %> credit card payments batched
-$<% sprintf("%.2f", $total) %> total in batch
- -
-<% &table() %> - - # - inv# - Customer - Card name - Card - Exp - 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"; -% -% - - - - <% $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 %> - -% } - - - - - -- cgit v1.2.1