Revert "Check if payments cover total using currency decimals configuration"

This reverts commit 9a7061e9c5.
This commit is contained in:
jekkos
2016-07-17 14:51:55 +02:00
parent 9a7061e9c5
commit 4be3c8f433
2 changed files with 3 additions and 2 deletions

View File

@@ -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)

View File

@@ -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);
}