X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fquick-charge.cgi;h=39628cae7dd8f4a070877b5a676bc2be4b696989;hb=a078c5a126b4a4cac8aa259dd04e51f302787a18;hp=23eead4519a9641f6f6d02431101d0106c22bc0d;hpb=817c1ce0e1cbcfd1f684222c66f46dd13b2d6dd7;p=freeside.git diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi index 23eead451..39628cae7 100644 --- a/httemplate/edit/process/quick-charge.cgi +++ b/httemplate/edit/process/quick-charge.cgi @@ -1,13 +1,4 @@ -% if ( $error ) { -% $cgi->param('error', $error ); -<% $cgi->redirect($p.'quick-charge.html?'. $cgi->query_string) %> -% } else { -<% header(emt($message)) %> - - -% } +<% $cgi->redirect(@redirect) %> <%init> my $curuser = $FS::CurrentUser::CurrentUser; @@ -122,7 +113,7 @@ if ( $param->{'pkgnum'} =~ /^(\d+)$/ ) { #modifying an existing one-time charge if ( $param->{'taxclass'} eq '(select)' ) { $error .= "Must select a tax class. " - unless ($conf->config('tax_data_vendor')) + unless ($conf->config('tax_data_vendor') && ( $override || $param->{taxproductnum} ) ); $cgi->param('taxclass', ''); @@ -157,4 +148,27 @@ if ( $param->{'pkgnum'} =~ /^(\d+)$/ ) { #modifying an existing one-time charge } +my @redirect = (); +if ( $error ) { + $cgi->param('error', $error ); + @redirect = ( $p.'quick-charge.html?'. $cgi->query_string ); +} elsif ( $quotation ) { + @redirect = ( + -uri => $fsurl.'view/quotation.html?' . $quotation->quotationnum, + -cookie => CGI::Cookie->new( -name => 'freeside_status', + -value => mt('One-time charge added to quotation'), + -expires => '+5m', + ), + ); +} else { + @redirect = ( + -uri => $fsurl.'view/cust_main.cgi?custnum='. $cust_main->custnum. + ';show=last', + -cookie => CGI::Cookie->new( -name => 'freeside_status', + -value => mt('One-time charge ordered'), + -expires => '+5m', + ), + ); +} +