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