Compare commits
16
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
12760844e2 | ||
|
|
1e59d38eb4 | ||
|
|
225ed518e3 | ||
|
|
1a653726b4 | ||
|
|
41424de151 | ||
|
|
bb7ae1adcc | ||
|
|
a294d1cc5e | ||
|
|
3ae30899ea | ||
|
|
f0b68b2cc4 | ||
|
|
90b0726f0d | ||
|
|
423ffafb9e | ||
|
|
5247135025 | ||
|
|
bec21bd2fd | ||
|
|
2cc9269236 | ||
|
|
e902a5e298 | ||
|
|
306cd6bec4 |
No files matched your search
Generated
+7
-7
@@ -11622,16 +11622,16 @@
|
||||
},
|
||||
{
|
||||
"name": "friendsofphp/php-cs-fixer",
|
||||
"version": "v3.95.15",
|
||||
"version": "v3.95.13",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
||||
"reference": "3e47e5d50046f87e3244acde2fe655d1a3b72555"
|
||||
"reference": "ea941114a002eb5e5876f190223deec1066c482c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/3e47e5d50046f87e3244acde2fe655d1a3b72555",
|
||||
"reference": "3e47e5d50046f87e3244acde2fe655d1a3b72555",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/ea941114a002eb5e5876f190223deec1066c482c",
|
||||
"reference": "ea941114a002eb5e5876f190223deec1066c482c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -11671,7 +11671,7 @@
|
||||
"php-coveralls/php-coveralls": "^2.9.1",
|
||||
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.8",
|
||||
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.8",
|
||||
"phpunit/phpunit": "^9.6.35 || ^10.5.64 || ^11.5.56 || ^12.5.31",
|
||||
"phpunit/phpunit": "^9.6.35 || ^10.5.64 || ^11.5.56",
|
||||
"symfony/polyfill-php85": "^1.38",
|
||||
"symfony/var-dumper": "^5.4.48 || ^6.4.36 || ^7.4.8 || ^8.1.0",
|
||||
"symfony/yaml": "^5.4.53 || ^6.4.41 || ^7.4.13 || ^8.1.0"
|
||||
@@ -11715,7 +11715,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.95.15"
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.95.13"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -11723,7 +11723,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2026-07-15T09:51:47+00:00"
|
||||
"time": "2026-07-10T09:23:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "myclabs/deep-copy",
|
||||
|
||||
@@ -14,11 +14,7 @@ security:
|
||||
users:
|
||||
mailjet:
|
||||
password: '%env(MAILJET_WEBHOOK_BASIC_PASSWORD)%'
|
||||
roles: [ ROLE_MAILJET_WEBHOOK ]
|
||||
role_hierarchy:
|
||||
ROLE_ADMIN: [ ROLE_GROUPS_ADMIN ]
|
||||
ROLE_GROUPS_ADMIN: [ ROLE_GROUPS_MANAGER ]
|
||||
|
||||
roles: ['ROLE_MAILJET_WEBHOOK']
|
||||
firewalls:
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260716101949 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Split the single accommodation booking discount into per-component discounts';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE accommodation_booking CHANGE discount accommodation_discount INT DEFAULT NULL, ADD board_service_discount INT DEFAULT NULL, ADD additional_services_discount INT DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE accommodation_booking CHANGE accommodation_discount discount INT DEFAULT NULL, DROP board_service_discount, DROP additional_services_discount');
|
||||
}
|
||||
}
|
||||
@@ -114,16 +114,8 @@ class AccommodationBooking implements BlameableEntityInterface, TimestampableEnt
|
||||
private ?string $remarks = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
#[Assert\Range(min: 1, max: 100)]
|
||||
private ?int $accommodationDiscount = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
#[Assert\Range(min: 1, max: 100)]
|
||||
private ?int $boardServiceDiscount = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
#[Assert\Range(min: 1, max: 100)]
|
||||
private ?int $additionalServicesDiscount = null;
|
||||
#[Assert\Positive(message: 'invalid')]
|
||||
private ?int $discount = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -481,38 +473,14 @@ class AccommodationBooking implements BlameableEntityInterface, TimestampableEnt
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAccommodationDiscount(): ?int
|
||||
public function getDiscount(): ?int
|
||||
{
|
||||
return $this->accommodationDiscount;
|
||||
return $this->discount;
|
||||
}
|
||||
|
||||
public function setAccommodationDiscount(?int $accommodationDiscount): self
|
||||
public function setDiscount(?int $discount): self
|
||||
{
|
||||
$this->accommodationDiscount = $accommodationDiscount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getBoardServiceDiscount(): ?int
|
||||
{
|
||||
return $this->boardServiceDiscount;
|
||||
}
|
||||
|
||||
public function setBoardServiceDiscount(?int $boardServiceDiscount): self
|
||||
{
|
||||
$this->boardServiceDiscount = $boardServiceDiscount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAdditionalServicesDiscount(): ?int
|
||||
{
|
||||
return $this->additionalServicesDiscount;
|
||||
}
|
||||
|
||||
public function setAdditionalServicesDiscount(?int $additionalServicesDiscount): self
|
||||
{
|
||||
$this->additionalServicesDiscount = $additionalServicesDiscount;
|
||||
$this->discount = $discount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -125,22 +125,8 @@ class AccommodationBookingType extends AbstractType
|
||||
'label' => 'Anfrage (nicht bindend)',
|
||||
'required' => false,
|
||||
])
|
||||
->add('accommodationDiscount', IntegerType::class, [
|
||||
'label' => 'Rabatt Unterkunft (%)',
|
||||
'required' => false,
|
||||
'constraints' => [
|
||||
new Range(min: 1, max: 100),
|
||||
],
|
||||
])
|
||||
->add('boardServiceDiscount', IntegerType::class, [
|
||||
'label' => 'Rabatt Verpflegung (%)',
|
||||
'required' => false,
|
||||
'constraints' => [
|
||||
new Range(min: 1, max: 100),
|
||||
],
|
||||
])
|
||||
->add('additionalServicesDiscount', IntegerType::class, [
|
||||
'label' => 'Rabatt Zusatzleistungen (%)',
|
||||
->add('discount', IntegerType::class, [
|
||||
'label' => 'Rabatt (%)',
|
||||
'required' => false,
|
||||
'constraints' => [
|
||||
new Range(min: 1, max: 100),
|
||||
|
||||
@@ -32,7 +32,7 @@ class AdminMenuBuilder extends AbstractMenuBuilder
|
||||
'routes' => [['pattern' => '/^app_admin_bookingeditdraft/']],
|
||||
],
|
||||
]);
|
||||
$menu->addChild('Gruppenbuchungen', [
|
||||
$menu->addChild('Guppenbuchungen', [
|
||||
'route' => 'app_admin_accommodationbooking',
|
||||
'linkAttributes' => [
|
||||
'title' => 'Buchungen',
|
||||
|
||||
@@ -59,13 +59,7 @@ final readonly class AccommodationBookingApiResponse
|
||||
public array $additionalServices;
|
||||
|
||||
#[Groups(['api:single'])]
|
||||
public ?int $accommodationDiscount;
|
||||
|
||||
#[Groups(['api:single'])]
|
||||
public ?int $boardServiceDiscount;
|
||||
|
||||
#[Groups(['api:single'])]
|
||||
public ?int $additionalServicesDiscount;
|
||||
public ?int $discount;
|
||||
|
||||
#[Groups(['api:single'])]
|
||||
public ?int $totalPrice;
|
||||
@@ -104,9 +98,7 @@ final readonly class AccommodationBookingApiResponse
|
||||
static fn (array $service) => new AccommodationBookingAdditionalServiceItem($service),
|
||||
$booking->getAdditionalServices(),
|
||||
);
|
||||
$this->accommodationDiscount = $booking->getAccommodationDiscount();
|
||||
$this->boardServiceDiscount = $booking->getBoardServiceDiscount();
|
||||
$this->additionalServicesDiscount = $booking->getAdditionalServicesDiscount();
|
||||
$this->discount = $booking->getDiscount();
|
||||
$this->totalPrice = $booking->getTotalPrice();
|
||||
$this->pricingCurrency = $booking->getPricingCurrency();
|
||||
$this->pricingVersion = $booking->getPricingVersion();
|
||||
|
||||
@@ -16,7 +16,7 @@ final readonly class AccommodationBookingContext
|
||||
* @param array<string, AdditionalService[]> $groupedAdditionalServices
|
||||
* @param AdditionalService[] $ungroupedAdditionalServices
|
||||
* @param array<string, mixed>|null $priceBreakdown
|
||||
* @param array<string, mixed>|null $hotelCmsData see {@see \App\Service\CmsDataProvider::getHotelDetails()} for the shape
|
||||
* @param array<string, mixed>|null $hotelCmsData
|
||||
*/
|
||||
public function __construct(
|
||||
public Accommodation $accommodation,
|
||||
|
||||
@@ -101,12 +101,9 @@ class AccommodationBookingService
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches hotel details from the CMS for display in the booking flow — name, images,
|
||||
* address, descriptive text blocks, amenity icons, and the surrounding region's info
|
||||
* (name, coordinates, webcam, ski area text, stats, images).
|
||||
* Fetches hotel name, image, and address from the CMS for display in the sidebar.
|
||||
*
|
||||
* @return array<string, mixed>|null null on CMS error or missing code, see
|
||||
* {@see CmsDataProvider::getHotelDetails()} for the shape
|
||||
* @return array<string, mixed>|null null on CMS error or missing code
|
||||
*/
|
||||
public function loadHotelCmsData(Accommodation $accommodation): ?array
|
||||
{
|
||||
@@ -323,14 +320,10 @@ class AccommodationBookingService
|
||||
return;
|
||||
}
|
||||
|
||||
$accommodationBase = (int) ($breakdown['basePrice'] ?? 0) + (int) ($breakdown['additionalPersonsPrice'] ?? 0);
|
||||
$boardBase = (int) ($breakdown['boardPrice'] ?? 0);
|
||||
$servicesBase = (int) ($breakdown['servicesPrice'] ?? 0);
|
||||
|
||||
$total = (int) ($breakdown['total'] ?? 0)
|
||||
- $this->discountAmount($accommodationBase, $booking->getAccommodationDiscount())
|
||||
- $this->discountAmount($boardBase, $booking->getBoardServiceDiscount())
|
||||
- $this->discountAmount($servicesBase, $booking->getAdditionalServicesDiscount());
|
||||
$total = (int) ($breakdown['total'] ?? 0);
|
||||
if (null !== $booking->getDiscount()) {
|
||||
$total -= (int) round($total * $booking->getDiscount() / 100);
|
||||
}
|
||||
|
||||
$booking->setPriceSnapshot(
|
||||
$breakdown,
|
||||
@@ -340,11 +333,6 @@ class AccommodationBookingService
|
||||
);
|
||||
}
|
||||
|
||||
private function discountAmount(int $base, ?int $percent): int
|
||||
{
|
||||
return null !== $percent ? (int) round($base * $percent / 100) : 0;
|
||||
}
|
||||
|
||||
public function sendNotificationEmail(AccommodationBooking $booking): void
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -202,6 +202,8 @@ class BpnXmlAnonymizer
|
||||
$title = '';
|
||||
$gender = 'D';
|
||||
$nationality = 'XX';
|
||||
$birthDate = '01.01.1980';
|
||||
|
||||
$street = sprintf('%s %s', $this->faker->streetName(), $this->faker->buildingNumber());
|
||||
$postalCode = $this->faker->postcode();
|
||||
$city = $this->faker->city();
|
||||
@@ -230,6 +232,7 @@ class BpnXmlAnonymizer
|
||||
'title' => $title,
|
||||
'gender' => $gender,
|
||||
'nationality' => $nationality,
|
||||
'birthDate' => $birthDate,
|
||||
'street' => $street,
|
||||
'postalCode' => $postalCode,
|
||||
'city' => $city,
|
||||
@@ -386,6 +389,11 @@ class BpnXmlAnonymizer
|
||||
$this->replaceNodeValue($nationalityNode, $identity['nationality']);
|
||||
}
|
||||
|
||||
$birthDateNode = $this->getDirectChild($personNode, 'geburtsdatum');
|
||||
if (null !== $birthDateNode) {
|
||||
$this->replaceNodeValue($birthDateNode, $identity['birthDate']);
|
||||
}
|
||||
|
||||
$heightNode = $this->getDirectChild($personNode, 'sonstiges1');
|
||||
if (null !== $heightNode) {
|
||||
$this->replaceNodeValue($heightNode, $identity['height']);
|
||||
|
||||
@@ -46,35 +46,7 @@ class CmsDataProvider
|
||||
return $result['images'] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{
|
||||
* success?: bool,
|
||||
* message?: string,
|
||||
* name?: string,
|
||||
* address?: string,
|
||||
* description?: string,
|
||||
* features?: string,
|
||||
* roomTypes?: string,
|
||||
* additionalInformation?: string,
|
||||
* images?: array<string, mixed>,
|
||||
* icons?: array<string, bool|string>,
|
||||
* region?: array{
|
||||
* name: string,
|
||||
* latitude: float,
|
||||
* longitude: float,
|
||||
* webcam: string,
|
||||
* ski_area: string,
|
||||
* ski_area_extended: string,
|
||||
* description: string,
|
||||
* news: string,
|
||||
* length: int,
|
||||
* altitude: int,
|
||||
* lifts: int,
|
||||
* images: array<string, mixed>,
|
||||
* region_maps: list<string>,
|
||||
* },
|
||||
* }
|
||||
*/
|
||||
/** @return array<string, mixed> */
|
||||
public function getHotelDetails(string $hotelCode): array
|
||||
{
|
||||
return $this->cache->get(
|
||||
|
||||
@@ -27,7 +27,6 @@ class AppExtension extends AbstractExtension
|
||||
new TwigFilter('map_status', [AppRuntime::class, 'mapStatus']),
|
||||
new TwigFilter('map_country', [AppRuntime::class, 'mapCountry']),
|
||||
new TwigFilter('map_nationality', [AppRuntime::class, 'mapNationality']),
|
||||
new TwigFilter('visible_cms_icons', [AppRuntime::class, 'visibleCmsIcons']),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -157,44 +157,6 @@ class AppRuntime implements RuntimeExtensionInterface
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes a CMS "icons" map (identifier => bool|string|int) into the visible entries only.
|
||||
*
|
||||
* A value either toggles visibility (bool), makes the icon visible and overrides its
|
||||
* default (humanized) label (non-empty string), or makes the icon visible with the
|
||||
* number itself as the label to display next to the icon (non-zero int, e.g. bed_count).
|
||||
*
|
||||
* @param array<string, mixed>|null $icons
|
||||
*
|
||||
* @return list<array{key: string, label: string}>
|
||||
*/
|
||||
public function visibleCmsIcons(?array $icons): array
|
||||
{
|
||||
if (null === $icons) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$result = [];
|
||||
foreach ($icons as $key => $value) {
|
||||
if (false === $value || null === $value || '' === $value || 0 === $value) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$label = match (true) {
|
||||
is_int($value) => (string) $value,
|
||||
is_string($value) => $value,
|
||||
default => ucfirst(str_replace(['_', '-'], ' ', $key)),
|
||||
};
|
||||
|
||||
$result[] = [
|
||||
'key' => $key,
|
||||
'label' => $label,
|
||||
];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a form field should be rendered as static text.
|
||||
*
|
||||
|
||||
@@ -33,9 +33,7 @@
|
||||
<div class="lg:col-span-2">
|
||||
{{ form_row(form.isInquiry) }}
|
||||
</div>
|
||||
{{ form_row(form.accommodationDiscount) }}
|
||||
{{ form_row(form.boardServiceDiscount) }}
|
||||
{{ form_row(form.additionalServicesDiscount) }}
|
||||
{{ form_row(form.discount) }}
|
||||
<div class="lg:col-span-2">
|
||||
{{ form_row(form.remarks) }}
|
||||
</div>
|
||||
|
||||
@@ -47,9 +47,7 @@
|
||||
Angenommen am {{ booking.acceptedAt | date('d.m.Y, H:i') }}
|
||||
</p>
|
||||
{% endif %}
|
||||
{{ form_row(form.accommodationDiscount) }}
|
||||
{{ form_row(form.boardServiceDiscount) }}
|
||||
{{ form_row(form.additionalServicesDiscount) }}
|
||||
{{ form_row(form.discount) }}
|
||||
<div class="lg:col-span-2">
|
||||
{{ form_row(form.remarks) }}
|
||||
</div>
|
||||
|
||||
@@ -57,17 +57,11 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% set discounts = [] %}
|
||||
{% if booking.accommodationDiscount is not null %}
|
||||
{% set discounts = discounts | merge(['Unterkunft ' ~ booking.accommodationDiscount ~ '%']) %}
|
||||
{% if booking.discount is not null %}
|
||||
{{ booking.discount }} %
|
||||
{% else %}
|
||||
–
|
||||
{% endif %}
|
||||
{% if booking.boardServiceDiscount is not null %}
|
||||
{% set discounts = discounts | merge(['Verpflegung ' ~ booking.boardServiceDiscount ~ '%']) %}
|
||||
{% endif %}
|
||||
{% if booking.additionalServicesDiscount is not null %}
|
||||
{% set discounts = discounts | merge(['Zusatzleistungen ' ~ booking.additionalServicesDiscount ~ '%']) %}
|
||||
{% endif %}
|
||||
{{ discounts | length > 0 ? (discounts | join(', ')) : '–' }}
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<twig:dropdown>
|
||||
|
||||
@@ -140,31 +140,16 @@
|
||||
</td>
|
||||
<td class="pt-2 text-right whitespace-nowrap">{{ (priceBreakdown.total / 100) | format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% if booking.accommodationDiscount is not null or booking.boardServiceDiscount is not null or booking.additionalServicesDiscount is not null %}
|
||||
{% if booking.accommodationDiscount is not null %}
|
||||
{% set accommodationDiscountAmount = ((priceBreakdown.basePrice + priceBreakdown.additionalPersonsPrice) * booking.accommodationDiscount / 100) | round %}
|
||||
<tr class="text-green-700">
|
||||
<td class="pt-1">Rabatt Unterkunft {{ booking.accommodationDiscount }} %</td>
|
||||
<td class="pt-1 text-right whitespace-nowrap">– {{ (accommodationDiscountAmount / 100) | format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if booking.boardServiceDiscount is not null %}
|
||||
{% set boardDiscountAmount = (priceBreakdown.boardPrice * booking.boardServiceDiscount / 100) | round %}
|
||||
<tr class="text-green-700">
|
||||
<td class="pt-1">Rabatt Verpflegung {{ booking.boardServiceDiscount }} %</td>
|
||||
<td class="pt-1 text-right whitespace-nowrap">– {{ (boardDiscountAmount / 100) | format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if booking.additionalServicesDiscount is not null %}
|
||||
{% set servicesDiscountAmount = (priceBreakdown.servicesPrice * booking.additionalServicesDiscount / 100) | round %}
|
||||
<tr class="text-green-700">
|
||||
<td class="pt-1">Rabatt Zusatzleistungen {{ booking.additionalServicesDiscount }} %</td>
|
||||
<td class="pt-1 text-right whitespace-nowrap">– {{ (servicesDiscountAmount / 100) | format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if booking.discount is not null %}
|
||||
{% set discountAmount = (priceBreakdown.total * booking.discount / 100) | round | number_format(0, '.', '') %}
|
||||
{% set discountedTotal = booking.totalPrice ?? (priceBreakdown.total - discountAmount) %}
|
||||
<tr class="text-green-700">
|
||||
<td class="pt-1">Rabatt {{ booking.discount }} %</td>
|
||||
<td class="pt-1 text-right whitespace-nowrap">– {{ (discountAmount / 100) | format_currency(currency) }}</td>
|
||||
</tr>
|
||||
<tr class="border-t border-gray-200 font-bold text-green-700">
|
||||
<td class="pt-2">Gesamtpreis nach Rabatt</td>
|
||||
<td class="pt-2 text-right whitespace-nowrap">{{ ((booking.totalPrice ?? priceBreakdown.total) / 100) | format_currency(currency) }}</td>
|
||||
<td class="pt-2 text-right whitespace-nowrap">{{ (discountedTotal / 100) | format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
|
||||
@@ -150,55 +150,19 @@
|
||||
{{ (ctx.priceBreakdown.total / 100)|format_currency(currency) }}
|
||||
</td>
|
||||
</tr>
|
||||
{% if booking.accommodationDiscount is not null or booking.boardServiceDiscount is not null or booking.additionalServicesDiscount is not null %}
|
||||
{% if booking.accommodationDiscount is not null %}
|
||||
{% set accommodationDiscountAmount = ((ctx.priceBreakdown.basePrice + ctx.priceBreakdown.additionalPersonsPrice) * booking.accommodationDiscount / 100) | round %}
|
||||
<tr class="text-green-700">
|
||||
<td class="p-2">Rabatt Unterkunft {{ booking.accommodationDiscount }} %</td>
|
||||
<td class="p-2 text-right whitespace-nowrap">– {{ (accommodationDiscountAmount / 100)|format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if booking.boardServiceDiscount is not null %}
|
||||
{% set boardDiscountAmount = (ctx.priceBreakdown.boardPrice * booking.boardServiceDiscount / 100) | round %}
|
||||
<tr class="text-green-700">
|
||||
<td class="p-2">Rabatt Verpflegung {{ booking.boardServiceDiscount }} %</td>
|
||||
<td class="p-2 text-right whitespace-nowrap">– {{ (boardDiscountAmount / 100)|format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if booking.additionalServicesDiscount is not null %}
|
||||
{% set servicesDiscountAmount = (ctx.priceBreakdown.servicesPrice * booking.additionalServicesDiscount / 100) | round %}
|
||||
<tr class="text-green-700">
|
||||
<td class="p-2">Rabatt Zusatzleistungen {{ booking.additionalServicesDiscount }} %</td>
|
||||
<td class="p-2 text-right whitespace-nowrap">– {{ (servicesDiscountAmount / 100)|format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if booking.discount is not null %}
|
||||
<tr class="text-green-700">
|
||||
<td class="p-2">Rabatt {{ booking.discount }} %</td>
|
||||
<td class="p-2 text-right whitespace-nowrap">– {{ (discountAmount / 100)|format_currency(currency) }}</td>
|
||||
</tr>
|
||||
<tr class="border-t border-primary-bg font-bold text-base text-green-700">
|
||||
<td class="p-2">Gesamtpreis nach Rabatt</td>
|
||||
<td class="p-2 text-right whitespace-nowrap">{{ ((booking.totalPrice ?? ctx.priceBreakdown.total) / 100)|format_currency(currency) }}</td>
|
||||
<td class="p-2 text-right whitespace-nowrap">{{ (discountedTotal / 100)|format_currency(currency) }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{# Footer: booking action / accepted-at status #}
|
||||
{% if booking.inquiry %}
|
||||
<div class="shrink-0 px-4 lg:px-8 py-4 border-t border-primary-bg">
|
||||
<button type="button"
|
||||
class="button button--primary w-full"
|
||||
hx-get="{{ path('app_groups_booking_offer_confirm', { uuid: booking.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
Angebot verbindlich buchen
|
||||
</button>
|
||||
</div>
|
||||
{% elseif booking.acceptedAt is not null %}
|
||||
<div class="shrink-0 px-4 lg:px-8 py-4 border-t border-primary-bg">
|
||||
<p class="text-gray-500">
|
||||
Angenommen am {{ booking.acceptedAt | date('d.m.Y') }} um {{ booking.acceptedAt | date('H:i') }} Uhr
|
||||
</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -6,7 +6,11 @@
|
||||
|
||||
{% block content %}
|
||||
{% set currency = booking.pricingCurrency ?? priceBreakdown.currency %}
|
||||
{% set displayTotal = booking.totalPrice ?? (priceBreakdown.total ?? null) %}
|
||||
{% if booking.discount is not null and priceBreakdown is not null %}
|
||||
{% set discountAmount = (priceBreakdown.total * booking.discount / 100) | round | number_format(0, '.', '') %}
|
||||
{% set discountedTotal = booking.totalPrice ?? (priceBreakdown.total - discountAmount) %}
|
||||
{% endif %}
|
||||
{% set displayTotal = discountedTotal ?? (priceBreakdown.total ?? null) %}
|
||||
|
||||
<div class="flex-1 flex flex-col lg:grid lg:grid-cols-5 min-h-0 relative">
|
||||
|
||||
@@ -19,6 +23,8 @@
|
||||
ctx: ctx,
|
||||
currency: currency,
|
||||
displayTotal: displayTotal,
|
||||
discountAmount: discountAmount ?? null,
|
||||
discountedTotal: discountedTotal ?? null,
|
||||
} %}
|
||||
</div>
|
||||
|
||||
@@ -88,89 +94,9 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% set visibleIcons = (ctx.hotelCmsData.icons ?? null) | visible_cms_icons %}
|
||||
{% if visibleIcons is not empty %}
|
||||
<ul class="grid grid-cols-2 md:grid-cols-3 gap-2 mt-6 text-sm text-gray-600">
|
||||
{% for item in visibleIcons %}
|
||||
<li class="flex items-center gap-2">
|
||||
{{ icon(item.key, 'w-5 h-5 shrink-0') }}
|
||||
{{ item.label }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if ctx.hotelCmsData is not null and ctx.hotelCmsData.region is defined %}
|
||||
{% set region = ctx.hotelCmsData.region %}
|
||||
<div class="rte-content mt-8">
|
||||
<h2>Die Region {{ region.name }}</h2>
|
||||
{% if region.altitude or region.length or region.lifts %}
|
||||
<ul class="flex flex-wrap gap-x-6 text-sm not-prose">
|
||||
{% if region.altitude %}
|
||||
<li>{{ region.altitude }} m Höhe</li>
|
||||
{% endif %}
|
||||
{% if region.length %}
|
||||
<li>{{ region.length }} km Pisten</li>
|
||||
{% endif %}
|
||||
{% if region.lifts %}
|
||||
<li>{{ region.lifts }} Lifte</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% if region.webcam %}
|
||||
<p>
|
||||
<a href="{{ region.webcam }}" target="_blank" rel="noopener">Webcam der Region</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
{{ region.description | default('') | raw }}
|
||||
<h2>Skigebiet</h2>
|
||||
{{ region.ski_area | default('') | raw }}
|
||||
{{ region.ski_area_extended | default('') | raw }}
|
||||
{% if region.news %}
|
||||
<h2>Aktuelles aus der Region</h2>
|
||||
{{ region.news | raw }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if region.region_maps is defined and region.region_maps | length > 0 %}
|
||||
<div class="grid md:grid-cols-2 gap-8 mt-6" {{ stimulus_controller('gallery') }}>
|
||||
{% for mapUrl in region.region_maps %}
|
||||
<div class="relative block w-full h-auto cursor-pointer{{ loop.index0 >= 2 ? ' hidden' : '' }}"
|
||||
data-gallery-target="item"
|
||||
data-gallery-href="{{ mapUrl }}"
|
||||
data-gallery-alt="{{ region.name }}">
|
||||
<img src="{{ mapUrl }}" alt="{{ region.name }}" class="block w-full h-auto">
|
||||
{% if loop.index0 == 1 and region.region_maps | length > 2 %}
|
||||
<div class="absolute inset-0 bg-black/50 flex items-center justify-center text-white font-bold text-lg">
|
||||
+{{ region.region_maps | length - 2 }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% set regionLargeImages = region.images.resized.l ?? [] %}
|
||||
{% set regionMediumImages = region.images.resized.m ?? [] %}
|
||||
{% if regionLargeImages | length > 0 %}
|
||||
<div class="grid md:grid-cols-2 gap-8 mt-6" {{ stimulus_controller('gallery') }}>
|
||||
{% for image in regionLargeImages %}
|
||||
<div class="relative block w-full h-auto cursor-pointer{{ loop.index0 >= 2 ? ' hidden' : '' }}"
|
||||
data-gallery-target="item"
|
||||
data-gallery-href="{{ image.url }}"
|
||||
data-gallery-alt="{{ image.alt ?? region.name }}">
|
||||
<img src="{{ regionMediumImages[loop.index0].url ?? image.url }}"
|
||||
alt="{{ image.alt ?? region.name }}"
|
||||
class="block w-full h-auto">
|
||||
{% if loop.index0 == 1 and regionLargeImages | length > 2 %}
|
||||
<div class="absolute inset-0 bg-black/50 flex items-center justify-center text-white font-bold text-lg">
|
||||
+{{ regionLargeImages | length - 2 }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{# TODO: additional hotel and location information fetched from the CMS #}
|
||||
|
||||
{% if booking.remarks %}
|
||||
<div class="mb-8">
|
||||
@@ -178,6 +104,24 @@
|
||||
<p class="text-sm">{{ booking.remarks | nl2br }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if booking.inquiry %}
|
||||
<div>
|
||||
<button type="button"
|
||||
class="button button--primary"
|
||||
hx-get="{{ path('app_groups_booking_offer_confirm', { uuid: booking.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
Angebot verbindlich buchen
|
||||
</button>
|
||||
</div>
|
||||
{% else %}
|
||||
{% if booking.acceptedAt is not null %}
|
||||
<p class="text-sm text-gray-500">
|
||||
Angenommen am {{ booking.acceptedAt | date('d.m.Y') }} um {{ booking.acceptedAt | date('H:i') }} Uhr
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -51,9 +51,7 @@ class AccommodationBookingControllerTest extends TestCase
|
||||
$booking->setBoardServiceLabel('Halbpension');
|
||||
$booking->setBoardServicePrice(1500);
|
||||
$booking->addAdditionalServiceSnapshot('Bettwäsche', 500, 'flat', 3);
|
||||
$booking->setAccommodationDiscount(10);
|
||||
$booking->setBoardServiceDiscount(20);
|
||||
$booking->setAdditionalServicesDiscount(30);
|
||||
$booking->setDiscount(10);
|
||||
$booking->setIsInquiry(false);
|
||||
$booking->setAcceptedAt(new \DateTimeImmutable('2026-07-15T10:00:00+00:00'));
|
||||
|
||||
@@ -119,9 +117,7 @@ class AccommodationBookingControllerTest extends TestCase
|
||||
'type' => 'flat',
|
||||
],
|
||||
],
|
||||
'accommodationDiscount' => 10,
|
||||
'boardServiceDiscount' => 20,
|
||||
'additionalServicesDiscount' => 30,
|
||||
'discount' => 10,
|
||||
'totalPrice' => 11111,
|
||||
'pricingCurrency' => 'EUR',
|
||||
'pricingVersion' => 1,
|
||||
|
||||
@@ -237,32 +237,20 @@ class AccommodationBookingServiceTest extends TestCase
|
||||
public function testRefreshPriceSnapshotStoresDiscountedFinalTotal(): void
|
||||
{
|
||||
$booking = new AccommodationBooking();
|
||||
$booking->setAccommodationDiscount(10);
|
||||
$booking->setBoardServiceDiscount(20);
|
||||
$booking->setAdditionalServicesDiscount(50);
|
||||
|
||||
$breakdown = [
|
||||
'total' => 12345,
|
||||
'currency' => 'CHF',
|
||||
'basePrice' => 8000,
|
||||
'additionalPersonsPrice' => 2000,
|
||||
'boardPrice' => 1000,
|
||||
'servicesPrice' => 500,
|
||||
];
|
||||
$booking->setDiscount(10);
|
||||
|
||||
$breakdownCalculator = $this->createMock(AccommodationBookingBreakdownCalculator::class);
|
||||
$breakdownCalculator
|
||||
->expects(self::once())
|
||||
->method('computeCurrent')
|
||||
->with($booking)
|
||||
->willReturn($breakdown);
|
||||
->willReturn(['total' => 12345, 'currency' => 'CHF']);
|
||||
|
||||
$service = $this->createServiceWithAccommodation(breakdownCalculator: $breakdownCalculator);
|
||||
$service->refreshPriceSnapshot($booking);
|
||||
|
||||
// accommodation: (8000+2000)*10% = 1000, board: 1000*20% = 200, services: 500*50% = 250
|
||||
self::assertSame($breakdown, $booking->getPriceBreakdown());
|
||||
self::assertSame(12345 - 1000 - 200 - 250, $booking->getTotalPrice());
|
||||
self::assertSame(['total' => 12345, 'currency' => 'CHF'], $booking->getPriceBreakdown());
|
||||
self::assertSame(11110, $booking->getTotalPrice());
|
||||
self::assertSame('CHF', $booking->getPricingCurrency());
|
||||
self::assertSame(1, $booking->getPricingVersion());
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ class BpnXmlAnonymizerTest extends TestCase
|
||||
<anmelder>
|
||||
<name>Example</name>
|
||||
<vorname>Ava</vorname>
|
||||
<geburtsdatum>03.04.1991</geburtsdatum>
|
||||
<anschrift>
|
||||
<strasse>Testallee 7</strasse>
|
||||
<plz>10115</plz>
|
||||
@@ -33,7 +32,6 @@ class BpnXmlAnonymizerTest extends TestCase
|
||||
<teilnehmer id="1">
|
||||
<name>Example</name>
|
||||
<vorname>Ava</vorname>
|
||||
<geburtsdatum>03.04.1991</geburtsdatum>
|
||||
<anschrift>
|
||||
<strasse>Testallee 7</strasse>
|
||||
<plz>10115</plz>
|
||||
@@ -48,7 +46,6 @@ class BpnXmlAnonymizerTest extends TestCase
|
||||
<teilnehmer id="2">
|
||||
<name>Second</name>
|
||||
<vorname>Ben</vorname>
|
||||
<geburtsdatum>12.11.1987</geburtsdatum>
|
||||
<kommunikation>
|
||||
<email>[email protected]</email>
|
||||
</kommunikation>
|
||||
@@ -72,9 +69,6 @@ XML;
|
||||
$applicantMobilePhone = trim((string) $xpath->evaluate('string(//anmelder/kommunikation/telefonmobil)'));
|
||||
$participantOneMobilePhone = trim((string) $xpath->evaluate('string(//teilnehmer[1]/kommunikation/telefonmobil)'));
|
||||
$participantTwoName = trim((string) $xpath->evaluate('string(//teilnehmer[2]/name)'));
|
||||
$applicantBirthDate = trim((string) $xpath->evaluate('string(//anmelder/geburtsdatum)'));
|
||||
$participantOneBirthDate = trim((string) $xpath->evaluate('string(//teilnehmer[1]/geburtsdatum)'));
|
||||
$participantTwoBirthDate = trim((string) $xpath->evaluate('string(//teilnehmer[2]/geburtsdatum)'));
|
||||
|
||||
$this->assertNotSame('Example', $applicantName);
|
||||
$this->assertSame($applicantName, $participantOneName);
|
||||
@@ -82,9 +76,6 @@ XML;
|
||||
$this->assertSame('01000000002', $participantOneMobilePhone);
|
||||
$this->assertSame($applicantMobilePhone, $participantOneMobilePhone);
|
||||
$this->assertNotSame($participantOneName, $participantTwoName);
|
||||
$this->assertSame('03.04.1991', $applicantBirthDate);
|
||||
$this->assertSame('03.04.1991', $participantOneBirthDate);
|
||||
$this->assertSame('12.11.1987', $participantTwoBirthDate);
|
||||
$this->assertSame(3, $anonymizer->getLastIdentityCount());
|
||||
}
|
||||
|
||||
@@ -190,7 +181,7 @@ XML;
|
||||
$this->assertSame('Divers', $responseSalutation);
|
||||
$this->assertSame('', $responseTitle);
|
||||
$this->assertSame('D', $responseGender);
|
||||
$this->assertSame('16.04.1972', $responseBirthDate);
|
||||
$this->assertSame('01.01.1980', $responseBirthDate);
|
||||
$this->assertSame('XX', $responseNationality);
|
||||
$this->assertNotSame('Beispielweg 57', $responseStreet);
|
||||
$this->assertNotSame('42853', $responsePostalCode);
|
||||
@@ -510,7 +501,7 @@ XML;
|
||||
$this->assertSame('Divers', $salutation);
|
||||
$this->assertSame('', $title);
|
||||
$this->assertSame('D', $gender);
|
||||
$this->assertSame('01.02.1990', $birthDate);
|
||||
$this->assertSame('01.01.1980', $birthDate);
|
||||
$this->assertSame('XX', $nationality);
|
||||
$this->assertNotSame('Beispielweg 12', $street);
|
||||
$this->assertNotSame('12345', $postalCode);
|
||||
|
||||
Reference in new issue
Block a user