diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index 40e0c9bd0..4b59bc7b2 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -533,7 +533,8 @@ class Sales extends Secure_Controller private function _payments_cover_total() { - return !bccomp($this->sale_lib->get_amount_due(), 0, $this->config->item('currency_decimals')); + // Changed the conditional to account for floating point rounding + return ($this->sale_lib->get_amount_due() <= 1e-6); } private function _load_customer_data($customer_id, &$data, $totals = FALSE) diff --git a/application/helpers/locale_helper.php b/application/helpers/locale_helper.php index 096dfec84..d39a4fb0a 100644 --- a/application/helpers/locale_helper.php +++ b/application/helpers/locale_helper.php @@ -24,7 +24,7 @@ function totals_decimals() return $config->item('currency_decimals') ? $config->item('currency_decimals') : 0; } -function to_currency($number) +function to_currency($number, $escape = FALSE) { return to_decimals($number, 'currency_decimals', \NumberFormatter::CURRENCY); }