X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fprorate.pm;h=44f2f2582d96b2f8af932d81d78bcd26ee5c97e4;hb=146c2e9563b8afc05fe283791b998723ca585742;hp=ac86f3918c729f7568568f7a85a9a83d90b67637;hpb=e881063d6e46d991003cf8fae96d8d36780fedcd;p=freeside.git diff --git a/FS/FS/part_pkg/prorate.pm b/FS/FS/part_pkg/prorate.pm index ac86f3918..44f2f2582 100644 --- a/FS/FS/part_pkg/prorate.pm +++ b/FS/FS/part_pkg/prorate.pm @@ -24,9 +24,9 @@ use FS::part_pkg::flat; 'type' => 'checkbox', }, 'prorate_round_day'=> { - 'name' => 'Round the prorated period to the nearest '. - 'full day', - 'type' => 'checkbox', + 'name' => 'Round the prorated period', + 'type' => 'select', + 'select_options' => \%FS::part_pkg::prorate_Mixin::prorate_round_day_opts, }, 'prorate_defer_bill'=> { 'name' => 'Defer the first bill until the billing day', @@ -45,8 +45,12 @@ use FS::part_pkg::flat; sub calc_recur { my $self = shift; my $cust_pkg = $_[0]; - $self->calc_prorate(@_, $self->cutoff_day($cust_pkg)) - - $self->calc_discount(@_); + + my $charge = $self->calc_prorate(@_, $self->cutoff_day($cust_pkg)); + my $discount = $self->calc_discount(@_); + + sprintf( '%.2f', ($cust_pkg->quantity || 1) * ($charge - $discount) ); + } sub cutoff_day {