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

Invoice lines are rounded improperly

    Details

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

      Description

      To reproduce:

      • Make sure USD has a precision of 2
      • Create an invoice with a qty of 100 and a price of 0.005
      • See the total is $10 instead of $5

      To resolve:

      around line 170 change

                      $line['amount'] = $this->Currencies->toDecimal(
                          $line['amount'],
                          $vars['currency']
                      );
      

      to

                      $line['amount'] = $this->Currencies->toDecimal(
                          $line['amount'],
                          $vars['currency'],
                          null,
                          4
                      );
      

      Same around line 655

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            jonathan Jonathan Reissmueller
            Reporter:
            jonathan Jonathan Reissmueller
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              19/Mar/25

              Agile