small UI fix for unapplied partial credits
[freeside.git] / httemplate / view / svc_acct.cgi
index 58591fc..8657f16 100755 (executable)
@@ -2,6 +2,7 @@
 <%
 
 my $conf = new FS::Conf;
+my $mydomain = $conf->config('domain');
 
 my($query) = $cgi->keywords;
 $query =~ /^(\d+)$/;
@@ -31,7 +32,11 @@ if ( $svc_acct->domsvc ) {
   die "Unknown domain" unless $svc_domain;
   $domain = $svc_domain->domain;
 } else {
-  die "No svc_domain.svcnum record for svc_acct.domsvc: ". $cust_svc->domsvc;
+  unless ( $mydomain ) {
+    die "No legacy domain config file and no svc_domain.svcnum record ".
+        "for svc_acct.domsvc: ". $cust_svc->domsvc;
+  }
+  $domain = $mydomain;
 }
 
 %>
@@ -45,8 +50,7 @@ function areyousure(href) {
 
 <%= header('Account View', menubar(
   ( ( $pkgnum || $custnum )
-    ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum",
-        "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+    ? ( "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
       )
     : ( "Cancel this (unaudited) account" =>
           "javascript:areyousure(\'${p}misc/cancel-unaudited.cgi?$svcnum\')" )
@@ -174,7 +178,7 @@ if ($svc_acct->slipip) {
           : $svc_acct->slipip
         ). "</TD>";
   my($attribute);
-  foreach $attribute ( grep /^radius_/, $svc_acct->fields ) {
+  foreach $attribute ( grep /^radius_/, fields('svc_acct') ) {
     #warn $attribute;
     $attribute =~ /^radius_(.*)$/;
     my $pattribute = $FS::raddb::attrib{$1};
@@ -182,7 +186,7 @@ if ($svc_acct->slipip) {
           "<TD BGCOLOR=\"#ffffff\">". $svc_acct->getfield($attribute).
           "</TD></TR>";
   }
-  foreach $attribute ( grep /^rc_/, $svc_acct->fields ) {
+  foreach $attribute ( grep /^rc_/, fields('svc_acct') ) {
     #warn $attribute;
     $attribute =~ /^rc_(.*)$/;
     my $pattribute = $FS::raddb::attrib{$1};
@@ -197,19 +201,7 @@ if ($svc_acct->slipip) {
 print '<TR><TD ALIGN="right">RADIUS groups</TD><TD BGCOLOR="#ffffff">'.
       join('<BR>', $svc_acct->radius_groups). '</TD></TR>';
 
-# Can this be abstracted further?  Maybe a library function like
-# widget('HTML', 'view', $svc_acct) ?  It would definitely make UI 
-# style management easier.
-
-foreach (sort { $a cmp $b } $svc_acct->virtual_fields) {
-  print $svc_acct->pvf($_)->widget('HTML', 'view', $svc_acct->getfield($_)),
-      "\n";
-}
-%>
-</TABLE></TD></TR></TABLE>
-<%
-
-print '<BR><BR>';
+print '</TABLE></TD></TR></TABLE><BR><BR>';
 
 print join("\n", $conf->config('svc_acct-notes') ). '<BR><BR>'.
       joblisting({'svcnum'=>$svcnum}, 1). '</BODY></HTML>';