X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fquick-charge.cgi;h=b28d225308fa294542c5769057f9aef8e724d692;hp=aa6010ef9f60968609d7d50ffb01746e513c570c;hb=b71b1576c68bc40ad26592b354feace37a029f0e;hpb=5b884dd940f7dce415ba77dcbc2ab6840f0b5673 diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi index aa6010ef9..b28d22530 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; @@ -74,7 +65,7 @@ if ( $param->{'pkgnum'} =~ /^(\d+)$/ ) { #modifying an existing one-time charge if ( $param->{'taxclass'} eq '(select)' ) { $error .= "Must select a tax class. " - unless ($conf->exists('enable_taxproducts') && + unless ($conf->config('tax_data_vendor') && ( $override || $param->{taxproductnum} ) ); $cgi->param('taxclass', ''); @@ -93,6 +84,7 @@ if ( $param->{'pkgnum'} =~ /^(\d+)$/ ) { #modifying an existing one-time charge 'tax_override' => $override, 'quantity' => $quantity, 'start_date' => $start_date, + 'separate_bill' => scalar($cgi->param('separate_bill')), ); } else { # the usual case: new one-time charge @@ -121,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->exists('enable_taxproducts') && + unless ($conf->config('tax_data_vendor') && ( $override || $param->{taxproductnum} ) ); $cgi->param('taxclass', ''); @@ -131,20 +123,18 @@ if ( $param->{'pkgnum'} =~ /^(\d+)$/ ) { #modifying an existing one-time charge 'amount' => $amount, 'setup_cost' => $setup_cost, 'quantity' => $quantity, - 'bill_now' => scalar($cgi->param('bill_now')), - 'invoice_terms' => scalar($cgi->param('invoice_terms')), 'start_date' => ( scalar($cgi->param('start_date')) ? parse_datetime($cgi->param('start_date')) : '' ), - 'no_auto' => scalar($cgi->param('no_auto')), - 'pkg' => scalar($cgi->param('pkg')), - 'setuptax' => scalar($cgi->param('setuptax')), - 'taxclass' => scalar($cgi->param('taxclass')), - 'taxproductnum' => scalar($cgi->param('taxproductnum')), 'tax_override' => $override, - 'classnum' => scalar($cgi->param('classnum')), 'additional' => \@description, + + map { $_ => scalar($cgi->param($_)), } qw( + bill_now invoice_terms no_auto separate_bill pkg + setuptax taxclass taxproductnum classnum + setup_discountnum setup_discountnum_amount setup_discountnum_percent + ) ); if ( $quotation ) { @@ -155,4 +145,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', + ), + ); +} +