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

Round amounts based on currency format

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.0.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The issue:

      Invoices generated in currencies without decimal places may contain decimal places from various calculations (tax, for example) in their total. In some cases this may not be desirable.

      Solution:

      -Add an option for each currency to set whether or not values should be rounded to the formatted decimals. For example, if the currency format is #,###.## and this option is enabled, round to 2 decimal places. If currency format is #,### and this option is enabled, round to 0 decimal places.-

      Add field for each currency to set precision of that currency. Default values to those that match for the currency format.

      -Rounding should occur only for invoice total calculations.-

      When converting values to decimal format (Currencies::toDecimal), there is a parameter to specify precision, which I believe defaults to 2-decimals places. We should add a new method to fetch the precision for a particular currency so that it can be passed into Currencies::toDecimal and Currencies::toCurrency to override the default precision.

      Initial discussion can be found here: http://www.blesta.com/forums/index.php?/topic/979-invoice-rounding-in-different-currency/#entry15852


      To update:
      This task should update all instances of currency formatting, both for display and for calculation as described in CORE-1581. Currency decimal formatting should always be considered when rounding, and an invoice total would equate to the sum of its rounded line items in the selected currency.

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cody Cody Phillips (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: