-tr-select-cust_location.html and elements/location.html: optionally support alternat...
[freeside.git] / httemplate / view / qual.cgi
1 <% include("/elements/header.html","View Qualification") %>
2
3 % if ( $cust_or_prospect->custnum ) {
4
5   <% include( '/elements/small_custview.html', $cust_or_prospect->custnum, '', 1,
6      "${p}view/cust_main.cgi") %>
7   <BR>
8
9 % }
10
11 <B>Qualification #<% $qual->qualnum %></B>
12 <% ntable("#cccccc", 2) %>
13 <% include('elements/tr.html', label => 'Status', value => $qual->status_long ) %>
14 <% include('elements/tr.html', label => 'Service Telephone Number', value => $qual->phonenum ) %>
15 <% include('elements/tr.html', label => 'Address', value => $location_line ) %>
16 % if ( $location_kind ) {
17 <% include('elements/tr.html', label => 'Location Kind', value => $location_kind ) %>
18 % } if ( $export ) { 
19 <% include('elements/tr.html', label => 'Qualified using', value => $export->exportname ) %>
20 <% include('elements/tr.html', label => 'Vendor Qualification #', value => $qual->vendor_qual_id ) %>
21 % } 
22 </TABLE>
23 <BR><BR>
24
25 % if ( $export ) {
26 <% $export->qual_html($qual) %>
27 % }
28
29 <%init>
30
31 # XXX: add access right for quals?
32
33 my $qualnum;
34 if ( $cgi->param('qualnum') ) {
35   $cgi->param('qualnum') =~ /^(\d+)$/ or die "unparsable qualnum";
36   $qualnum = $1;
37 } else {
38   my($query) = $cgi->keywords;
39   $query =~ /^(\d+)$/ or die "no qualnum";
40   $qualnum = $1;
41 }
42
43 my $qual = qsearchs('qual', { qualnum => $qualnum }) or die "invalid qualnum";
44 my $location_line = '';
45 my %location_hash = $qual->location;
46 my $cust_location;
47 if ( %location_hash ) {
48     $cust_location = new FS::cust_location(\%location_hash);
49     $location_line = $cust_location->location_label;
50 }
51 # XXX: geocode_Mixin location_label doesn't currently have the new cust_location fields - add them
52
53 my $location_kind;
54 $location_kind = "Residential" if $cust_location->location_kind eq 'R';
55 $location_kind = "Business" if $cust_location->location_kind eq 'B';
56
57 my $cust_or_prospect = $qual->cust_or_prospect;
58
59 my $export;
60 if ( $qual->exportnum ) {
61     $export = qsearchs('part_export', { exportnum => $qual->exportnum } )
62                 or die 'invalid exportnum';
63 }
64
65 </%init>