<% include("/elements/header.html","View Qualification") %>
-% if ( $cust_or_prospect->custnum ) {
+% if ( $cust_or_prospect->get('custnum') ) {
<% include( '/elements/small_custview.html', $cust_or_prospect->custnum, '', 1,
"${p}view/cust_main.cgi") %>
- <BR>
+% } elsif ( $cust_or_prospect->get('prospectnum') ) {
+% my $prospectnum = $cust_or_prospect->get('prospectnum');
+% my $link = "${p}view/prospect_main.html?$prospectnum";
+ <A HREF="<%$link%>">Prospect #<%$prospectnum%></A>
% }
+<BR><BR>
+
<B>Qualification #<% $qual->qualnum %></B>
<% ntable("#cccccc", 2) %>
<% include('elements/tr.html', label => 'Status', value => $qual->status_long ) %>
<BR><BR>
% if ( $export ) {
-<% $export->qual_html($qual) %>
+% my $qual_result = $export->qual_result($qual);
+% if ($qual_result->{'header'}) {
+ <B><% $qual_result->{'header'} %></B>
+% }
+% if ($qual_result->{'pkglist'}) { # one of the possible formats
+% my $svcpart = '';
+% my $pkglist = $qual_result->{'pkglist'};
+% my $cust_or_prospect = $qual->cust_or_prospect;
+% my $locationnum = '';
+% my %location = $qual->location;
+% if (%location && $location{'locationnum'}) {
+% $locationnum = $location{'locationnum'};
+% }
+ <UL>
+% foreach my $pkgpart ( keys %$pkglist ) {
+% my %opt = ( 'label' => $pkglist->{$pkgpart},
+% 'pkgpart' => $pkgpart,
+% 'locationnum' => $locationnum, );
+% if ( $export->exporttype eq 'ikano' ) {
+% my $pkg_svc = qsearchs('pkg_svc', { 'pkgpart' => $pkgpart,
+% 'primary_svc' => 'Y',
+% } );
+% $opt{'svcpart'} = $pkg_svc->svcpart if $pkg_svc;
+% }
+ <LI>
+% if($cust_or_prospect && $cust_or_prospect->custnum) {
+ <% include('/view/cust_main/order_pkg_link.html', $qual->cust_or_prospect, %opt) %>
+% }
+% else {
+ <% $opt{label} %>
+% }
+ </LI>
+% }
+ </UL>
+% }
% }
<%init>
-# XXX: add access right for quals?
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Qualify service');
my $qualnum;
if ( $cgi->param('qualnum') ) {
$cust_location = new FS::cust_location(\%location_hash);
$location_line = $cust_location->location_label;
}
-# XXX: geocode_Mixin location_label doesn't currently have the new cust_location fields - add them
my $location_kind;
-$location_kind = "Residential" if $cust_location->location_kind eq 'R';
-$location_kind = "Business" if $cust_location->location_kind eq 'B';
+$location_kind = "Residential" if $cust_location->get('location_kind') eq 'R';
+$location_kind = "Business" if $cust_location->get('location_kind') eq 'B';
my $cust_or_prospect = $qual->cust_or_prospect;
-
-my $export;
-if ( $qual->exportnum ) {
- $export = qsearchs('part_export', { exportnum => $qual->exportnum } )
- or die 'invalid exportnum';
-}
+my $export = $qual->part_export;
</%init>