Fix incorrect calculation of total price for flex products

This commit is contained in:
Björn Fromme
2022-04-07 15:20:10 +02:00
parent a5bd353dfe
commit 858a6d1886
@@ -91,7 +91,7 @@ class ContingentDataService
) {
$data = $this->contingentRepository->getAvailableRooms($dateFrom, $dateTo, $hotel, $product);
$period = new Period($dateFrom, $dateTo);
$nights = $period->getDateInterval()->format('%a');
$nights = $period->dateInterval()->format('%a');
$rooms = [];
@@ -108,7 +108,7 @@ class ContingentDataService
$row['servicesIncluded'] = unserialize($row['servicesIncluded'], ['allowed_classes' => false]);
$row['servicesOptional'] = unserialize($row['servicesOptional'], ['allowed_classes' => false]);
$row['priceForSelection'] = $row['price'] * $row['minNights'] + ($nights - $row['minNights']) * $row['additionalNightPrice'];
$row['priceForSelection'] = $row['price'] + ($nights - $row['minNights']) * $row['additionalNightPrice'];
$rooms[] = $row;
}