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
+
+ |
+ }}) |
+
+
+
+
+ | |
+
+ | Verkäufer |
+ Your SwissCar GmbH |
+ Käufer |
+ {{ $contract->contact->full_title }} |
+
+
+ | Strasse |
+ Bernstrasse 27 |
+ Strasse |
+ {{ $contract->contact->address }} |
+
+
+ | PLZ / Ort |
+ 8952 Schlieren |
+ PLZ / Ort |
+ {{ $contract->contact->full_city }} |
+
+
+ | Telefon |
+ 079 680 34 44 |
+ Telefon |
+ {{ $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 IBAN |
+ CH69 0900 0000 1549 3981 7 |
+
+
+ | Lieferdatum |
+ {{ $contract->date_formatted }} |
+
+
+ | Bemerkung |
+ |
+
+ | |
+ | |
+
+
+
+ | |
+
+ | Ort, Datum |
+ Schlieren, |
+ |
+
+ | |
+
+ | Verkäufer: |
+ |
+ Käufer: |
+
+
+
+
+
+ | Quittung |
+ Den Betrag von |
+ |
+ in bar erhalten |
+
+ | |
+ | |
+
+ | Datum: |
+ {{ $contract->date_formatted }} |
+
+
+
\ No newline at end of file