Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-3036

Round amounts to their currency's precision

    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

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              tyson Tyson Phillips (Inactive)
              Reporter:
              tyson Tyson Phillips (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                5/Sep/19

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 7 hours, 4 minutes
                7h 4m

                  Agile