Pakete 8, 5 und 6: Beträge und Zahlungen, Ändern und Stornieren, A6 im Vorgang
Deploy FeWo mit PipelineManager / deploy (push) Successful in 4m44s
Deploy FeWo mit PipelineManager / deploy (push) Successful in 4m44s
- Paket 8: Zahlungsarten (Gast an uns, laut Portal, Auszahlung, Erstattung), Portalbeträge als Angaben mit Quelle, Übersicht nach Zuständigkeit (R09). - Paket 5: Ändern mit Folgenvorschau, vereinbart oder dem Gast vorgeschlagen (signierter Link), ein Stornoweg mit Grund und Erstattung, Portalstorno erst nach Bestätigung. - Paket 6: eigene Nutzung, Besuch und Sperre als Vorgang mit Kurabgabe und Aufenthaltsbestätigung; Bestandsübernahme der Sperren mit identischem Export. - Wirksame Einstellungen (Expertenansicht), Abnahmekatalog T01–T14, Ergebnis-, Abnahme- und Konfigurationsdokument. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
33f8f899d6
commit
3bcfc09417
77 files changed
+3638
-122
No files matched your search
@@ -3,11 +3,12 @@
|
||||
namespace App\Filament\Resources\Bookings\Pages;
|
||||
|
||||
use App\Actions\ConfirmBooking;
|
||||
use App\Actions\CreateInternalCase;
|
||||
use App\Actions\CreateReservation;
|
||||
use App\Actions\SendBookingDocuments;
|
||||
use App\Actions\TakeOverExternalBooking;
|
||||
use App\Enums\InternalKind;
|
||||
use App\Exceptions\ReservationException;
|
||||
use App\Filament\Resources\BlockedPeriods\BlockedPeriodResource;
|
||||
use App\Filament\Resources\Bookings\BookingResource;
|
||||
use App\Filament\Resources\Bookings\Schemas\BookingForm;
|
||||
use App\Models\Booking;
|
||||
@@ -37,9 +38,8 @@ class CreateBooking extends CreateRecord
|
||||
*/
|
||||
protected function handleRecordCreation(array $data): Model
|
||||
{
|
||||
if (($data['kind'] ?? null) === BookingForm::OWN_USE) {
|
||||
$this->redirect(BlockedPeriodResource::getUrl());
|
||||
$this->halt();
|
||||
if (in_array($data['kind'] ?? null, [BookingForm::OWN_USE, BookingForm::BLOCK], true)) {
|
||||
return $this->createInternal($data);
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -88,6 +88,58 @@ protected function handleRecordCreation(array $data): Model
|
||||
return $booking;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pre-filled from the calendar or the block list (?kind=block&von=…&bis=…&wohnung=…).
|
||||
*/
|
||||
protected function afterFill(): void
|
||||
{
|
||||
$kind = request()->query('kind');
|
||||
if (in_array($kind, [BookingForm::INQUIRY, BookingForm::EXTERNAL, BookingForm::OWN_USE, BookingForm::BLOCK], true)) {
|
||||
$this->data['kind'] = $kind;
|
||||
}
|
||||
foreach (['von' => 'arrival', 'bis' => 'departure'] as $parameter => $field) {
|
||||
$value = request()->query($parameter);
|
||||
if (is_string($value) && preg_match('/^\d{4}-\d{2}-\d{2}$/', $value) === 1) {
|
||||
$this->data[$field] = $value;
|
||||
}
|
||||
}
|
||||
if (is_numeric(request()->query('wohnung')) && Property::query()->whereKey((int) request()->query('wohnung'))->exists()) {
|
||||
$this->data['property_id'] = (int) request()->query('wohnung');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Own use, a private stay or a block as a case (A6).
|
||||
*
|
||||
* @param array<string, mixed> $data
|
||||
*/
|
||||
private function createInternal(array $data): Model
|
||||
{
|
||||
$kind = $data['kind'] === BookingForm::BLOCK ? InternalKind::Block : InternalKind::from((string) ($data['internal_kind'] ?? InternalKind::OwnUse->value));
|
||||
$extras = [];
|
||||
foreach ((array) ($data['items'] ?? []) as $item) {
|
||||
if (filled($item['extra_id'] ?? null)) {
|
||||
$extras[(int) $item['extra_id']] = ((int) ($extras[(int) $item['extra_id']] ?? 0)) + max(1, (int) ($item['quantity'] ?? 1));
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
return app(CreateInternalCase::class)->handle(Property::query()->findOrFail($data['property_id']), $kind, CarbonImmutable::parse($data['arrival']), CarbonImmutable::parse($data['departure']), [
|
||||
'occasion' => $data['occasion'] ?? null,
|
||||
'guest' => ['first_name' => $data['stay_first_name'] ?? null, 'last_name' => $data['stay_last_name'] ?? null, 'email' => $data['stay_email'] ?? null, 'phone' => $data['stay_phone'] ?? null],
|
||||
'guests' => $data['guests'] ?? null,
|
||||
'extras' => $extras,
|
||||
'rent' => (int) ($data['rent'] ?? 0),
|
||||
'tourist_tax_persons' => filled($data['tourist_tax_persons'] ?? null) ? (int) $data['tourist_tax_persons'] : null,
|
||||
'tourist_tax_note' => $data['tourist_tax_note'] ?? null,
|
||||
'notes' => $data['internal_notes'] ?? null,
|
||||
]);
|
||||
} catch (QuoteException|ReservationException $exception) {
|
||||
Notification::make()->title('Nicht möglich')->body($exception->getMessage())->danger()->send();
|
||||
$this->halt();
|
||||
}
|
||||
}
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
/** @var Booking $record */
|
||||
|
||||
Reference in new issue
Block a user