option to charge the next full period when prorating, RT#9874
[freeside.git] / FS / FS / part_pkg / voip_inbound.pm
index 6e9b172..8b1844a 100644 (file)
@@ -47,6 +47,10 @@ tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
                                    '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',
@@ -152,11 +156,9 @@ tie my %granularity, 'Tie::IxHash', FS::rate_detail::granularities();
   },
   'fieldorder' => [qw(
                        setup_fee recur_fee recur_temporality unused_credit
-                       recur_method cutoff_day
+                       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 +167,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 +369,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;
 }