import torrus 1.0.9
[freeside.git] / FS / FS / part_pkg / voip_inbound.pm
index 6e9b172..1b91575 100644 (file)
@@ -24,29 +24,21 @@ tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
 %info = (
   'name' => 'VoIP flat rate pricing of CDRs for inbound calls',
   'shortname' => 'VoIP/telco CDR rating (inbound)',
+  'inherit_fields' => [ 'global_Mixin' ],
   'fields' => {
-    'setup_fee'     => { 'name' => 'Setup fee for this package',
-                         'default' => 0,
-                       },
-    'recur_fee'     => { 'name' => 'Base recurring fee for this package',
-                         'default' => 0,
-                       },
-
     #false laziness w/flat.pm
     'recur_temporality' => { 'name' => 'Charge recurring fee for period',
                              'type' => 'select',
                              'select_options' => \%temporalities,
                            },
-
-    'unused_credit' => { 'name' => 'Credit the customer for the unused portion'.
-                                   ' of service at cancellation',
-                         'type' => 'checkbox',
-                       },
-
     'cutoff_day'    => { 'name' => 'Billing Day (1 - 28) for prorating or '.
                                    'subscription',
                          'default' => '1',
                        },
+    'add_full_period'=> { 'name' => 'When prorating first month, also bill '.
+                                    'for one full period after that',
+                          'type' => 'checkbox',
+                        },
 
     'recur_method'  => { 'name' => 'Recurring fee method',
                          'type' => 'select',
@@ -151,12 +143,10 @@ tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
 
   },
   'fieldorder' => [qw(
-                       setup_fee recur_fee recur_temporality unused_credit
-                       recur_method cutoff_day
+                       recur_temporality
+                       recur_method cutoff_day add_full_period
                        min_charge sec_granularity
-                       ignore_unrateable
                        default_prefix
-                       disable_src
                        disable_tollfree
                        use_amaflags use_disposition
                        use_disposition_taqua use_carrierid use_cdrtypenum
@@ -165,7 +155,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,
@@ -368,15 +357,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;
 }