diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2016-03-02 15:11:04 -0600 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2016-03-08 13:18:39 -0600 |
commit | 7cccefa1dca60909499b11dff96124a793c4c92d (patch) | |
tree | b3cecba9513fe5adf410f9bca6a968348ff8089f /httemplate | |
parent | 77f5d80f4178f976efbc0be027656e396cecc1cb (diff) |
RT#38733: Sales forecasting using quotes
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/edit/process/quotation.html | 4 | ||||
-rw-r--r-- | httemplate/edit/quotation.html | 10 | ||||
-rwxr-xr-x | httemplate/search/quotation.html | 12 | ||||
-rwxr-xr-x | httemplate/view/quotation.html | 31 |
4 files changed, 52 insertions, 5 deletions
diff --git a/httemplate/edit/process/quotation.html b/httemplate/edit/process/quotation.html index a69566581..1cda30f60 100644 --- a/httemplate/edit/process/quotation.html +++ b/httemplate/edit/process/quotation.html @@ -8,4 +8,8 @@ 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> diff --git a/httemplate/edit/quotation.html b/httemplate/edit/quotation.html index cc95d8781..437284094 100644 --- a/httemplate/edit/quotation.html +++ b/httemplate/edit/quotation.html @@ -7,13 +7,17 @@ '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) = @_; @@ -28,4 +32,6 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Generate quotation'); +my $can_disable = $FS::CurrentUser::CurrentUser->access_right('Disable quotation'); + </%init> diff --git a/httemplate/search/quotation.html b/httemplate/search/quotation.html index 55c60f0c1..2eba71cb0 100755 --- a/httemplate/search/quotation.html +++ b/httemplate/search/quotation.html @@ -15,6 +15,8 @@ emt('Date'), emt('Prospect'), emt('Customer'), + emt('Confidence'), + emt('Close date'), ], 'fields' => [ 'quotationnum', @@ -27,6 +29,10 @@ 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' => [ @@ -36,8 +42,10 @@ '_date', '', '', + 'confidence', + 'close_date', ], - 'align' => 'rrrrll', #.FS::UI::Web::cust_aligns(), + 'align' => 'rrrrllrr', #.FS::UI::Web::cust_aligns(), 'links' => [ $link, $link, @@ -45,6 +53,8 @@ $link, $prospect_link, $cust_link, + $link, + $link, #( map { $_ ne 'Cust. Status' ? $cust_link : '' } # FS::UI::Web::cust_header() #), diff --git a/httemplate/view/quotation.html b/httemplate/view/quotation.html index 18625095e..484bedd04 100755 --- a/httemplate/view/quotation.html +++ b/httemplate/view/quotation.html @@ -11,20 +11,31 @@ function areyousure(href, message) { % 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') ) @@ -76,6 +87,22 @@ function areyousure(href, message) { <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 { |