fix room total price in refund request when order is not paid
This commit is contained in:
@@ -203,36 +203,40 @@ class OrderReturnCore extends ObjectModel
|
||||
$bookingRow['extra_service_total_paid_amount'] = 0;
|
||||
$bookingRow['extra_service_total_price_tax_incl'] = 0;
|
||||
$bookingRow['room_paid_amount'] = 0;
|
||||
if ($objOrder->total_paid_real > 0) {
|
||||
if ($bookingRow['total_price_tax_incl'] > 0) {
|
||||
if ($bookingRow['total_price_tax_incl'] > 0) {
|
||||
if ($objOrder->total_paid_real > 0) {
|
||||
$bookingRow['room_paid_amount'] = ($objOrder->total_paid_real*$bookingRow['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
|
||||
}
|
||||
$roomSelectedDemands = $objBookingDemands->getRoomTypeBookingExtraDemands(
|
||||
$idOrder,
|
||||
$bookingRow['id_product'],
|
||||
$bookingRow['id_room'],
|
||||
$bookingRow['date_from'],
|
||||
$bookingRow['date_to'],
|
||||
0
|
||||
);
|
||||
if (count($roomSelectedDemands)) {
|
||||
foreach ($roomSelectedDemands as $demand) {
|
||||
if ($demand['total_price_tax_incl'] > 0) {
|
||||
}
|
||||
$roomSelectedDemands = $objBookingDemands->getRoomTypeBookingExtraDemands(
|
||||
$idOrder,
|
||||
$bookingRow['id_product'],
|
||||
$bookingRow['id_room'],
|
||||
$bookingRow['date_from'],
|
||||
$bookingRow['date_to'],
|
||||
0
|
||||
);
|
||||
if (count($roomSelectedDemands)) {
|
||||
foreach ($roomSelectedDemands as $demand) {
|
||||
if ($demand['total_price_tax_incl'] > 0) {
|
||||
if ($objOrder->total_paid_real > 0) {
|
||||
$bookingRow['extra_service_total_paid_amount'] += ($objOrder->total_paid_real*$demand['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
|
||||
$bookingRow['extra_service_total_price_tax_incl'] += $demand['total_price_tax_incl'];
|
||||
}
|
||||
$bookingRow['extra_service_total_price_tax_incl'] += $demand['total_price_tax_incl'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($roomSelectedServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
|
||||
$bookingRow['id_htl_booking']
|
||||
)) {
|
||||
if (count($roomSelectedServices['additional_services'])) {
|
||||
foreach ($roomSelectedServices['additional_services'] as $service) {
|
||||
if ($service['total_price_tax_incl'] > 0) {
|
||||
if ($roomSelectedServices = $objRoomTypeServiceProductOrderDetail->getSelectedServicesForRoom(
|
||||
$bookingRow['id_htl_booking']
|
||||
)) {
|
||||
if (count($roomSelectedServices['additional_services'])) {
|
||||
foreach ($roomSelectedServices['additional_services'] as $service) {
|
||||
if ($service['total_price_tax_incl'] > 0) {
|
||||
if ($objOrder->total_paid_real > 0) {
|
||||
$bookingRow['extra_service_total_paid_amount'] += ($objOrder->total_paid_real*$service['total_price_tax_incl'])/$objOrder->total_paid_tax_incl;
|
||||
$bookingRow['extra_service_total_price_tax_incl'] += $service['total_price_tax_incl'];
|
||||
}
|
||||
$bookingRow['extra_service_total_price_tax_incl'] += $service['total_price_tax_incl'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user