1 % if ( $curuser->access_right('Generate quotation') ) {
3 <FONT CLASS="fsinnerbox-title"><% mt( 'Quotations' ) |h %></FONT>
4 <A HREF="<%$p%>edit/quotation.html?<% $new_query %>">New quotation</A>
7 <& /elements/table-grid.html &>
8 % my $bgcolor1 = '#eeeeee';
9 % my $bgcolor2 = '#ffffff';
12 <TH CLASS="grid" BGCOLOR="#cccccc">#</TH>
13 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Setup') |h %></TH>
14 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Recurring') |h %></TH>
15 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Date') |h %></TH>
16 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Description') |h %></TH>
17 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Close date') |h %></TH>
18 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Confidence') |h %></TH>
19 <TH CLASS="grid" BGCOLOR="#cccccc"></TH>
21 % foreach my $quotation (@quotations) {
22 % if ( $bgcolor eq $bgcolor1 ) {
23 % $bgcolor = $bgcolor2;
25 % $bgcolor = $bgcolor1;
27 % my $a = qq(<A HREF="$p/view/quotation.html?quotationnum=). #"
28 % $quotation->quotationnum. '">';
30 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% $quotation->quotationnum %></A></TD>
31 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>" ALIGN=right><% $a %><% $money_char.$quotation->total_setup |h %></A></TD>
32 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>" ALIGN=right><% $a %><% $money_char.$quotation->total_recur |h %></A></TD>
33 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% time2str('%b %d %Y', $quotation->_date) |h %></A></TD>
34 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% $quotation->quotation_description |h %></A></TD>
35 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% $quotation->close_date ? time2str('%b %d %Y', $quotation->close_date) : '' |h %></A></TD>
36 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>" ALIGN=right><% $a %><% length($quotation->confidence) ? $quotation->confidence . '%' : '' |h %></A></TD>
37 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>"><% $opt{convert_label} || 'Convert to customer' %></A></TD>
47 my $curuser = $FS::CurrentUser::CurrentUser;
50 # unless $curuser->access_right('Generate quotation');
52 my $conf = new FS::Conf;
54 my $money_char = $conf->config('money_char') || '$';
56 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
62 if ( $opt{cust_main} ) {
63 $new_query = 'custnum='. $opt{cust_main}->custnum;
64 @quotations = $opt{cust_main}->quotation;
65 } elsif ( $opt{prospect_main} ) {
66 $new_query = 'prospectnum='. $opt{prospect_main}->prospectnum;
67 @quotations = $opt{prospect_main}->quotation;
69 die 'guru meditation #&&: neither cust_main nor prospect_main specified';
72 @quotations = grep ! $_->disabled, @quotations;