From 2224bc4165a482da4bbaf4f09210f358cd825f99 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Tue, 20 May 2014 10:51:46 -0700 Subject: [PATCH] fix one-cent errors in cust_bill_pkg_tax_location upgrade, #940 --- FS/FS/cust_bill_pkg.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm index 034601db8..212c4b688 100644 --- a/FS/FS/cust_bill_pkg.pm +++ b/FS/FS/cust_bill_pkg.pm @@ -1461,7 +1461,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++; -- 2.11.0