@extends('layouts.app', ['title' => 'SRM | ' . $supplier->name]) @section('content') {{-- ── Neuer Kontakt ──────────────────────────────────────────────── --}} {{-- ── Kontakt bearbeiten ─────────────────────────────────────────── --}} {{-- ── Kontakt löschen ───────────────────────────────────────────── --}} {{-- ── Neuer Standort ─────────────────────────────────────────────── --}} {{-- ── Standort bearbeiten ────────────────────────────────────────── --}} {{-- ── Standort löschen ──────────────────────────────────────────── --}} {{-- ── Main Content ───────────────────────────────────────────────── --}}
{{-- Alert --}} @if (session('msg')) @endif {{-- Header --}}
Zurück

{{ $supplier->name }}

@if($supplier->supplier_code) Datev: {{ $supplier->supplier_code }} @endif
{{-- ── Left Column ── --}}
{{-- Stammdaten --}}
Stammdaten
@if($supplier->address)
Anschrift {{ $supplier->address }}
@endif @if($supplier->tel)
Tel {{ $supplier->tel }}
@endif @if($supplier->mobile)
Mobil {{ $supplier->mobile }}
@endif @if($supplier->fax)
Fax {{ $supplier->fax }}
@endif @if($supplier->email) @endif @if($supplier->website) @endif
{{-- Standorte --}}
Standorte / Niederlassungen
@if (Auth::user()->get_employee->is_mgt or Auth::user()->get_employee->is_srm) @endif
@if($supplier->branches->isEmpty())

Keine Standorte eingetragen.

@else
@foreach ($supplier->branches as $item)
{{ $item->name ?: '—' }}
@if (Auth::user()->get_employee->is_mgt or Auth::user()->get_employee->is_srm)
@endif

@if($item->address)
{{ $item->address }}
@endif @if($item->tel)
{{ $item->tel }}
@endif @if($item->mobile)
{{ $item->mobile }}
@endif @if($item->fax)
{{ $item->fax }}
@endif @if($item->email)
{{ $item->email }}
@endif @if($item->website)
{{ $item->website }}
@endif
@endforeach
@endif
{{-- Kontaktpersonen --}}
Kontaktpersonen
@if (Auth::user()->get_employee->is_mgt or Auth::user()->get_employee->is_srm) @endif
@if($supplier->get_employees->isEmpty())

Keine Kontaktpersonen eingetragen.

@else
@foreach ($supplier->get_employees as $emp)
{{ $emp->gender == '1' ? 'Herr ' : ($emp->gender == '2' ? 'Frau ' : '') }}{{ $emp->name }}
@if (Auth::user()->get_employee->is_mgt or Auth::user()->get_employee->is_srm)
@endif

@if($emp->tel)
{{ $emp->tel }}
@endif @if($emp->mobile)
{{ $emp->mobile }}
@endif @if($emp->email)
{{ $emp->email }}
@endif @if($emp->address)
{{ $emp->address }}
@endif @if($emp->note)
{{ $emp->note }}
@endif
@endforeach
@endif
{{-- ── Right Column (MGT/SRM only) ── --}} @if (Auth::user()->get_employee->is_mgt or Auth::user()->get_employee->is_srm)
Verlauf / Hinweise
{{-- Neuer Eintrag --}}
@csrf {{-- Typ-Auswahl --}}
@foreach([ ['4','notes','bi-info-square-fill','Info','text-info'], ['0','call','bi-telephone-fill','Anruf','text-success'], ['1','mail','bi-envelope-fill','E-Mail','text-primary'], ['2','poste','bi-mailbox2','Post','text-secondary'], ['3','personally','bi-people-fill','Persönlich','text-warning'], ] as [$val,$rid,$ico,$lbl,$col]) @endforeach
{{-- Kontakt mit --}}

{{-- Filter --}}
Filter: @foreach([ ['0','all','bi-list-ul','Alle'], ['1','fnotes','bi-info-square-fill','Info'], ['2','fcall','bi-telephone-fill','Anruf'], ['3','fmail','bi-envelope-fill','E-Mail'], ['4','fposte','bi-mailbox2','Post'], ['5','fpersonally','bi-people-fill','Person'], ] as [$val,$fid,$ico,$lbl]) @endforeach
{{-- Einträge --}} @forelse($supplier->contact_history->sortByDesc('created_at') as $tt) @php $isNote = $tt->is_note && !$tt->is_call && !$tt->is_email && !$tt->is_post && !$tt->is_personally; $isCall = (bool)$tt->is_call; $isEmail = (bool)$tt->is_email; $isPost = (bool)$tt->is_post; $isPersonally = (bool)$tt->is_personally; if ($isNote) { $tlIcon = 'bi-info-square-fill'; $tlColor = '#0dcaf0'; } elseif ($isCall) { $tlIcon = 'bi-telephone-fill'; $tlColor = '#198754'; } elseif ($isEmail) { $tlIcon = 'bi-envelope-fill'; $tlColor = '#0d6efd'; } elseif ($isPost) { $tlIcon = 'bi-mailbox2'; $tlColor = '#6c757d'; } else { $tlIcon = 'bi-people-fill'; $tlColor = '#ffc107'; } @endphp @if(request('d_tag') == $tt->id)
@endif
@if(!$isNote && $tt->contact_with) {{ $tt->contact_with }} @endif {{ $tt->created_at ? \Carbon\Carbon::parse($tt->created_at)->format('d.m.Y - H:i') : '—' }}
{!! $tt->note !!}
{{ $tt->employee->first_name }} {{ $tt->employee->last_name }}
@empty
Noch keine Einträge.
@endforelse
@endif
@endsection