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

Services with override currency invoice incorrectly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1.3, 5.2.0-b1
    • Component/s: None
    • Labels:
      None

      Description

      To reproduce:

      • Create a service with no config options
      • Edit the service and set an override currency/price
      • Generate a renewal invoice
      • See the invoice total is not the override price, but rather the override price times the exchange rate of the override currency

      Try this to resolve. In Invoices::getLinesForServices() update:

                      $items[] = [
                          'service_id' => $service_id,
                          'qty' => $item->qty,
                          'amount' => $this->Currencies->convert(
                              $item->price,
                              $service->package_pricing->currency,
                              $currency,
                              Configure::get('Blesta.company_id')
                          ),
                          'description' => $item->description,
                          'tax' => !empty($item->taxes)
                      ];
      

      To

                      $items[] = [
                          'service_id' => $service_id,
                          'qty' => $item->qty,
                          'amount' => $this->Currencies->convert(
                              $item->price,
                              $service->override_currency ?? $service->package_pricing->currency,
                              $currency,
                              Configure::get('Blesta.company_id')
                          ),
                          'description' => $item->description,
                          'tax' => !empty($item->taxes)
                      ];
      

        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:
              24/Aug/21

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 15 minutes
              15m

                Agile