2 #<!-- $Id: cust_credit.cgi,v 1.3 2001-09-03 22:07:39 ivan Exp $ -->
5 use vars qw( $cgi $query $custnum $otaker $p1 $crednum $_date $amount $reason );
8 use CGI::Carp qw(fatalsToBrowser);
9 use FS::UID qw(cgisuidsetup getotaker);
10 use FS::CGI qw(header popurl);
11 use FS::Record qw(fields);
17 if ( $cgi->param('error') ) {
18 #$cust_credit = new FS::cust_credit ( {
19 # map { $_, scalar($cgi->param($_)) } fields('cust_credit')
21 $custnum = $cgi->param('custnum');
22 $amount = $cgi->param('amount');
23 #$refund = $cgi->param('refund');
24 $reason = $cgi->param('reason');
26 ($query) = $cgi->keywords;
39 print $cgi->header( '-expires' => 'now' ), header("Post Credit", '');
40 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
42 if $cgi->param('error');
44 <FORM ACTION="${p1}process/cust_credit.cgi" METHOD=POST>
48 print qq!Credit #<B>!, $crednum ? $crednum : " <I>(NEW)</I>", qq!</B><INPUT TYPE="hidden" NAME="crednum" VALUE="$crednum">!;
50 print qq!<BR>Customer #<B>$custnum</B><INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!;
52 print qq!<INPUT TYPE="hidden" NAME="paybatch" VALUE="">!;
54 print qq!<BR>Date: <B>!, time2str("%D",$_date), qq!</B><INPUT TYPE="hidden" NAME="_date" VALUE="">!;
56 print qq!<BR>Amount \$<INPUT TYPE="text" NAME="amount" VALUE="$amount" SIZE=8 MAXLENGTH=8>!;
57 print qq!<INPUT TYPE="hidden" NAME="credited" VALUE="">!;
59 #print qq! <INPUT TYPE="checkbox" NAME="refund" VALUE="$refund">Also post refund!;
61 print qq!<INPUT TYPE="hidden" NAME="otaker" VALUE="$otaker">!;
63 print qq!<BR>Reason <INPUT TYPE="text" NAME="reason" VALUE="$reason">!;
67 <INPUT TYPE="submit" VALUE="Post">