summaryrefslogtreecommitdiff
path: root/htdocs/edit/cust_credit.cgi
blob: 02b8008f7e23095f823cea5d7446d758406563d1 (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
98
99
#!/usr/bin/perl -Tw
#
# $Id: cust_credit.cgi,v 1.3 1998-12-23 02:26:06 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.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, header("Post Credit", ''), <<END;
    <FORM ACTION="${p1}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