2 % $cgi->param('error', $error );
3 <% $cgi->redirect($p.'cust_tax_adjustment.html?'. $cgi->query_string) %>
5 <% header("Tax adjustment added") %>
6 <SCRIPT TYPE="text/javascript">
7 //window.top.location.reload();
15 unless $FS::CurrentUser::CurrentUser->access_right('Add customer tax adjustment');
18 my $conf = new FS::conf;
19 my $param = $cgi->Vars;
21 $param->{"custnum"} =~ /^(\d+)$/
22 or $error .= "Illegal customer number " . $param->{"custnum"} . " ";
25 $param->{"amount"} =~ /^\s*(\d*(?:\.?\d{1,2}))\s*$/
26 or $error .= "Illegal amount " . $param->{"amount"} . " ";
31 my $cust_tax_adjustment = new FS::cust_tax_adjustment {
32 'custnum' => $custnum,
33 'taxname' => $param->{'taxname'},
35 'comment' => $param->{'comment'},
37 $error = $cust_tax_adjustment->insert;