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

Premature rounding of decimal config option quantities

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.2.1
    • Fix Version/s: 5.2.2
    • Component/s: None
    • Labels:
      None

      Description

      If you have a product with a config option of the type quantity such that:

      • There is a config option for say bandwidth
      • The per-unit price is $0.005, with a min of say 100, max of 1000
      • You order 500.

      Then:

      • The order form will correctly show that you have ordered 500x0.005 or $2.50 for the item
      • When you check out, the invoice will show a price of $5.00 for the item

      It appears that the fractional penny is rounded up to the nearest cent prior to being multiplied by the quantity. Interestingly, if you change the currency precision from 2 to 4, it is no longer an issue.

      If I'm right, it looks like we need to round these config option quantities AFTER we multiply the price times the quantity, not prior to multiplying by the quantity.

        Activity

        admin Paul Phillips created issue -
        admin Paul Phillips made changes -
        Field Original Value New Value
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked lower
        jonathan Jonathan Reissmueller made changes -
        Sprint 5.3.0 Sprint 4 [ 145 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked lower
        abdy Abdy Franco made changes -
        Assignee Abdy Franco [ abdy ]
        abdy Abdy Franco made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 7 hours, 47 minutes [ 28020 ]
        Worklog Id 15393 [ 15393 ]
        abdy Abdy Franco made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        abdy Abdy Franco made changes -
        Status In Progress [ 3 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        abdy Abdy Franco made changes -
        Time Spent 7 hours, 47 minutes [ 28020 ] 1 day, 5 hours, 41 minutes [ 49260 ]
        Worklog Id 15394 [ 15394 ]
        jonathan Jonathan Reissmueller made changes -
        Time Spent 1 day, 5 hours, 41 minutes [ 49260 ] 1 day, 6 hours, 34 minutes [ 52440 ]
        Worklog Id 15401 [ 15401 ]
        abdy Abdy Franco made changes -
        Time Spent 1 day, 6 hours, 34 minutes [ 52440 ] 2 days, 1 hour, 18 minutes [ 62280 ]
        Worklog Id 15402 [ 15402 ]
        abdy Abdy Franco made changes -
        Time Spent 2 days, 1 hour, 18 minutes [ 62280 ] 2 days, 2 hours, 37 minutes [ 67020 ]
        Worklog Id 15404 [ 15404 ]
        abdy Abdy Franco made changes -
        Time Spent 2 days, 2 hours, 37 minutes [ 67020 ] 2 days, 2 hours, 48 minutes [ 67680 ]
        Worklog Id 15405 [ 15405 ]
        jonathan Jonathan Reissmueller made changes -
        Time Spent 2 days, 2 hours, 48 minutes [ 67680 ] 2 days, 3 hours, 13 minutes [ 69180 ]
        Worklog Id 15411 [ 15411 ]
        jonathan Jonathan Reissmueller made changes -
        Status In Review [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            abdy Abdy Franco
            Reporter:
            admin Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              14/Dec/21

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 2 days, 3 hours, 13 minutes
              2d 3h 13m

                Agile