projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a057e75
)
fix DST in prorate test
author
Mark Wells
<mark@freeside.biz>
Wed, 27 Apr 2016 20:35:38 +0000
(13:35 -0700)
committer
Mark Wells
<mark@freeside.biz>
Wed, 27 Apr 2016 20:39:03 +0000
(13:39 -0700)
FS/t/suite/02-bill_customer.t
patch
|
blob
|
history
diff --git
a/FS/t/suite/02-bill_customer.t
b/FS/t/suite/02-bill_customer.t
index
e3f6406
..
3fa908e
100755
(executable)
--- a/
FS/t/suite/02-bill_customer.t
+++ b/
FS/t/suite/02-bill_customer.t
@@
-23,9
+23,10
@@
ok($error eq '', "billed on $date") or diag($error);
my $cust_bill = $return[0];
isa_ok($cust_bill, 'FS::cust_bill');
my $cust_bill = $return[0];
isa_ok($cust_bill, 'FS::cust_bill');
-# 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' );
+# Apr 1 - Mar 20 = 12 days = 288 hours
+# Apr 1 - Mar 1 = 31 days - 1 hour (DST) = 743 hours
+# 288/743 * $30 = $11.63 recur + $20.00 setup
+ok( $cust_bill->charged == 31.63, 'prorated first month correctly' );
# the package bill date should now be 2016-04-01
my @lineitems = $cust_bill->cust_bill_pkg;
# the package bill date should now be 2016-04-01
my @lineitems = $cust_bill->cust_bill_pkg;