Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 4.7.0-b1
-
Component/s: None
-
Labels:None
Description
Various calculations are done on amounts, but we often use 4-decimal precision or 2-decimal precision. Instead, we should use the precision of the currency the amount represents.
Consider places like:
- Invoices::setClosed
- Invoices::updateTotals
- Transactions::applyFromCredits
- Transactions::getCredits
- Transactions::getTotalCredit
- Transactions::getCreditApplyAmounts
- Transactions::validateApplyAmounts
- Transactions::getCreditedAmount
- Transactions::setClosed
- Transactions::verifyApply
- Currencies::toDecimal
- Currencies::toCurrency
- Currencies::toCurrencyValue
- CurrencyFormat::cast
- CurrencyFormat::format
- AppModel::truncateDecimal
- AppModel::currencyToDecimal
- Calls to Currencies::toDecimal (to pass in decimal precision)
- other locations where number_format is called