fix display bug, RT#8524
authormark <mark>
Fri, 21 May 2010 03:42:20 +0000 (03:42 +0000)
committermark <mark>
Fri, 21 May 2010 03:42:20 +0000 (03:42 +0000)
FS/FS/part_pkg/prorate.pm
FS/FS/part_pkg/voip_inbound.pm
httemplate/edit/part_pkg.cgi

index d3ca77a..e577308 100644 (file)
@@ -86,7 +86,7 @@ use FS::part_pkg::flat;
                     },
   },
   'fieldorder' => [ 'setup_fee', 'recur_fee', 'unused_credit', 'cutoff_day',
-                    'seconds', 'upbyte', 'downbytes', 'totalbytes',
+                    'seconds', 'upbytes', 'downbytes', 'totalbytes',
                     'recharge_amount', 'recharge_seconds', 'recharge_upbytes',
                     'recharge_downbytes', 'recharge_totalbytes',
                     'usage_rollover', 'recharge_reset', 'externalid', ],
index 15291e3..4937bb8 100644 (file)
@@ -163,7 +163,6 @@ tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
                        use_duration
                        output_format usage_mandate summarize_usage usage_section
                        bill_every_call
-                       count_available_phones
                      )
                   ],
   'weight' => 40,
@@ -366,15 +365,8 @@ sub is_free {
 #  to indicate it represents a line
 sub calc_units {    
   my($self, $cust_pkg ) = @_;
-  my $count = 0;
-  if ( $self->option('count_available_phones', 1)) {
-    map { $count += ( $_->quantity || 0 ) }
-      grep { $_->part_svc->svcdb eq 'svc_phone' }
-      $cust_pkg->part_pkg->pkg_svc;
-  } else {
-    $count = 
+  my $count = 
       scalar(grep { $_->part_svc->svcdb eq 'svc_phone' } $cust_pkg->cust_svc);
-  }
   $count;
 }
 
index f9818c4..9ee8d4d 100755 (executable)
@@ -506,6 +506,12 @@ my $html_bottom = sub {
                    : keys %{ $href };
   
     foreach my $field ( grep $_ !~ /^(setup|recur)_fee$/, @fields ) {
+
+      if(!exists($href->{$field})) {
+        # shouldn't happen
+        warn "nonexistent part_pkg option: '$field'\n";
+        next;
+      }
   
       $html .= '<TR><TD ALIGN="right">'. $href->{$field}{'name'}. '</TD><TD>';