From ee17093f5b41c1544d00a2670d26794aee33077a Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 16 Sep 2014 23:41:40 -0700 Subject: customer quotations are work orders? RT#25561 --- httemplate/view/cust_main.cgi | 52 +++++++++++++++++++++++++++++++ httemplate/view/cust_main/quotations.html | 10 ++++++ httemplate/view/prospect_main.html | 47 ++-------------------------- 3 files changed, 64 insertions(+), 45 deletions(-) create mode 100644 httemplate/view/cust_main/quotations.html (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 782556b73..4880ac3dc 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -40,6 +40,11 @@ function areyousure(href, message) { } + +% ### +% # Basics +% ### + % if ( $view eq 'basics' || $view eq 'jumbo' ) { % if ( $curuser->access_right('Edit customer') ) { @@ -183,6 +188,11 @@ function areyousure(href, message) { % } + +% ### +% # Notes +% ### + % if ( $view eq 'notes' || $view eq 'jumbo' ) { <& cust_main/notes.html, 'cust_main' => $cust_main &> @@ -195,6 +205,11 @@ function areyousure(href, message) {
+ +% ### +% # Tickets +% ### + % if ( $view eq 'tickets' || $view eq 'jumbo' ) { % if ( $conf->config('ticket_system') ) { @@ -204,6 +219,10 @@ function areyousure(href, message) { % } +% ### +% # Appointments +% ### + % if ( $view eq 'appointments' || $view eq 'jumbo' ) { % if ( $conf->config('ticket_system') @@ -214,6 +233,28 @@ function areyousure(href, message) { % } + +% ### +% # Quotations +% ### + +% if ( $view eq 'jumbo' && $curuser->access_right('Generate quotation') ) { + <% mt('Quotations') |h %>
+% } + +% if ( $view eq 'quotations' || $view eq 'jumbo' ) { + +% if ( $curuser->access_right('Generate quotation') ) { + <& cust_main/quotations.html, $cust_main &> +% } + +% } + + +% ### +% # Packages +% ### + % if ( $view eq 'jumbo' ) { #XXX enable me && $curuser->access_right('View customer packages') { <% mt('Packages') |h %>
@@ -227,6 +268,11 @@ function areyousure(href, message) { % } + +% ### +% # Payment History +% ### + % if ( $view eq 'jumbo' ) {

<% mt('Payment History') |h %> @@ -241,6 +287,11 @@ function areyousure(href, message) { % } + +% ### +% # Change History +% ### + % if ( $view eq 'change_history' ) { # || $view eq 'jumbo' <& cust_main/change_history.html, $cust_main &> % } @@ -299,6 +350,7 @@ if ( $conf->config('ticket_system') ) { $views{emt('Appointments')} = 'appointments' if $curuser->access_right('View appointments'); } +$views{emt('Quotations')} = 'quotations'; $views{emt('Packages')} = 'packages'; $views{emt('Payment History')} = 'payment_history' unless $conf->config('payby-default' eq 'HIDE'); diff --git a/httemplate/view/cust_main/quotations.html b/httemplate/view/cust_main/quotations.html new file mode 100644 index 000000000..4e3a207fe --- /dev/null +++ b/httemplate/view/cust_main/quotations.html @@ -0,0 +1,10 @@ +<& /elements/quotations.html, + cust_main => $cust_main, + convert_label => 'Place order', +&> + +<%init> + +my $cust_main = shift; + + diff --git a/httemplate/view/prospect_main.html b/httemplate/view/prospect_main.html index 689b422a4..66abffcdd 100644 --- a/httemplate/view/prospect_main.html +++ b/httemplate/view/prospect_main.html @@ -1,7 +1,4 @@ -<% include('/elements/header.html', - 'Prospect View: '. $prospect_main->company - ) -%> +<& /elements/header.html, 'Prospect View: '. $prospect_main->company &> % if ( $curuser->access_right('Edit prospect') ) { Edit this prospect @@ -76,43 +73,7 @@
-% if ( $curuser->access_right('Generate quotation') ) { - <% mt( 'Quotations' ) |h %> - New quotation -% my @quotations = $prospect_main->quotation; -% if ( @quotations ) { - <& /elements/table-grid.html &> -% my $bgcolor1 = '#eeeeee'; -% my $bgcolor2 = '#ffffff'; -% my $bgcolor = ''; - - # - <% mt('Date') |h %> - <% mt('Setup') |h %> - <% mt('Recurring') |h %> - - -% foreach my $quotation (@quotations) { -% if ( $bgcolor eq $bgcolor1 ) { -% $bgcolor = $bgcolor2; -% } else { -% $bgcolor = $bgcolor1; -% } -% my $a = qq(quotationnum. '">'; - - <% $a %><% $quotation->quotationnum %> - <% $a %><% time2str($date_format, $quotation->_date) |h %> - <% $a %><% $quotation->total_setup |h %> - <% $a %><% $quotation->total_recur |h %> - Convert to customer - -% } - -% } -

-% } - +<& /elements/quotations.html, prospect_main=>$prospect_main &> % if ( $curuser->access_right('Qualify service') ) { <% include( '/elements/popup_link-prospect_main.html', @@ -147,10 +108,6 @@ my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" unless $curuser->access_right('View prospect'); -my $conf = new FS::Conf; - -my $date_format = $conf->config('date_format') || '%m/%d/%Y'; - my $prospectnum; if ( $cgi->param('prospectnum') =~ /^(\d+)$/ ) { $prospectnum = $1; -- cgit v1.2.1