summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/quotation_convert.html
blob: dc00a88d30cd968aca052c8b6c3e0f8e4c4466ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<% $cgi->redirect(popurl(3). 'view/cust_main.cgi?'. $cust_main->custnum ) %>
<%init>

#my $curuser = $FS::CurrentUser::CurrentUser;
#die "access denied" unless $curuser->access_right('Edit customer');

#my $conf = new FS::Conf;

my $quotation = qsearchs( 'quotation' => {
  quotationnum => scalar( $cgi->param('quotationnum') ),
} ) or die 'unknown quotationnum';

my $cust_main = $quotation->cust_main;
if ( $cust_main ) {
  my $error = $quotation->order;
  errorpage($error) if $error;

  #i should be part of the order transaction
  $quotation->disabled('Y');
  $quotation->replace;

} else {
  $cust_main = $quotation->convert_cust_main;
  errorpage($cust_main) unless ref($cust_main);# eq 'FS::cust_main';
}

</%init>