diff --git a/classes/order/OrderInvoice.php b/classes/order/OrderInvoice.php index 509d77d3b..925239b1c 100644 --- a/classes/order/OrderInvoice.php +++ b/classes/order/OrderInvoice.php @@ -1011,12 +1011,24 @@ class OrderInvoiceCore extends ObjectModel { $cache_id = 'order_invoice_paid_'.(int)$this->id; if (!Cache::isStored($cache_id)) { + $objOrder = new Order($this->id_order); $amount = 0; + $payments = OrderPaymentDetail::getByInvoiceId($this->id); foreach ($payments as $payment) { /** @var OrderPayment $payment */ - $amount += ($payment['amount'] / $payment['conversion_rate']); + if ($payment['id_currency'] == $objOrder->id_currency) { + $amount += $payment['amount']; + } else { + $amountConverted = Tools::convertPrice($payment['amount'], $payment['id_currency'], false); + if ($objOrder->id_currency == Configuration::get('PS_CURRENCY_DEFAULT')) { + $amount += $amountConverted; + } else { + $amount += Tools::convertPrice($amountConverted, $objOrder->id_currency, true); + } + } } + Cache::store($cache_id, $amount); return $amount; } diff --git a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php index e55e75be1..fd1ef9d93 100644 --- a/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php +++ b/modules/hotelreservationsystem/classes/HotelRoomTypeFeaturePricing.php @@ -750,12 +750,9 @@ class HotelRoomTypeFeaturePricing extends ObjectModel $id_room )) { $selectedServices = array_shift($roomServicesServices); + $totalPrice['total_price_tax_incl'] += $selectedServices['total_price_tax_incl']; + $totalPrice['total_price_tax_excl'] += $selectedServices['total_price_tax_excl']; } - } - - if (isset($selectedServices)) { - $totalPrice['total_price_tax_incl'] += $selectedServices['total_price_tax_incl']; - $totalPrice['total_price_tax_excl'] += $selectedServices['total_price_tax_excl']; } else { if ($servicesWithTax = RoomTypeServiceProduct::getAutoAddServices( $id_product,