'_date', @date_type, '', '',
'disabled', 'char', 'NULL', 1, '', '',
'usernum', 'int', 'NULL', '', '', '',
+ 'close_date', @date_type, '', '',
+ 'confidence', 'int', 'NULL', '', '', '',
#'total', @money_type, '', '',
#'quotation_term', 'varchar', 'NULL', $char_d, '', '',
],
usernum
+=item close_date
+
+projected date when the quotation will be closed
+
+=item confidence
+
+projected confidence (expressed as integer) that quotation will close
=back
|| $self->ut_numbern('_date')
|| $self->ut_enum('disabled', [ '', 'Y' ])
|| $self->ut_numbern('usernum')
+ || $self->ut_numbern('close_date')
+ || $self->ut_numbern('confidence')
;
return $error if $error;
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Generate quotation');
+my $close_date = $cgi->param('close_date');
+$close_date = parse_datetime($close_date);
+$cgi->param('close_date',$close_date);
+
</%init>
'prospectnum' => 'Prospect',
'custnum' => 'Customer',
'_date' => 'Date',
- 'disabled' => 'Disabled',
+ 'close_date' => 'Close Date',
+ 'confidence' => 'Confidence',
+ ($can_disable ? ('disabled' => 'Disabled') : ()),
},
'fields' => [
{ field=>'prospectnum', type=>'fixed-prospect_main' },
{ field=>'custnum', type=>'fixed-cust_main' },
{ field=>'_date', type=>'fixed-date' },
- { field=>'disabled', type=>'checkbox', value=>'Y'},
+ { field=>'close_date', type=>'input-date-field' },
+ { field=>'confidence', type=>'text', size=>6 },
+ ($can_disable ? { field=>'disabled', type=>'checkbox', value=>'Y'} : ()),
],
#XXX some way to disable the "view all"
'new_callback' => sub { my( $cgi, $quotation) = @_;
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Generate quotation');
+my $can_disable = $FS::CurrentUser::CurrentUser->access_right('Disable quotation');
+
</%init>
emt('Date'),
emt('Prospect'),
emt('Customer'),
+ emt('Confidence'),
+ emt('Close date'),
],
'fields' => [
'quotationnum',
sub { my $cust_main = shift->cust_main;
$cust_main ? $cust_main->name : '';
},
+ 'confidence',
+ sub { my $quot = shift;
+ $quot->close_date ? time2str('%b %d %Y', $quot->close_date) : '';
+ },
#\&FS::UI::Web::cust_fields,
],
'sort_fields' => [
'_date',
'',
'',
+ 'confidence',
+ 'close_date',
],
- 'align' => 'rrrrll', #.FS::UI::Web::cust_aligns(),
+ 'align' => 'rrrrllrr', #.FS::UI::Web::cust_aligns(),
'links' => [
$link,
$link,
$link,
$prospect_link,
$cust_link,
+ $link,
+ $link,
#( map { $_ ne 'Cust. Status' ? $cust_link : '' }
# FS::UI::Web::cust_header()
#),
% unless ( $quotation->disabled eq 'Y' ) {
+% my $inrow = 0;
% if ( $curuser->access_right('Order customer package') ) {
<& /elements/order_pkg_link.html,
'label' => emt('Add package'),
'actionlabel' => emt('Add package'),
map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
&>
+% $inrow++;
% }
% if ( $curuser->access_right('One-time charge') ) {
- | <& /elements/one_time_charge_link.html,
+ <% $inrow ? ' | ' : '' %>
+ <& /elements/one_time_charge_link.html,
map { $_ => $quotation->$_ } qw( quotationnum custnum prospectnum )
&>
+% $inrow++;
% }
- <BR><BR>
+
+% if ( $can_generate_quotation ) {
+ <% $inrow ? ' | ' : '' %>
+ <A HREF="<%$p%>edit/quotation.html?quotationnum=<% $quotation->quotationnum %>">Edit quotation fields</A>
+% $inrow++;
+% }
+
+ <% $inrow ? '<BR><BR>' : '' %>
% if ( 1 ) { #if ( $curuser->access_right('Send quotations') )
<DIV CLASS="error"><% emt('Error calculating quotation: [_1]', $error) %></DIV>
% }
+% my $close_date = $quotation->close_date;
+% my $confidence = $quotation->confidence;
+% if ($close_date or length($confidence)) {
+<TABLE>
+% if ($close_date) {
+<TR>
+ <TH STYLE="text-align: right;">Close Date:</TH>
+ <TD><% time2str($conf->config('date_format') || '%m/%d/%Y',$close_date) %></TD>
+</TR>
+% }
+% if (length($confidence)) {
+<TR><TH STYLE="text-align: right;">Confidence:</TH><TD><% $confidence %></TD></TR>
+% }
+</TABLE>
+% }
+
% if ( $conf->exists('quotation_html') ) {
<% join('', $quotation->print_html( preref_callback=>$preref_callback )) %>
% } else {