Vertragsvorlagen als ganzes Dokument mit Platzhaltern, Wohnungsdaten, Portal-Zuordnung
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m38s

- Vorlage = kompletter Vertragstext plus Anlage mit Platzhaltern ({{ mieter }}, {{ anreise }}, {{ wohnung.x }}),
  eigene Vertrags-PDF, Anzeige auf der Angebotsseite; Text und Wohnungsdaten werden beim Angebot eingefroren
- Wohnungsdaten (WLAN, Codes, ...) als Vertragsdaten der Wohnung statt im Vorlagentext
- Je Portal eigene Vorlage fuer Anfragen und fuer beim Portal verbindliche Buchungen; direkte Bestaetigung
  nutzt dieselbe Aufloesung; Bestaetigungsmail ohne Zahlungsanweisung bei Portalzahlung
- Befehl contracts:install-fewo-direkt legt die FeWo-direkt-Vorlage aus dem Vertragstext des Vermieters an

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-10-30 16:04:30 +01:00
1 parent a73b164ea1
commit 89d569b6c8
17 files changed
+648 -28

No files matched your search

+1 -16
View File
@@ -12,7 +12,6 @@
use App\Filament\Resources\Bookings\BookingResource;
use App\Mail\OfferMade;
use App\Models\Booking;
use App\Models\ContractTemplate;
use App\Pricing\PriceCalculator;
use App\Pricing\PriceQuote;
use App\Pricing\QuoteException;
@@ -98,7 +97,7 @@ public function handle(Booking $booking, array $changes = [], bool $sendMail = t
'offer_version' => $booking->offer_version + 1,
'offer_sent_at' => now(),
'offer_message' => $changes['offer_message'] ?? null,
'offer_terms' => OfferTerms::capture($this->templateFor($booking, $changes)),
'offer_terms' => OfferTerms::capture(OfferTerms::templateFor($booking, $changes['contract_template_id'] ?? null), $booking),
]);
$booking->refresh();
$booking->update(['offer_hash' => OfferTerms::hash($booking)]);
@@ -114,20 +113,6 @@ public function handle(Booking $booking, array $changes = [], bool $sendMail = t
return $booking;
}
/**
* The contract template of this offer: chosen explicitly, else the portal's default, else the property's.
*
* @param array<string, mixed> $changes
*/
private function templateFor(Booking $booking, array $changes): ?ContractTemplate
{
$id = filled($changes['contract_template_id'] ?? null)
? (int) $changes['contract_template_id']
: ($booking->importChannel ?? $booking->originChannel)?->contract_template_id ?? $booking->property->contract_template_id;
return $id ? ContractTemplate::query()->find($id) : null;
}
/**
* Sends the offer mail. The offer is already saved (and its validity runs), so a failing mail server is
* recorded in the admin inbox and reported to the caller instead of being lost.