diff --git a/app/Http/Controllers/ContractController.php b/app/Http/Controllers/ContractController.php index 65bc5ad..e7c7980 100644 --- a/app/Http/Controllers/ContractController.php +++ b/app/Http/Controllers/ContractController.php @@ -226,7 +226,7 @@ class ContractController extends Controller public function print(Contract $contract) { - return []; + return view('contract', ['contract' => $contract]); } public function destroy(Contract $contract) diff --git a/app/Models/Contract.php b/app/Models/Contract.php index b5e4a8b..ece195c 100644 --- a/app/Models/Contract.php +++ b/app/Models/Contract.php @@ -5,6 +5,7 @@ namespace App\Models; use Carbon\Carbon; use Cknow\Money\Money; use App\Enums\ContractType; +use App\Enums\InsuranceType; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\Factories\HasFactory; @@ -32,6 +33,24 @@ class Contract extends Model return Money::CHF($price); } + public function getInsuranceTypeFormattedAttribute() + { + switch ($this->insurance_type) { + case InsuranceType::QBase: + return 'Q Basis'; + case InsuranceType::OneStar: + return '1 Stern'; + case InsuranceType::ThreeStar: + return '3 Stern'; + case InsuranceType::FiveStar: + return '5 Stern'; + case InsuranceType::FiveStarPlus: + return '5 Stern+'; + default: + return 'Nein'; + } + } + public function getDeletedAtAttribute($deleted_at) { if ($deleted_at) { diff --git a/public/images/logo.png b/public/images/logo.png new file mode 100644 index 0000000..8953bc3 Binary files /dev/null and b/public/images/logo.png differ diff --git a/resources/views/contract.blade.php b/resources/views/contract.blade.php new file mode 100644 index 0000000..915c991 --- /dev/null +++ b/resources/views/contract.blade.php @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + +
+

Your SwissCar GmbH

+
+Bernstrasse 27
+8952 Schlieren
+
+Tel: 079 680 34 44
+E-Mail: info@yourswisscar.com
+
+MwSt-Nr: CHE-226.272.050
+                
+
+ + + + +

Autokaufvertag

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
VerkäuferYour SwissCar GmbHKäufer{{ $contract->contact->full_title }}
StrasseBernstrasse 27Strasse{{ $contract->contact->address }}
PLZ / Ort8952 SchlierenPLZ / Ort{{ $contract->contact->full_city }}
Telefon079 680 34 44Telefon{{ $contract->contact->phone }}
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Fahrzeug

Marke & Modell{{ $contract->car->name }}
Chassisnummer{{ $contract->car->vin }}
Farbe{{ $contract->car->colour }}Inverkehrssetzung{{ $contract->car->initial_date_formatted }}
Stammnummer{{ $contract->car->stammnummer }}Letzte Prüfung{{ $contract->car->last_check_date_formatted }}
Kilometerstand{{ $contract->car->kilometers }}Garantie{{ $contract->insurance_type_formatted }}
 
Verkaufspreis{{ $contract->price }}
Anzahlung
Restbetrag
Bankverbindung IBANCH69 0900 0000 1549 3981 7
Lieferdatum{{ $contract->date_formatted }}
Bemerkung
 
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Serviceheft + alle Dokumente sind vorhanden. Mit Kratze Lackschaden.
Mit der Anzahlung/Teilzahlung des Kaufpreises durch den Käufer anerkennt
er den gesamten Kaufpreis gekauft wie gesehen und probiert.
Ohne Gewährleistung
Garantie für Occasionen entfallen die gesetzlichen Gewährleistungsansprüche,
eine gänzliche oder teilweise Rückerstattung des Kaufpreises
(Wandelung und Minderung) sind ausgeschlossen, ebenso der Ersatz eines aus der
mangelhaften Lieferung irgendwie entstandenen Schadens.
Gerichtsstand: Für die Beurteilung aller aus dieser Rechnung entstehenden
Streitigkeiten gilt das Domizil der Verkaufsfirma.
Eigentumsvorbehalt: Das Fahrzeug bleibt bis zur vollständigen
Bezahlung des Kaufpreises unser Eigentum.
+ + + + + + + + + + + + + +
 
Ort, DatumSchlieren,
 
Verkäufer:Käufer:
+



+ + + + + + + + + + + + + + + \ No newline at end of file
QuittungDen Betrag vonin bar erhalten
 
 
Datum: {{ $contract->date_formatted }}