blob: 75ef21208c9cedfbc977abceb6c1a5db931f0f38 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
#!/usr/bin/perl -Tw
#
# cust_credit.cgi: Add a credit (output form)
#
# Usage: cust_credit.cgi custnum [ -paybatch ]
# http://server.name/path/cust_credit?custnum [ -paybatch ]
#
# Note: Should be run setuid root as user nobody.
#
# some hooks in here for modifications as well as additions, but needs (lots) more work.
# also see process/cust_credit.cgi, the script that processes the form.
#
# ivan@voicenet.com 96-dec-05
#
# paybatch field, differentiates between credits & credits+refunds by commandline
# ivan@voicenet.com 96-dec-08
#
# added (but commented out) sprintf("%.2f" in amount field. Hmm.
# ivan@voicenet.com 97-jan-3
#
# paybatch stuff thrown out - has checkbox now instead.
# (well, sort of. still passed around for backward compatability and possible editing hook)
# ivan@voicenet.com 97-apr-21
#
# rewrite ivan@sisd.com 98-mar-16
use strict;
use Date::Format;
use CGI::Base qw(:DEFAULT :CGI); #CGI module
use FS::UID qw(cgisuidsetup getotaker);
my($cgi) = new CGI::Base;
$cgi->get;
cgisuidsetup($cgi);
#untaint custnum
$QUERY_STRING =~ /^(\d+)$/;
my($custnum)=$1;
#untaint otaker
my($otaker)=getotaker;
SendHeaders(); # one guess.
print <<END;
<HTML>
<HEAD>
<TITLE>Post Credit</TITLE>
</HEAD>
<BODY>
<CENTER>
<H1>Post Credit</H1>
</CENTER>
<FORM ACTION="process/cust_credit.cgi" METHOD=POST>
<HR><PRE>
END
#crednum
my($crednum)="";
print qq!Credit #<B>!, $crednum ? $crednum : " <I>(NEW)</I>", qq!</B><INPUT TYPE="hidden" NAME="crednum" VALUE="$crednum">!;
#custnum
print qq!\nCustomer #<B>$custnum</B><INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!;
#paybatch
print qq!<INPUT TYPE="hidden" NAME="paybatch" VALUE="">!;
#date
my($date)=time;
print qq!\nDate: <B>!, time2str("%D",$date), qq!</B><INPUT TYPE="hidden" NAME="_date" VALUE="$date">!;
#amount
my($amount)='';
print qq!\nAmount \$<INPUT TYPE="text" NAME="amount" VALUE="$amount" SIZE=8 MAXLENGTH=8>!;
#refund?
#print qq! <INPUT TYPE="checkbox" NAME="refund" VALUE="yes">Also post refund!;
#otaker (hidden)
print qq!<INPUT TYPE="hidden" NAME="otaker" VALUE="$otaker">!;
#reason
my($reason)='';
print qq!\nReason <INPUT TYPE="text" NAME="reason" VALUE="$reason" SIZE=72>!;
print <<END;
</PRE>
<BR>
<CENTER><INPUT TYPE="submit" VALUE="Post"></CENTER>
END
print <<END;
</FORM>
</BODY>
</HTML>
END
|