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