33320648c391a8ad52f31f4c21844a2ae0a65b5f
[freeside.git] / httemplate / edit / cust_pay.cgi
1 <%
2 #
3 # $Id: cust_pay.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $
4 #
5 # Usage: cust_pay.cgi invnum
6 #        http://server.name/path/cust_pay.cgi?invnum
7 #
8 # some hooks for modifications as well as additions, but needs work.
9 #
10 # ivan@voicenet.com 96-dec-11
11 #
12 # rewrite ivan@sisd.com 98-mar-16
13 #
14 # $Log: cust_pay.cgi,v $
15 # Revision 1.1  2001-07-30 07:36:04  ivan
16 # templates!!!
17 #
18 # Revision 1.6  1999/02/28 00:03:35  ivan
19 # removed misleading comments
20 #
21 # Revision 1.5  1999/01/25 12:09:56  ivan
22 # yet more mod_perl stuff
23 #
24 # Revision 1.4  1999/01/19 05:13:37  ivan
25 # for mod_perl: no more top-level my() variables; use vars instead
26 # also the last s/create/new/;
27 #
28 # Revision 1.3  1999/01/18 09:41:27  ivan
29 # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
30 # (good idea anyway)
31 #
32 # Revision 1.2  1998/12/17 06:17:03  ivan
33 # fix double // in relative URLs, s/CGI::Base/CGI/;
34 #
35
36 use strict;
37 use vars qw( $cgi $invnum $p1 $_date $payby $payinfo $paid );
38 use Date::Format;
39 use CGI;
40 use CGI::Carp qw(fatalsToBrowser);
41 use FS::UID qw(cgisuidsetup);
42 use FS::CGI qw(header popurl);
43
44 $cgi = new CGI;
45 cgisuidsetup($cgi);
46
47 if ( $cgi->param('error') ) {
48   $invnum = $cgi->param('invnum');
49   $paid = $cgi->param('paid');
50   $payby = $cgi->param('payby');
51   $payinfo = $cgi->param('payinfo');
52 } else {
53   my ($query) = $cgi->keywords;
54   $query =~ /^(\d+)$/;
55   $invnum = $1;
56   $paid = '';
57   $payby = "BILL";
58   $payinfo = "";
59 }
60 $_date = time;
61
62 $p1 = popurl(1);
63 print $cgi->header( '-expires' => 'now' ), header("Enter payment", '');
64
65 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
66       "</FONT>"
67   if $cgi->param('error');
68
69 print <<END;
70     <FORM ACTION="${p1}process/cust_pay.cgi" METHOD=POST>
71     <HR><PRE>
72 END
73
74 print qq!Invoice #<B>$invnum</B><INPUT TYPE="hidden" NAME="invnum" VALUE="$invnum">!;
75
76 print qq!<BR>Date: <B>!, time2str("%D",$_date), qq!</B><INPUT TYPE="hidden" NAME="_date" VALUE="$_date">!;
77
78 print qq!<BR>Amount \$<INPUT TYPE="text" NAME="paid" VALUE="$paid" SIZE=8 MAXLENGTH=8>!;
79
80 print qq!<BR>Payby: <B>$payby</B><INPUT TYPE="hidden" NAME="payby" VALUE="$payby">!;
81
82 #payinfo (check # now as payby="BILL" hardcoded.. what to do later?)
83 print qq!<BR>Check #<INPUT TYPE="text" NAME="payinfo" VALUE="$payinfo">!;
84
85 #paybatch
86 print qq!<INPUT TYPE="hidden" NAME="paybatch" VALUE="">!;
87
88 print <<END;
89 </PRE>
90 <BR>
91 <INPUT TYPE="submit" VALUE="Post payment">
92 END
93
94 print <<END;
95
96     </FORM>
97   </BODY>
98 </HTML>
99 END
100
101 %>