fix real customer numbers showing on view pages, RT#4099/4379
[freeside.git] / httemplate / view / svc_domain.cgi
index d6565db..8c1f4ce 100755 (executable)
@@ -1,6 +1,6 @@
 <% include("/elements/header.html",'Domain View', menubar(
   ( ( $pkgnum || $custnum )
-    ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+    ? ( "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum",
       )
     : ( "Delete this (unaudited) domain" =>
           "javascript:areyousure('${p}misc/cancel-unaudited.cgi?$svcnum', 'Delete $domain and all records?' )" )
@@ -136,10 +136,11 @@ die "Unknown svcnum" unless $svc_domain;
 
 my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
 my $pkgnum = $cust_svc->getfield('pkgnum');
-my($cust_pkg, $custnum);
+my($cust_pkg, $custnum, $display_custnum);
 if ($pkgnum) {
-  $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
-  $custnum=$cust_pkg->getfield('custnum');
+  $cust_pkg =qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+  $custnum = $cust_pkg->custnum;
+  $custnum = $cust_pkg->cust_main->display_custnum;
 } else {
   $cust_pkg = '';
   $custnum = '';