1 <% include( 'elements/edit.html',
3 'table' => 'quotation',
6 'quotationnum' => 'Quotation number',
7 'prospectnum' => 'Prospect',
8 'custnum' => 'Customer',
10 'close_date' => 'Close Date',
11 'confidence' => 'Confidence',
12 'quotation_description' => 'Description',
13 ($can_disable ? ('disabled' => 'Disabled') : ()),
16 { field=>'prospectnum', type=>'fixed-prospect_main' },
17 { field=>'custnum', type=>'fixed-cust_main' },
18 { field=>'_date', type=>'fixed-date' },
19 { field=>'quotation_description', type=>'text', size=>50 },
20 { field=>'close_date', type=>'input-date-field' },
21 { field=>'confidence', type=>'text', size=>3, postfix=>'%' },
22 ($can_disable ? { field=>'disabled', type=>'checkbox', value=>'Y'} : ()),
24 #XXX some way to disable the "view all"
25 'new_callback' => sub { my( $cgi, $quotation) = @_;
26 $quotation->$_( $cgi->param($_) )
27 foreach qw( prospectnum custnum );
28 $quotation->_date(time);
30 'field_callback' => sub { my( $cgi, $quotation, $field_hashref ) = @_;
31 $quotation->close_date(($default_close_days * 86400) + time) if !$quotation->close_date && $default_close_days;
38 unless $FS::CurrentUser::CurrentUser->access_right('Generate quotation');
40 my $can_disable = $FS::CurrentUser::CurrentUser->access_right('Disable quotation');
42 my $conf = new FS::Conf;
44 my $default_close_days ||= $conf->config('quotation_disable_after_days');