fix prorating w/quantities, RT#21283
authorIvan Kohler <ivan@freeside.biz>
Fri, 8 Feb 2013 05:38:31 +0000 (21:38 -0800)
committerIvan Kohler <ivan@freeside.biz>
Fri, 8 Feb 2013 05:38:31 +0000 (21:38 -0800)
FS/FS/part_pkg/prorate_Mixin.pm

index d148c96..153ed56 100644 (file)
@@ -154,7 +154,10 @@ sub calc_prorate {
                                                   #so 1.005 rounds to 1.01
   $charge = sprintf('%.2f', $permonth * $months + 0.00000001 );
 
-  return $charge;
+  my $quantity = $cust_pkg->quantity || 1;
+  $charge *= $quantity;
+
+  return sprintf('%.2f', $charge);
 }
 
 =item prorate_setup CUST_PKG SDATE