X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fprorate.pm;h=320fdb63ed72a69787d9bd2cbecf815a7a8f5f8c;hb=07e3614f92d8fed7e43c3527d9ec262764494faa;hp=367f15275b98b4011b036f7d4d0a292708d4503f;hpb=d3ce5efd1ec0e1a715a154696e2b0aa86e51c27b;p=freeside.git diff --git a/FS/FS/part_pkg/prorate.pm b/FS/FS/part_pkg/prorate.pm index 367f15275..320fdb63e 100644 --- a/FS/FS/part_pkg/prorate.pm +++ b/FS/FS/part_pkg/prorate.pm @@ -24,20 +24,28 @@ use FS::part_pkg::flat; 'type' => 'checkbox', }, 'prorate_round_day'=> { - 'name' => 'When prorating first month, round to '. - 'the nearest full day', + 'name' => 'Round the prorated period to the nearest '. + 'full day', 'type' => 'checkbox', }, + 'prorate_defer_bill'=> { + 'name' => 'Defer the first bill until the billing day', + 'type' => 'checkbox', + }, }, - 'fieldorder' => [ 'cutoff_day', 'add_full_period', 'prorate_round_day' ], + 'fieldorder' => [ 'cutoff_day', 'prorate_defer_bill', 'add_full_period', 'prorate_round_day' ], 'freq' => 'm', 'weight' => 20, ); sub calc_recur { my $self = shift; - my $cutoff_day = $self->option('cutoff_day') || 1; - return $self->calc_prorate(@_, $cutoff_day) - $self->calc_discount(@_); + return $self->calc_prorate(@_, $self->cutoff_day) - $self->calc_discount(@_); +} + +sub cutoff_day { + my $self = shift; + $self->option('cutoff_day', 1) || 1; } 1;