X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fquotations.html;fp=httemplate%2Felements%2Fquotations.html;h=0cf150022cbb9278461c24deaa9a5ffe23e50f88;hb=ee17093f5b41c1544d00a2670d26794aee33077a;hp=0000000000000000000000000000000000000000;hpb=f58e37b603c27dd0b2d2232e8cb0392088409437;p=freeside.git diff --git a/httemplate/elements/quotations.html b/httemplate/elements/quotations.html new file mode 100644 index 000000000..0cf150022 --- /dev/null +++ b/httemplate/elements/quotations.html @@ -0,0 +1,66 @@ +% if ( $curuser->access_right('Generate quotation') ) { + + <% mt( 'Quotations' ) |h %> + New 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 %> + <% $opt{convert_label} || 'Convert to customer' %> + +% } + +% } +

+ +% } +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; + +#die "access denied" +# unless $curuser->access_right('Generate quotation'); + +my $conf = new FS::Conf; + +my $date_format = $conf->config('date_format') || '%m/%d/%Y'; + +my %opt = @_; + +my $new_query; +my @quotations; +if ( $opt{cust_main} ) { + $new_query = 'custnum='. $opt{cust_main}->custnum; + @quotations = $opt{cust_main}->quotation; +} elsif ( $opt{prospect_main} ) { + $new_query = 'quotationnum='. $opt{prospect_main}->quotationnum; + @quotations = $opt{prospect_main}->quotation; +} else { + die 'guru meditation #&&: neither cust_main nor prospect_main specified'; +} + +@quotations = grep ! $_->disabled, @quotations; + +