add a yesterday column and a total row, closes: Bug#797
[freeside.git] / httemplate / edit / cust_pay.cgi
index 38654e9..f6ae7b2 100755 (executable)
@@ -1,20 +1,9 @@
+<!-- mason kludge -->
 <%
-#<!-- $Id: cust_pay.cgi,v 1.9 2001-12-26 05:19:01 ivan Exp $ -->
-
-use strict;
-use vars qw( $cgi $link $linknum $p1 $_date $payby $payinfo $paid $quickpay );
-use Date::Format;
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::Conf;
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(header popurl ntable small_custview);
 
 my $conf = new FS::Conf;
 
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
+my($link, $linknum, $paid, $payby, $payinfo, $quickpay); 
 if ( $cgi->param('error') ) {
   $link = $cgi->param('link');
   $linknum = $cgi->param('linknum');
@@ -41,9 +30,11 @@ if ( $cgi->param('error') ) {
 } else {
   die "illegal query ". $cgi->keywords;
 }
-$_date = time;
+my $_date = time;
 
-$p1 = popurl(1);
+my $paybatch = "webui-$_date-$$-". rand() * 2**32;
+
+my $p1 = popurl(1);
 print header("Post payment", '');
 
 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
@@ -96,7 +87,7 @@ if ( $link eq 'invnum' ) {
     }
 
   }
-  print '</TD></TR></TABLE>';
+  print '</TD></TR></TABLE><BR><BR>';
 
   $custnum = $cust_bill->custnum;
 
@@ -122,11 +113,12 @@ print qq!<TR><TD ALIGN="right">Check #</TD><TD BGCOLOR="#ffffff"><INPUT TYPE="te
 
 print qq!<TR><TD ALIGN="right">Auto-apply<BR>to invoices</TD><TD><SELECT NAME="apply"><OPTION VALUE="yes" SELECTED>yes<OPTION>no</SELECT></TD>!;
 
+print "</TABLE>";
+
 #paybatch
-print qq!<INPUT TYPE="hidden" NAME="paybatch" VALUE="">!;
+print qq!<INPUT TYPE="hidden" NAME="paybatch" VALUE="$paybatch">!;
 
 print <<END;
-</TABLE>
 <BR>
 <INPUT TYPE="submit" VALUE="Post payment">
     </FORM>