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

          tyson Tyson Phillips (Inactive) created issue -
          tyson Tyson Phillips (Inactive) made changes -
          Field Original Value New Value
          Story Points 5
          tyson Tyson Phillips (Inactive) made changes -
          Link This issue is blocked by CORE-2529 [ CORE-2529 ]
          tyson Tyson Phillips (Inactive) made changes -
          Sprint 4.6.0 Sprint 2 [ 69 ]
          tyson Tyson Phillips (Inactive) made changes -
          Rank Ranked higher
          tyson Tyson Phillips (Inactive) made changes -
          Assignee Tyson Phillips [ tyson ]
          tyson Tyson Phillips (Inactive) made changes -
          Summary Format amount to their currency's precision Round amounts to their currency's precision
          tyson Tyson Phillips (Inactive) made changes -
          Sprint 4.6.0 Sprint 2 [ 69 ] 4.6.0 Sprint 2, 4.6.0 Sprint 3 [ 69, 79 ]
          tyson Tyson Phillips (Inactive) made changes -
          Rank Ranked higher
          tyson Tyson Phillips (Inactive) made changes -
          Sprint 4.6.0 Sprint 2, 4.6.0 Sprint 3 [ 69, 79 ] 4.6.0 Sprint 2, 4.6.0 Sprint 3, 4.6.0 Sprint 4 [ 69, 79, 80 ]
          tyson Tyson Phillips (Inactive) made changes -
          Sprint 4.6.0 Sprint 2, 4.6.0 Sprint 3, 4.6.0 Sprint 4 [ 69, 79, 80 ] 4.6.0 Sprint 2, 4.6.0 Sprint 3, 4.6.0 Sprint 5 [ 69, 79, 81 ]
          tyson Tyson Phillips (Inactive) made changes -
          Rank Ranked lower
          tyson Tyson Phillips (Inactive) made changes -
          Sprint 4.6.0 Sprint 2, 4.6.0 Sprint 3, 4.6.0 Sprint 6 [ 69, 79, 81 ] 4.6.0 Sprint 2, 4.7.0 Sprint 1, 4.6.0 Sprint 3 [ 69, 76, 79 ]
          tyson Tyson Phillips (Inactive) made changes -
          Rank Ranked lower
          tyson Tyson Phillips (Inactive) made changes -
          Fix Version/s 4.6.0-b1 [ 11117 ]
          tyson Tyson Phillips (Inactive) made changes -
          Rank Ranked higher
          tyson Tyson Phillips (Inactive) made changes -
          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
          * Transactions::applyFromCredits
          * Transactions::getCreditApplyAmounts
          * Transactions::validateApplyAmounts
          * Transactions::getCreditedAmount
          * Transactions::setClosed
          * Currencies::toDecimal
          * other locations where _number_format_ is called
          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
          * Transactions::applyFromCredits
          * Transactions::getCreditApplyAmounts
          * Transactions::validateApplyAmounts
          * Transactions::getCreditedAmount
          * Transactions::setClosed
          * Currencies::toDecimal
          * Calls to Currencies::toDecimal
          * other locations where _number_format_ is called
          tyson Tyson Phillips (Inactive) made changes -
          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
          * Transactions::applyFromCredits
          * Transactions::getCreditApplyAmounts
          * Transactions::validateApplyAmounts
          * Transactions::getCreditedAmount
          * Transactions::setClosed
          * Currencies::toDecimal
          * Calls to Currencies::toDecimal
          * other locations where _number_format_ is called
          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
          * Transactions::applyFromCredits
          * Transactions::getCreditApplyAmounts
          * Transactions::validateApplyAmounts
          * Transactions::getCreditedAmount
          * Transactions::setClosed
          * Currencies::toDecimal
          * Calls to Currencies::toDecimal (to pass in decimal precision)
          * other locations where _number_format_ is called
          tyson Tyson Phillips (Inactive) made changes -
          Link This issue relates to CORE-3205 [ CORE-3205 ]
          tyson Tyson Phillips (Inactive) made changes -
          Fix Version/s 4.7.0-b1 [ 11123 ]
          Automated transition triggered when Tyson Phillips (Inactive) created a branch in Stash -
          Status Open [ 1 ] In Progress [ 3 ]
          tyson Tyson Phillips (Inactive) made changes -
          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
          * Transactions::applyFromCredits
          * Transactions::getCreditApplyAmounts
          * Transactions::validateApplyAmounts
          * Transactions::getCreditedAmount
          * Transactions::setClosed
          * Currencies::toDecimal
          * Calls to Currencies::toDecimal (to pass in decimal precision)
          * other locations where _number_format_ is called
          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::getCreditApplyAmounts
          * Transactions::validateApplyAmounts
          * Transactions::getCreditedAmount
          * Transactions::setClosed
          * Currencies::toDecimal
          * Calls to Currencies::toDecimal (to pass in decimal precision)
          * other locations where _number_format_ is called
          tyson Tyson Phillips (Inactive) made changes -
          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::getCreditApplyAmounts
          * Transactions::validateApplyAmounts
          * Transactions::getCreditedAmount
          * Transactions::setClosed
          * Currencies::toDecimal
          * Calls to Currencies::toDecimal (to pass in decimal precision)
          * other locations where _number_format_ is called
          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::getCreditApplyAmounts
          * Transactions::validateApplyAmounts
          * Transactions::getCreditedAmount
          * Transactions::setClosed
          * Currencies::toDecimal
          * Calls to Currencies::toDecimal (to pass in decimal precision)
          * other locations where _number_format_ is called
          tyson Tyson Phillips (Inactive) made changes -
          Link This issue relates to CORE-881 [ CORE-881 ]
          tyson Tyson Phillips (Inactive) made changes -
          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::getCreditApplyAmounts
          * Transactions::validateApplyAmounts
          * Transactions::getCreditedAmount
          * Transactions::setClosed
          * Currencies::toDecimal
          * Calls to Currencies::toDecimal (to pass in decimal precision)
          * other locations where _number_format_ is called
          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
          * Currencies::toDecimal
          * Calls to Currencies::toDecimal (to pass in decimal precision)
          * other locations where _number_format_ is called
          tyson Tyson Phillips (Inactive) made changes -
          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
          * Currencies::toDecimal
          * Calls to Currencies::toDecimal (to pass in decimal precision)
          * other locations where _number_format_ is called
          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
          * Calls to Currencies::toDecimal (to pass in decimal precision)
          * other locations where _number_format_ is called
          tyson Tyson Phillips (Inactive) made changes -
          Remaining Estimate 0 minutes [ 0 ]
          Time Spent 4 hours, 41 minutes [ 16860 ]
          Worklog Id 12397 [ 12397 ]
          tyson Tyson Phillips (Inactive) made changes -
          Sprint 4.6.0 Sprint 2, 4.7.0 Sprint 1, 4.6.0 Sprint 3 [ 69, 76, 79 ] 4.6.0 Sprint 2, 4.7.0 Sprint 1, 4.6.0 Sprint 3, 4.7.0 Sprint 2 [ 69, 76, 79, 87 ]
          tyson Tyson Phillips (Inactive) made changes -
          Rank Ranked higher
          tyson Tyson Phillips (Inactive) made changes -
          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
          * Calls to Currencies::toDecimal (to pass in decimal precision)
          * other locations where _number_format_ is called
          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
          * Calls to Currencies::toDecimal (to pass in decimal precision)
          * other locations where _number_format_ is called
          tyson Tyson Phillips (Inactive) made changes -
          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
          * Calls to Currencies::toDecimal (to pass in decimal precision)
          * other locations where _number_format_ is called
          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
          tyson Tyson Phillips (Inactive) made changes -
          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
          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
          Automated transition triggered when Tyson Phillips (Inactive) created pull request #706 in Stash -
          Status In Progress [ 3 ] In Review [ 5 ]
          Resolution Fixed [ 1 ]
          tyson Tyson Phillips (Inactive) made changes -
          Time Spent 4 hours, 41 minutes [ 16860 ] 7 hours, 4 minutes [ 25440 ]
          Worklog Id 12423 [ 12423 ]
          tyson Tyson Phillips (Inactive) made changes -
          Sprint 4.6.0 Sprint 2, 4.7.0 Sprint 1, 4.6.0 Sprint 3, 4.7.0 Sprint 2 [ 69, 76, 79, 87 ] 4.6.0 Sprint 2, 4.7.0 Sprint 1, 4.6.0 Sprint 3, 4.7.0 Sprint 2, 4.7.0 Sprint 3 [ 69, 76, 79, 87, 88 ]
          tyson Tyson Phillips (Inactive) made changes -
          Rank Ranked higher
          tyson Tyson Phillips (Inactive) made changes -
          Sprint 4.6.0 Sprint 2, 4.7.0 Sprint 1, 4.6.0 Sprint 3, 4.7.0 Sprint 2, 4.7.0 Sprint 3 [ 69, 76, 79, 87, 88 ] 4.6.0 Sprint 2, 4.7.0 Sprint 1, 4.6.0 Sprint 3, 4.7.0 Sprint 2, 4.7.0 Sprint 3, 4.7.0 Sprint 4 [ 69, 76, 79, 87, 88, 89 ]
          tyson Tyson Phillips (Inactive) made changes -
          Rank Ranked higher
          Automated transition triggered when Tyson Phillips (Inactive) merged pull request #706 in Stash -
          Status In Review [ 5 ] Closed [ 6 ]
          tyson Tyson Phillips (Inactive) made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          tyson Tyson Phillips (Inactive) made changes -
          Security Private [ 10000 ]
          tyson Tyson Phillips (Inactive) made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          jonathan Jonathan Reissmueller made changes -
          Link This issue relates to CORE-883 [ CORE-883 ]
          tyson Tyson Phillips (Inactive) made changes -
          Link This issue is duplicated by CORE-1092 [ CORE-1092 ]

            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