RT# 82949 - changes section name from fees to pricing, better opiton
[freeside.git] / httemplate / edit / process / quotation_convert.html
1 <% $cgi->redirect(popurl(3). 'view/cust_main.cgi?'. $cust_main->custnum ) %>
2 <%init>
3
4 #my $curuser = $FS::CurrentUser::CurrentUser;
5 #die "access denied" unless $curuser->access_right('Edit customer');
6
7 #my $conf = new FS::Conf;
8
9 my $quotation = qsearchs( 'quotation' => {
10   quotationnum => scalar( $cgi->param('quotationnum') ),
11 } ) or die 'unknown quotationnum';
12
13 my $params = {};
14 $$params{'onhold'} = $cgi->param('onhold') ? 1 : 0;
15
16 my $cust_main = $quotation->cust_main;
17 if ( $cust_main ) {
18   my $error = $quotation->order(undef,$params);
19   errorpage($error) if $error;
20
21   #i should be part of the order transaction
22   $quotation->disabled('Y');
23   $quotation->replace;
24
25 } else {
26   $cust_main = $quotation->convert_cust_main( $params );
27   errorpage($cust_main) unless ref($cust_main);# eq 'FS::cust_main';
28 }
29
30 </%init>
31