1 <& /elements/header.html, 'Prospect View: '. $prospect_main->company &>
3 % if ( $curuser->access_right('Edit prospect') ) {
4 <A HREF="<% $p %>edit/prospect_main.html?<% $prospectnum %>">Edit this prospect</A>
7 <% ntable("#cccccc",2) %>
10 <TD ALIGN="right">Prospect #</TD>
11 <TD BGCOLOR="#FFFFFF"><B><% $prospectnum %></B>
12 % if ( $prospect_main->disabled ) {
18 %unless ( scalar(@agentnums) == 1
19 % && !$curuser->access_right('View customers of all agents') ) {
20 % my $agent = qsearchs('agent',{ 'agentnum' => $prospect_main->agentnum } );
22 <TD ALIGN="right">Agent</TD>
23 <TD BGCOLOR="#ffffff"><% $agent->agentnum %>: <% $agent->agent |h %></TD>
27 %unless ( ! $prospect_main->refnum ) { # || scalar(@part_referral) == 1 ) {
28 % my $part_referral = qsearchs('part_referral',{ 'refnum' => $prospect_main->refnum } );
30 <TD ALIGN="right">Advertising source</TD>
31 <TD BGCOLOR="#ffffff"><% $part_referral->referral |h %></TD>
35 % if ( $prospect_main->company ) {
37 <TD ALIGN="right">Company</TD>
38 <TD BGCOLOR="#FFFFFF"><B><% $prospect_main->company |h %></B></TD>
42 % foreach my $prospect_contact ( $prospect_main->prospect_contact ) {
43 % my $contact = $prospect_contact->contact;
45 <TD ALIGN="right"><% $prospect_contact->contact_classname %> Contact</TD>
46 <TD BGCOLOR="#FFFFFF"><% $contact->line %></TD>
51 % qsearch('cust_location', { 'prospectnum' => $prospectnum } );
52 % #but only one, for now
53 % foreach my $cust_location (@cust_location) {
55 <TD ALIGN="right">Address</TD>
56 <TD BGCOLOR="#FFFFFF">
57 <% $cust_location->location_label(
58 'join_string' => '<BR>',
59 'double_space' => ' ',
60 'escape_function' => \&encode_entities,
65 % if ( $cust_location->latitude && $cust_location->longitude ) {
66 <& /elements/tr-coords.html, $cust_location->latitude,
67 $cust_location->longitude,
72 % if ( my $tax_status = $prospect_main->tax_status ) {
74 <TD ALIGN="right">Tax status</TD>
75 <TD BGCOLOR="#FFFFFF">
76 <B><% $tax_status->taxstatus %>:</B> <% $tax_status->description %>
85 <& /elements/quotations.html, prospect_main=>$prospect_main &>
87 % if ( $curuser->access_right('Qualify service') ) {
88 <% include( '/elements/popup_link-prospect_main.html',
89 'action' => $p. 'misc/qual.html',
90 'label' => 'New Qualification',
91 'actionlabel' => 'New Qualification',
93 'prospect_main' => $prospect_main,
94 'closetext' => 'Close',
99 | <A HREF="<%$p%>search/qual.cgi?prospectnum=<% $prospect_main->prospectnum %>">View Qualifications</A>
104 <% ntable("#cccccc") %>
107 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Tickets</FONT></TH>
115 my $curuser = $FS::CurrentUser::CurrentUser;
118 unless $curuser->access_right('View prospect');
121 if ( $cgi->param('prospectnum') =~ /^(\d+)$/ ) {
124 die "No prospect specified (bad URL)!" unless $cgi->keywords;
125 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
130 my $prospect_main = qsearchs( {
131 'table' => 'prospect_main',
132 'hashref' => { 'prospectnum' => $prospectnum },
133 'extra_sql' => ' AND '. $curuser->agentnums_sql,
135 die "Prospect not found!" unless $prospect_main;
137 my @agentnums = $curuser->agentnums;