3 %$cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!";
6 %my $new = new FS::cust_credit ( {
8 % $_, scalar($cgi->param($_));
9 % } fields('cust_credit')
12 %my $error = $new->insert;
15 % $cgi->param('error', $error);
18 <% $cgi->redirect(popurl(2). "cust_credit.cgi?". $cgi->query_string ) %>
23 % if ( $cgi->param('apply') eq 'yes' ) {
24 % my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum })
25 % or die "unknown custnum $custnum";
26 % $cust_main->apply_credits;
28 % #print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
31 <% header('Credit sucessful') %>
32 <SCRIPT TYPE="text/javascript">
33 window.top.location.reload();