1 <% include("/elements/header.html",'External Service View', menubar(
3 ? ( "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
5 : ( "Cancel this (unaudited) external service" =>
6 "${p}misc/cancel-unaudited.cgi?$svcnum" )
10 <A HREF="<%$p%>edit/svc_external.cgi?<%$svcnum%>">Edit this information</A><BR>
11 <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
13 <TR><TD ALIGN="right">Service number</TD>
14 <TD BGCOLOR="#ffffff"><% $svcnum %></TD></TR>
15 <TR><TD ALIGN="right"><% FS::Msgcat::_gettext('svc_external-id') || 'External ID' %></TD>
16 <TD BGCOLOR="#ffffff"><% $conf->config('svc_external-display_type') eq 'artera_turbo' ? sprintf('%010d', $svc_external->id) : $svc_external->id %></TD></TR>
17 <TR><TD ALIGN="right"><% FS::Msgcat::_gettext('svc_external-title') || 'Title' %></TD>
18 <TD BGCOLOR="#ffffff"><% $svc_external->title %></TD></TR>
19 % foreach (sort { $a cmp $b } $svc_external->virtual_fields) {
21 <% $svc_external->pvf($_)->widget('HTML', 'view', $svc_external->getfield($_)) %>
25 </TABLE></TD></TR></TABLE>
28 <& /elements/table-tickets.html, object => $cust_svc &>
30 <BR><% joblisting({'svcnum'=>$svcnum}, 1) %>
32 <% include('/elements/footer.html') %>
36 unless $FS::CurrentUser::CurrentUser->access_right('View customer services');
38 my($query) = $cgi->keywords;
41 my $svc_external = qsearchs({
42 'select' => 'svc_external.*',
43 'table' => 'svc_external',
44 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '.
45 ' LEFT JOIN cust_pkg USING ( pkgnum ) '.
46 ' LEFT JOIN cust_main USING ( custnum ) ',
47 'hashref' => { 'svcnum' => $svcnum },
48 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql(
49 'null_right' => 'View/link unlinked services'
51 }) or die "svc_external: Unknown svcnum $svcnum";
53 my $conf = new FS::Conf;
55 #false laziness w/all svc_*.cgi
56 my $cust_svc = qsearchs( 'cust_svc', { 'svcnum' => $svcnum } );
57 my $pkgnum = $cust_svc->getfield('pkgnum');
58 my($cust_pkg, $custnum, $display_custnum);
60 $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } );
61 $custnum = $cust_pkg->custnum;
62 $display_custnum = $cust_pkg->cust_main->display_custnum;