Merge branch 'master' of git.freeside.biz:/home/git/freeside
authorIvan Kohler <ivan@freeside.biz>
Tue, 16 Sep 2014 03:55:19 +0000 (20:55 -0700)
committerIvan Kohler <ivan@freeside.biz>
Tue, 16 Sep 2014 03:55:19 +0000 (20:55 -0700)
FS/FS/ConfDefaults.pm
FS/FS/part_export/nena2.pm
FS/FS/part_pkg/sqlradacct_hour.pm
httemplate/search/sqlradius.cgi
httemplate/view/elements/svc_radius_usage.html

index c20a9c9..a66d0ab 100644 (file)
@@ -33,10 +33,10 @@ sub cust_fields_avail { (
   'Cust# | Cust. Status | Customer' =>
     'custnum | Status | Last, First or Company (Last, First)',
 
-  'Cust. Status | Day phone | Night phone | Mobile phone | Fax number' =>
-    'Status | (all phones)',
-  'Cust# | Cust. Status | Day phone | Night phone | Mobile phone | Fax number' =>
-    'custnum | Status | (all phones)',
+  'Customer | Day phone | Night phone | Mobile phone | Fax number' =>
+    'Customer | (all phones)',
+  'Cust# | Customer | Day phone | Night phone | Mobile phone | Fax number' =>
+    'custnum | Customer | (all phones)',
 
   'Cust. Status | Name | Company' =>
     'Status | Last, First | Company',
index fa3597b..4d3f08f 100644 (file)
@@ -169,15 +169,6 @@ my %function_code = (
 );
 
 sub immediate {
-  local $@;
-  eval "use Geo::StreetAddress::US";
-  if ($@) {
-    if ($@ =~ /^Can't locate/) {
-      return "Geo::StreetAddress::US must be installed to use the NENA2 export.";
-    } else {
-      die $@;
-    }
-  }
 
   # validate some things
   my ($self, $action, $svc) = @_;
@@ -209,6 +200,15 @@ sub create_item {
 }
 
 sub data {
+  local $@;
+  eval "use Geo::StreetAddress::US";
+  if ($@) {
+    if ($@ =~ /^Can't locate/) {
+      return "Geo::StreetAddress::US must be installed to use the NENA2 export.";
+    } else {
+      die $@;
+    }
+  }
   # generate the entire record here.  reconciliation of multiple updates to 
   # the same service can be done at process time.
   my $self = shift;
@@ -259,7 +259,6 @@ sub data {
   } else {
     $hash{location} = $cust_location->address2;
   }
-  $hash{location}             = $location_hash->{address2};
 
   # customer name and class
   $hash{customer_name} = $svc->phone_name_or_cust;
index 2f9d833..79e64fb 100644 (file)
@@ -138,15 +138,15 @@ sub calc_recur {
 
   if ( $self->option('recur_total_charge') > 0 ) {
     push @$details,
-      sprintf( "Last month's data %.1f %ss: %s", $total, BA, $totalcharge );
+      sprintf( "Last month's data %.3f %ss: %s", $total, BA, $totalcharge );
   }
   if ( $self->option('recur_input_charge') > 0 ) {
     push @$details,
-      sprintf( "Last month's download %.1f %ss: %s", $input, BA, $inputcharge );
+      sprintf( "Last month's download %.3f %ss: %s", $input, BA, $inputcharge );
   }
   if ( $self->option('recur_output_charge') > 0 ) {
     push @$details,
-      sprintf( "Last month's upload %.1f %ss: %s", $output, BA, $outputcharge );
+      sprintf( "Last month's upload %.3f %ss: %s", $output, BA, $outputcharge );
   }
   if ( $self->option('recur_hourly_charge')  > 0 ) {
     push @$details, "Last month\'s time ".
index 604f44e..5d6aeea 100644 (file)
@@ -302,10 +302,10 @@ my $duration_format = sub {
 
 my $octets_format = sub {
   my $octets = shift;
-  my $megs = $octets / 1048576;
-  sprintf('<B>%.3f</B>&nbsp;megs', $megs);
-  #my $gigs = $octets / 1073741824
-  #sprintf('<B>%.3f</B> gigabytes', $gigs);
+  #my $megs = $octets / 1048576;
+  #sprintf('<B>%.3f</B>&nbsp;megs', $megs);
+  my $gigs = $octets / 1073741824;
+  sprintf('<B>%.3f</B>&nbsp;gigs', $gigs);
 };
 
 ###
@@ -380,9 +380,9 @@ tie %fields, 'Tie::IxHash',
                              my $src = shift;
                              if ( $src =~
                                     /^\s*(([\dA-F]{2}[\-:]){5}[\dA-F]{2})/i ) {
-                               return $src. ' ('.
+                               return $src. ' <span style="white-space: nowrap">('.
                                         (Net::MAC::Vendor::lookup($1))->[0].
-                                      ')';
+                                      ')</span>';
 
                              }
                              length($src) ? $src : '&nbsp';
@@ -396,9 +396,9 @@ tie %fields, 'Tie::IxHash',
                              my $dst = shift;
                              if ( $dst =~
                                     /^\s*(([\dA-F]{2}[\-:]){5}[\dA-F]{2})/i ) {
-                               return $dst. ' ('.
+                               return $dst. ' <span style="white-space: nowrap">('.
                                         (Net::MAC::Vendor::lookup($1))->[0].
-                                      ')';
+                                      ')</span>';
                              }
                              length($dst) ? $dst : '&nbsp';
                            },
index 08d6d53..4719691 100644 (file)
 %
 %  my $input = $svc->attribute_since_sqlradacct(
 %    $last_bill, time, 'AcctInputOctets'
-%  ) / 1048576;
+%  ) / 1073741824;
 %  my $output = $svc->attribute_since_sqlradacct(
 %    $last_bill, time, 'AcctOutputOctets'
-%  ) / 1048576;
+%  ) / 1073741824;
 %
 %  my $last_mac = $svc->attribute_last_sqlradacct( 'CallingStationId' );
 %  if ( $last_mac =~ /^\s*(([\dA-F]{2}[\-:]){5}[\dA-F]{2})/i ) {
@@ -57,8 +57,8 @@
 % } 
 
 
-  Upload: <B><% sprintf("%.3f", $input) %></B> megabytes<BR>
-  Download: <B><% sprintf("%.3f", $output) %></B> megabytes<BR>
+  Upload: <B><% sprintf("%.3f", $input) %></B> gigabytes<BR>
+  Download: <B><% sprintf("%.3f", $output) %></B> gigabytes<BR>
 % if ( $svc->table eq 'svc_acct' ) {
     Last Login: <B><% $svc->last_login_text %></B><BR>
 % }