#!/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 < Post Credit

Post Credit


END

#crednum
my($crednum)="";
print qq!Credit #!, $crednum ? $crednum : " (NEW)", qq!!;

#custnum
print qq!\nCustomer #$custnum!;

#paybatch
print qq!!;

#date
my($date)=time;
print qq!\nDate: !, time2str("%D",$date), qq!!;

#amount
my($amount)='';
print qq!\nAmount \$!;

#refund?
#print qq! Also post refund!;

#otaker (hidden)
print qq!!;

#reason
my($reason)='';
print qq!\nReason !;

print <

END print < END