X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fprorate.pm;h=a5f9ef6b6e83fa23fe25c9b00a9dbc755ccbe5a1;hp=ac86f3918c729f7568568f7a85a9a83d90b67637;hb=d62206a94d9d49ef96640e0a8ec492679f8345e9;hpb=9b61510dcd5a7e30c0c1664df619bcff0aa50f08 diff --git a/FS/FS/part_pkg/prorate.pm b/FS/FS/part_pkg/prorate.pm index ac86f3918..a5f9ef6b6 100644 --- a/FS/FS/part_pkg/prorate.pm +++ b/FS/FS/part_pkg/prorate.pm @@ -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 {