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></TD>
17 %unless ( scalar(@agentnums) == 1
18 % && !$curuser->access_right('View customers of all agents') ) {
19 % my $agent = qsearchs('agent',{ 'agentnum' => $prospect_main->agentnum } );
21 <TD ALIGN="right">Agent</TD>
22 <TD BGCOLOR="#ffffff"><% $agent->agentnum %>: <% $agent->agent %></TD>
26 % if ( $prospect_main->company ) {
28 <TD ALIGN="right">Company</TD>
29 <TD BGCOLOR="#FFFFFF"><B><% $prospect_main->company |h %></B></TD>
33 % foreach my $contact ( $prospect_main->contact ) {
35 <TD ALIGN="right"><% $contact->contact_classname %> Contact</TD>
36 <TD BGCOLOR="#FFFFFF"><% $contact->line %></TD>
41 % qsearch('cust_location', { 'prospectnum' => $prospectnum } );
42 % #but only one, for now
43 % foreach my $cust_location (@cust_location) {
45 <TD ALIGN="right">Address</TD>
46 <TD BGCOLOR="#FFFFFF">
47 <% $cust_location->location_label(
48 'join_string' => '<BR>',
49 'double_space' => ' ',
50 'escape_function' => \&encode_entities,
55 % if ( $cust_location->latitude && $cust_location->longitude ) {
56 <& /elements/tr-coords.html, $cust_location->latitude,
57 $cust_location->longitude,
67 % if ( $curuser->access_right('Generate quotation') ) {
68 <FONT CLASS="fsinnerbox-title"><% mt( 'Quotations' ) |h %></FONT>
69 <A HREF="<%$p%>edit/quotation.html?prospectnum=<% $prospectnum %>">New quotation</A>
70 % my @quotations = $prospect_main->quotation;
71 % if ( @quotations ) {
72 <& /elements/table-grid.html &>
73 % my $bgcolor1 = '#eeeeee';
74 % my $bgcolor2 = '#ffffff';
77 <TH CLASS="grid" BGCOLOR="#cccccc">#</TH>
78 <TH CLASS="grid" BGCOLOR="#cccccc"><% mt('Date') |h %></TH>
80 % foreach my $quotation (@quotations) {
81 % if ( $bgcolor eq $bgcolor1 ) {
82 % $bgcolor = $bgcolor2;
84 % $bgcolor = $bgcolor1;
86 % my $a = qq(<A HREF="$p/view/quotation.html?quotationnum=). #"
87 % $quotation->quotationnum. '">';
89 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% $quotation->quotationnum %></A></TD>
90 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $a %><% time2str($date_format, $quotation->_date) |h %></A></TD>
99 % if ( $curuser->access_right('Qualify service') ) {
100 <% include( '/elements/popup_link-prospect_main.html',
101 'action' => $p. 'misc/qual.html',
102 'label' => 'New Qualification',
103 'actionlabel' => 'New Qualification',
104 'color' => '#333399',
105 'prospect_main' => $prospect_main,
106 'closetext' => 'Close',
111 | <A HREF="<%$p%>search/qual.cgi?prospectnum=<% $prospect_main->prospectnum %>">View Qualifications</A>
116 <% ntable("#cccccc") %>
119 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Tickets</FONT></TH>
127 my $curuser = $FS::CurrentUser::CurrentUser;
130 unless $curuser->access_right('View prospect');
132 my $conf = new FS::Conf;
134 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
137 if ( $cgi->param('prospectnum') =~ /^(\d+)$/ ) {
140 die "No prospect specified (bad URL)!" unless $cgi->keywords;
141 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
146 my $prospect_main = qsearchs( {
147 'table' => 'prospect_main',
148 'hashref' => { 'prospectnum' => $prospectnum },
149 'extra_sql' => ' AND '. $curuser->agentnums_sql,
151 die "Prospect not found!" unless $prospect_main;
153 my @agentnums = $curuser->agentnums;