signup is now just a wrapper around self-service
[freeside.git] / httemplate / edit / cust_credit.cgi
1 <!-- mason kludge -->
2 <%
3
4 my $conf = new FS::Conf;
5 my($custnum, $amount, $reason);
6 if ( $cgi->param('error') ) {
7   #$cust_credit = new FS::cust_credit ( {
8   #  map { $_, scalar($cgi->param($_)) } fields('cust_credit')
9   #} );
10   $custnum = $cgi->param('custnum');
11   $amount = $cgi->param('amount');
12   #$refund = $cgi->param('refund');
13   $reason = $cgi->param('reason');
14 } else {
15   my($query) = $cgi->keywords;
16   $query =~ /^(\d+)$/;
17   $custnum = $1;
18   $amount = '';
19   #$refund = 'yes';
20   $reason = '';
21 }
22 my $_date = time;
23
24 my $otaker = getotaker;
25
26 my $p1 = popurl(1);
27
28 print header("Post Credit", '');
29 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
30       "</FONT>"
31   if $cgi->param('error');
32 print <<END, small_custview($custnum, $conf->config('countrydefault'));
33     <FORM ACTION="${p1}process/cust_credit.cgi" METHOD=POST>
34     <INPUT TYPE="hidden" NAME="crednum" VALUE="">
35     <INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">
36     <INPUT TYPE="hidden" NAME="paybatch" VALUE="">
37     <INPUT TYPE="hidden" NAME="_date" VALUE="$_date">
38     <INPUT TYPE="hidden" NAME="credited" VALUE="">
39     <INPUT TYPE="hidden" NAME="otaker" VALUE="$otaker">
40 END
41
42 print '<BR><BR>Credit'. ntable("#cccccc", 2).
43       '<TR><TD ALIGN="right">Date</TD><TD BGCOLOR="#ffffff">'.
44       time2str("%D",$_date).  '</TD></TR>';
45
46 print qq!<TR><TD ALIGN="right">Amount</TD><TD BGCOLOR="#ffffff">\$<INPUT TYPE="text" NAME="amount" VALUE="$amount" SIZE=8 MAXLENGTH=8></TD></TR>!;
47
48 #print qq! <INPUT TYPE="checkbox" NAME="refund" VALUE="$refund">Also post refund!;
49
50 print qq!<TR><TD ALIGN="right">Reason</TD><TD BGCOLOR="#ffffff"><INPUT TYPE="text" NAME="reason" VALUE="$reason"></TD></TR>!;
51
52 print qq!<TR><TD ALIGN="right">Auto-apply<BR>to invoices</TD><TD><SELECT NAME="apply"><OPTION VALUE="yes" SELECTED>yes<OPTION>no</SELECT></TD>!;
53
54 print <<END;
55 </TABLE>
56 <BR>
57 <INPUT TYPE="submit" VALUE="Post credit">
58     </FORM>
59   </BODY>
60 </HTML>
61 END
62
63 %>