stray closing /TABLE in the no-ticket case
[freeside.git] / httemplate / edit / quotation.html
1 <% include( 'elements/edit.html',
2                  'name'    => 'Quotation',
3                  'table'   => 'quotation',
4                  'menubar' => [],
5                  'html_table_class' => 'fsinnerbox', #default?
6                  'labels'  => { 
7                                 'quotationnum' => 'Quotation number',
8                                 'prospectnum'  => 'Prospect',
9                                 'custnum'      => 'Customer',
10                                 '_date'        => 'Date',
11                                 'close_date'   => 'Close Date',
12                                 'confidence'   => 'Confidence',
13                                 ($can_disable ? ('disabled'     => 'Disabled') : ()),
14                               },
15                  'fields'  => [
16                    { field=>'prospectnum', type=>'fixed-prospect_main' },
17                    { field=>'custnum',     type=>'fixed-cust_main' },
18                    { field=>'_date',       type=>'fixed-date' },
19                    { field=>'close_date',  type=>'input-date-field' },
20                    { field=>'confidence',  type=>'text', size=>3, postfix=>'%' },
21                    ($can_disable ? { field=>'disabled',    type=>'checkbox', value=>'Y'} : ()),
22                               ],
23                  #XXX some way to disable the "view all"
24                  'new_callback' => sub { my( $cgi, $quotation) = @_;
25                                          $quotation->$_( $cgi->param($_) )
26                                            foreach qw( prospectnum custnum );
27                                          $quotation->_date(time);
28                                        },
29            )
30 %>
31 <%init>
32
33 die "access denied"
34   unless $FS::CurrentUser::CurrentUser->access_right('Generate quotation');
35
36 my $can_disable = $FS::CurrentUser::CurrentUser->access_right('Disable quotation');
37
38 </%init>