Phase 3: Zahlungen, Mietvertrag, Erinnerungen, Anreiseinformationen

- Zahlungen erfassen (inkl. Erstattungen), Status automatisch: Bestätigt → Anzahlung erhalten → Bezahlt → Abgeschlossen
- Anzahlungsfrist bei Bestätigung; kurzfristige Buchungen: Gesamtbetrag sofort
- Mietvertrag als PDF (dompdf, Font-Subsetting), bei Bestätigung gespeichert und angehängt; Texte im Admin (Muster)
- Täglich: Zahlungserinnerungen (Anzahlung/Rest überfällig, Kopie an Vermieter), Zahlungsaufforderung Rest 7 Tage vorher, Anreiseinfos 7 Tage vorher, Abschluss nach Abreise
- Admin: Zahlungen je Buchung, offene Beträge, Vertrag herunterladen/neu erzeugen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lars StommerandClaude Opus 5.5 committed 2026-10-22 13:29:41 +02:00
1 parent e5f9e0762f
commit 0bf302fcf9
29 files changed
+1248 -18

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
<?php
namespace App\Documents;
use App\Models\Booking;
use Barryvdh\DomPDF\Facade\Pdf;
use Illuminate\Support\Facades\Storage;
/**
* The rental contract as PDF. It is generated once at confirmation and stored, so later changes
* of texts or prices do not alter a contract the guest already received.
*/
class RentalContract
{
private const DISK = 'local';
public function generate(Booking $booking): string
{
$booking->loadMissing(['guest', 'property']);
$path = "contracts/Mietvertrag-{$booking->reference}.pdf";
Storage::disk(self::DISK)->put($path, Pdf::loadView('pdf.contract', ['booking' => $booking])->setPaper('a4')->output());
$booking->update(['contract_path' => $path]);
return $path;
}
public function absolutePath(Booking $booking): ?string
{
return $booking->contract_path && Storage::disk(self::DISK)->exists($booking->contract_path)
? Storage::disk(self::DISK)->path($booking->contract_path)
: null;
}
}