% 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 = 'prospectnum='. $opt{prospect_main}->prospectnum; @quotations = $opt{prospect_main}->quotation; } else { die 'guru meditation #&&: neither cust_main nor prospect_main specified'; } @quotations = grep ! $_->disabled, @quotations; %init>