1 <% include('/elements/header.html',
2 'Prospect View: '. $prospect_main->company
6 % if ( $curuser->access_right('Edit prospect') ) {
7 <A HREF="<% $p %>edit/prospect_main.html?<% $prospectnum %>">Edit this prospect</A>
10 <% ntable("#cccccc",2) %>
13 <TD ALIGN="right">Prospect #</TD>
14 <TD BGCOLOR="#FFFFFF"><B><% $prospectnum %></B>
15 % if ( $prospect_main->disabled ) {
21 %unless ( scalar(@agentnums) == 1
22 % && !$curuser->access_right('View customers of all agents') ) {
23 % my $agent = qsearchs('agent',{ 'agentnum' => $prospect_main->agentnum } );
25 <TD ALIGN="right">Agent</TD>
26 <TD BGCOLOR="#ffffff"><% $agent->agentnum %>: <% $agent->agent |h %></TD>
30 %unless ( ! $prospect_main->refnum ) { # || scalar(@part_referral) == 1 ) {
31 % my $part_referral = qsearchs('part_referral',{ 'refnum' => $prospect_main->refnum } );
33 <TD ALIGN="right">Advertising source</TD>
34 <TD BGCOLOR="#ffffff"><% $part_referral->referral |h %></TD>
38 % if ( $prospect_main->company ) {
40 <TD ALIGN="right">Company</TD>
41 <TD BGCOLOR="#FFFFFF"><B><% $prospect_main->company |h %></B></TD>
45 % foreach my $contact ( $prospect_main->contact ) {
47 <TD ALIGN="right"><% $contact->contact_classname %> Contact</TD>
48 <TD BGCOLOR="#FFFFFF"><% $contact->line %></TD>
53 % qsearch('cust_location', { 'prospectnum' => $prospectnum } );
54 % #but only one, for now
55 % foreach my $cust_location (@cust_location) {
57 <TD ALIGN="right">Address</TD>
58 <TD BGCOLOR="#FFFFFF">
59 <% $cust_location->location_label(
60 'join_string' => '<BR>',
61 'double_space' => ' ',
62 'escape_function' => \&encode_entities,
67 % if ( $cust_location->latitude && $cust_location->longitude ) {
68 <& /elements/tr-coords.html, $cust_location->latitude,
69 $cust_location->longitude,
79 % if ( $curuser->access_right('Generate quotation') ) {
80 <FONT CLASS="fsinnerbox-title"><% mt( 'Quotations' ) |h %></FONT>
81 <A HREF="<%$p%>edit/quotation.html?prospectnum=<% $prospectnum %>">New quotation</A>
82 % my @quotations = $prospect_main->quotation;
83 % if ( @quotations ) {
84 <& /elements/table-grid.html &>
85 % my $bgcolor1 = '#eeeeee';
86 % my $bgcolor2 = '#ffffff';
89 <TH CLASS="grid" BGCOLOR="#cccccc">#</TH>
90 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Date') |h %></TH>
91 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Setup') |h %></TH>
92 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Recurring') |h %></TH>
93 <TH CLASS="grid" BGCOLOR="#cccccc"></TH>
95 % foreach my $quotation (@quotations) {
96 % if ( $bgcolor eq $bgcolor1 ) {
97 % $bgcolor = $bgcolor2;
99 % $bgcolor = $bgcolor1;
101 % my $a = qq(<A HREF="$p/view/quotation.html?quotationnum=). #"
102 % $quotation->quotationnum. '">';
104 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% $quotation->quotationnum %></A></TD>
105 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% time2str($date_format, $quotation->_date) |h %></A></TD>
106 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% $quotation->total_setup |h %></A></TD>
107 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% $quotation->total_recur |h %></A></TD>
108 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF="<%$p%>edit/process/quotation_convert.html?quotationnum=<% $quotation->quotationnum %>">Convert to customer</A></TD>
117 % if ( $curuser->access_right('Qualify service') ) {
118 <% include( '/elements/popup_link-prospect_main.html',
119 'action' => $p. 'misc/qual.html',
120 'label' => 'New Qualification',
121 'actionlabel' => 'New Qualification',
122 'color' => '#333399',
123 'prospect_main' => $prospect_main,
124 'closetext' => 'Close',
129 | <A HREF="<%$p%>search/qual.cgi?prospectnum=<% $prospect_main->prospectnum %>">View Qualifications</A>
134 <% ntable("#cccccc") %>
137 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Tickets</FONT></TH>
145 my $curuser = $FS::CurrentUser::CurrentUser;
148 unless $curuser->access_right('View prospect');
150 my $conf = new FS::Conf;
152 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
155 if ( $cgi->param('prospectnum') =~ /^(\d+)$/ ) {
158 die "No prospect specified (bad URL)!" unless $cgi->keywords;
159 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
164 my $prospect_main = qsearchs( {
165 'table' => 'prospect_main',
166 'hashref' => { 'prospectnum' => $prospectnum },
167 'extra_sql' => ' AND '. $curuser->agentnums_sql,
169 die "Prospect not found!" unless $prospect_main;
171 my @agentnums = $curuser->agentnums;