'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',
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 {