summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-05-20 10:51:28 -0700
committerMark Wells <mark@freeside.biz>2014-05-20 10:51:28 -0700
commit24b3cded842823df810e6bee6ef66237c783f033 (patch)
tree98fbda8fe02044cf7bb876b66a7e628b5708c45d
parentd81ba2cb27849831d3946d408e9f39697f66702b (diff)
fix one-cent errors in cust_bill_pkg_tax_location upgrade, #940
-rw-r--r--FS/FS/cust_bill_pkg.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm
index 4b85d303b..bddadbd44 100644
--- a/FS/FS/cust_bill_pkg.pm
+++ b/FS/FS/cust_bill_pkg.pm
@@ -1485,7 +1485,9 @@ sub upgrade_tax_location {
my $i = 0;
my $nlinks = scalar(@tax_links);
if ( $nlinks ) {
- while (int($cents_remaining) > 0) {
+ # ensure that it really is an integer
+ $cents_remaining = sprintf('%.0f', $cents_remaining);
+ while ($cents_remaining > 0) {
$tax_links[$i % $nlinks]->{cents} += 1;
$cents_remaining--;
$i++;