3 # $Id: cust_credit.cgi,v 1.2 1998-12-17 08:40:18 ivan Exp $
6 # http://server.name/path/cust_credit.cgi
8 # Note: Should be run setuid root as user nobody.
10 # ivan@voicenet.com 96-dec-05 -> 96-dec-08
12 # post a refund if $new_paybatch
13 # ivan@voicenet.com 96-dec-08
15 # refunds are no longer applied against a specific payment (paybatch)
16 # paybatch field removed
17 # ivan@voicenet.com 97-apr-22
19 # rewrite ivan@sisd.com 98-mar-16
21 # Changes to allow page to work at a relative position in server
22 # bmccane@maxbaud.net 98-apr-3
24 # $Log: cust_credit.cgi,v $
25 # Revision 1.2 1998-12-17 08:40:18 ivan
26 # s/CGI::Request/CGI.pm/; etc
31 use CGI::Carp qw(fatalsToBrowser);
32 use FS::UID qw(cgisuidsetup getotaker);
33 use FS::CGI qw(popurl eidiot);
36 my($cgi)=new CGI; # create form object
39 $cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!";
42 $cgi->param('otaker',getotaker);
44 my($new) = create FS::cust_credit ( {
46 $_, scalar($cgi->param($_));
47 } qw(custnum _date amount otaker reason)
52 &eidiot($error) if $error;
54 #no errors, no refund, so view our credit.
55 print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum#history");