fix basic prorate test
authorMark Wells <mark@freeside.biz>
Tue, 26 Apr 2016 20:06:37 +0000 (13:06 -0700)
committerMark Wells <mark@freeside.biz>
Tue, 26 Apr 2016 20:07:04 +0000 (13:07 -0700)
FS/t/suite/01-order_pkg.t
FS/t/suite/02-bill_customer.t

index 1511350..ab5a2dd 100755 (executable)
@@ -16,7 +16,7 @@ my $form = $FS->form('OrderPkgForm');
 # behavior visible).
 
 my %params = (
-  pkgpart                 => 5,
+  pkgpart                 => 2,
   quantity                => 1,
   start                   => 'on_date',
   start_date              => '03/20/2016',
index 0afffaa..e3f6406 100755 (executable)
@@ -23,8 +23,9 @@ ok($error eq '', "billed on $date") or diag($error);
 my $cust_bill = $return[0];
 isa_ok($cust_bill, 'FS::cust_bill');
 
-# $60/month * (30 days - 19 days)/30 days = $42
-ok( $cust_bill->charged == 42.00, 'prorated first month correctly' );
+# Apr 1 - Mar 20 = 12 days
+# 12/31 * $30 = 11.61 recurring, + 20.00 setup
+ok( $cust_bill->charged == 31.61, 'prorated first month correctly' );
 
 # the package bill date should now be 2016-04-01
 my @lineitems = $cust_bill->cust_bill_pkg;