Stornoregeln mit automatischer Kostenberechnung, Storno-Verwaltung, Vertragsanlagen
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m34s

- Stornoregel (Stufen nach Tagen vor Anreise, Mietpreis oder Gesamtpreis, Ersatzmieter-Gebuehr), je Vertragsvorlage,
  beim Angebot eingefroren, als Platzhalter im Vertrag
- Stornierung (Gast-Link oder Verwaltung) berechnet die Kosten, legt einen Stornofall an; Verwaltung Stornierungen
  mit Vorschlag, Festlegung, Saldo, Abrechnung und Erlass; Gast sieht die Kosten vorab auf der Storno-Seite
- Vertragsanlagen als eigene versionierte Dokumente mit Bedingung (immer, Zusatzleistung, Portal, von Hand),
  je Angebot ausgewaehlt und eingefroren; Zusatzleistungen in der Buchung erfassbar
- FeWo-direkt-Installation legt die Stornoregel aus Paragraf 13 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:32:48 +01:00
1 parent 5baf39441f
commit 0c4187edaf
37 files changed
+1440 -10

No files matched your search

@@ -0,0 +1,63 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Cancellation rules (stepped percentages of the rent or the total price), their use in contract templates
* and the record of every cancellation with the calculated costs. Additive.
*/
public function up(): void
{
Schema::create('cancellation_policies', function (Blueprint $table) {
$table->id();
$table->foreignId('tenant_id')->constrained()->cascadeOnDelete();
$table->string('name');
$table->string('base', 10)->default('rent');
$table->json('tiers');
$table->unsignedInteger('replacement_fee')->nullable();
$table->text('notes')->nullable();
$table->timestamps();
});
Schema::table('contract_templates', function (Blueprint $table) {
$table->foreignId('cancellation_policy_id')->nullable()->after('annex_body')->constrained('cancellation_policies')->nullOnDelete();
});
Schema::create('cancellations', function (Blueprint $table) {
$table->id();
$table->foreignId('tenant_id')->constrained()->cascadeOnDelete();
$table->foreignId('booking_id')->constrained()->cascadeOnDelete();
$table->date('cancelled_on');
$table->string('initiated_by', 12)->default('landlord');
$table->boolean('has_policy')->default(false);
$table->string('policy_name')->nullable();
$table->unsignedSmallInteger('days_before')->nullable();
$table->unsignedSmallInteger('percent')->nullable();
$table->integer('base_amount')->nullable();
$table->integer('calculated_fee')->nullable();
$table->integer('final_fee')->nullable();
$table->integer('paid_amount')->default(0);
$table->string('status', 12)->default('open');
$table->text('note')->nullable();
$table->timestamp('settled_at')->nullable();
$table->timestamps();
$table->unique('booking_id');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('cancellations');
Schema::table('contract_templates', function (Blueprint $table) {
$table->dropConstrainedForeignId('cancellation_policy_id');
});
Schema::dropIfExists('cancellation_policies');
}
};
@@ -0,0 +1,44 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Contract annexes as documents of their own (versioned), attached to templates with a condition
* (always, when an extra service is booked, for a portal, only by hand). Additive.
*/
public function up(): void
{
Schema::create('contract_annexes', function (Blueprint $table) {
$table->id();
$table->foreignId('tenant_id')->constrained()->cascadeOnDelete();
$table->string('name');
$table->unsignedInteger('version')->default(1);
$table->string('title');
$table->longText('body');
$table->string('condition_type', 12)->default('always');
$table->unsignedBigInteger('condition_id')->nullable();
$table->text('notes')->nullable();
$table->timestamps();
$table->unique(['tenant_id', 'name', 'version']);
});
Schema::table('contract_templates', function (Blueprint $table) {
$table->json('annex_ids')->nullable()->after('cancellation_policy_id');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('contract_templates', function (Blueprint $table) {
$table->dropColumn('annex_ids');
});
Schema::dropIfExists('contract_annexes');
}
};