#!/usr/bin/perl -Tw # # $Id: cust_credit.cgi,v 1.4 1999-01-18 09:41:23 ivan Exp $ # # 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 # # $Log: cust_credit.cgi,v $ # Revision 1.4 1999-01-18 09:41:23 ivan # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl # (good idea anyway) # # Revision 1.3 1998/12/23 02:26:06 ivan # *** empty log message *** # # Revision 1.2 1998/12/17 06:16:59 ivan # fix double // in relative URLs, s/CGI::Base/CGI/; # use strict; use Date::Format; use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup getotaker); use FS::CGI qw(header popurl); my $cgi = new CGI; cgisuidsetup($cgi); my($query) = $cgi->keywords; $query =~ /^(\d+)$/; my($custnum)=$1; my($otaker)=getotaker; my $p1 = popurl(1); print $cgi->header( '-expires' => 'now' ), header("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