1 package FS::part_pkg::prorate;
4 use vars qw(@ISA %info);
5 use Time::Local qw(timelocal);
6 #use FS::Record qw(qsearch qsearchs);
7 use FS::part_pkg::flat;
9 @ISA = qw(FS::part_pkg::flat);
12 'name' => 'First partial month pro-rated, then flat-rate (selectable billing day)',
13 'shortname' => 'Prorate (Nth of month billing)',
14 'inherit_fields' => [ 'flat', 'usage_Mixin', 'global_Mixin' ],
16 'recur_temporality' => {'disabled' => 1},
17 'sync_bill_date' => {'disabled' => 1},
18 'cutoff_day' => { 'name' => 'Billing Day (1 - 28)',
22 'add_full_period'=> { 'name' => 'When prorating first month, also bill '.
23 'for one full period after that',
26 'prorate_round_day'=> {
27 'name' => 'Round the prorated period to the nearest '.
31 'prorate_defer_bill'=> {
32 'name' => 'Defer the first bill until the billing day',
36 'fieldorder' => [ 'cutoff_day', 'prorate_defer_bill', 'add_full_period', 'prorate_round_day' ],
43 return $self->calc_prorate(@_, $self->cutoff_day) - $self->calc_discount(@_);
48 $self->option('cutoff_day') || 1;