3 # cust_credit.cgi: Add a credit (output form)
5 # Usage: cust_credit.cgi custnum [ -paybatch ]
6 # http://server.name/path/cust_credit?custnum [ -paybatch ]
8 # Note: Should be run setuid root as user nobody.
10 # some hooks in here for modifications as well as additions, but needs (lots) more work.
11 # also see process/cust_credit.cgi, the script that processes the form.
13 # ivan@voicenet.com 96-dec-05
15 # paybatch field, differentiates between credits & credits+refunds by commandline
16 # ivan@voicenet.com 96-dec-08
18 # added (but commented out) sprintf("%.2f" in amount field. Hmm.
19 # ivan@voicenet.com 97-jan-3
21 # paybatch stuff thrown out - has checkbox now instead.
22 # (well, sort of. still passed around for backward compatability and possible editing hook)
23 # ivan@voicenet.com 97-apr-21
25 # rewrite ivan@sisd.com 98-mar-16
29 use CGI::Base qw(:DEFAULT :CGI); #CGI module
30 use FS::UID qw(cgisuidsetup getotaker);
32 my($cgi) = new CGI::Base;
37 $QUERY_STRING =~ /^(\d+)$/;
41 my($otaker)=getotaker;
43 SendHeaders(); # one guess.
47 <TITLE>Post Credit</TITLE>
53 <FORM ACTION="process/cust_credit.cgi" METHOD=POST>
59 print qq!Credit #<B>!, $crednum ? $crednum : " <I>(NEW)</I>", qq!</B><INPUT TYPE="hidden" NAME="crednum" VALUE="$crednum">!;
62 print qq!\nCustomer #<B>$custnum</B><INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!;
65 print qq!<INPUT TYPE="hidden" NAME="paybatch" VALUE="">!;
69 print qq!\nDate: <B>!, time2str("%D",$date), qq!</B><INPUT TYPE="hidden" NAME="_date" VALUE="$date">!;
73 print qq!\nAmount \$<INPUT TYPE="text" NAME="amount" VALUE="$amount" SIZE=8 MAXLENGTH=8>!;
76 #print qq! <INPUT TYPE="checkbox" NAME="refund" VALUE="yes">Also post refund!;
79 print qq!<INPUT TYPE="hidden" NAME="otaker" VALUE="$otaker">!;
83 print qq!\nReason <INPUT TYPE="text" NAME="reason" VALUE="$reason" SIZE=72>!;
88 <CENTER><INPUT TYPE="submit" VALUE="Post"></CENTER>