@extends('layouts.app', ['title' => 'AR ' . $invoice->invoice_nr]) @section('content') {{-- Modal: Kostenstelle --}} {{-- Modal: Zahlungsdaten --}} {{-- Modal: Konto --}} {{-- Modal: Neue Mahnung --}} {{-- Modal: Mahnung löschen --}} {{-- Modal: Neue Zahlung --}} {{-- Modal: Zahlung löschen --}} {{-- Modal: Skonto bestätigen --}} {{-- Hauptinhalt --}}
{{-- Alerts --}} @if(session('msg'))
{{ session('msg') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Header --}}
Zurück

{{ $invoice->invoice_nr }} @if($invoice->customer) {{ $invoice->customer->name }} @endif

@if($previous_invoice) Vorherige @endif @if($next_invoice) Nächste @endif
{{-- Status-Zeile --}} @if(Auth::user()->get_employee->is_mgt or Auth::user()->get_employee->get_department->department_id == '9')
Hauptstatus
@csrf
@csrf @if($invoice->is_discount_period_adhered) @else @endif
@endif {{-- Layout: 2 Spalten --}}
{{-- Linke Spalte: Tabs --}}
{{-- Tab: Rechnungsdaten --}}
{{-- Felder --}}
Kunde
{{ $invoice->customer->name }}
Rechnungs-Nr.
{{ $invoice->invoice_nr }}
Rechnungsdatum
{{ $invoice->invoice_date ? date('d.m.Y', strtotime($invoice->invoice_date)) : '–' }}
Zahlungsfrist bis
@php $exp = strtotime($invoice->expiry_date); @endphp
{{ date('d.m.Y', $exp) }}
Bezahlung
{{ $invoice->is_prepayment ? 'VORKASSE' : 'NACH ERHALT' }}
Betreff
{{ $invoice->title }}
@if($invoice->info)
Info / Hinweise
{{ $invoice->info }}
@endif

{{-- Kostenstelle --}}
Kostenstelle
@if(isset($invoice->get_cost_center)) {{ $invoice->get_cost_center->old_number ?? $invoice->get_cost_center->number }} – {{ $invoice->get_cost_center->name }} @else nicht zugewiesen @endif
{{-- Buchhaltung --}}
Buchhaltung
Bezahlt am
{{ $invoice->paid_date ? date('d.m.Y', strtotime($invoice->paid_date)) : 'noch unbezahlt' }}
@if(Auth::user()->get_employee->is_acc) @endif
Konto
@if($invoice->fk_konto_id) {{ $invoice->konto->konto }} – {{ $invoice->konto->name }} @else nicht zugewiesen @endif
@if(Auth::user()->get_employee->is_acc) @endif
{{-- Beträge --}}
Beträge
@if($invoice->is_discount_period_adhered)
Skonto {{ $invoice->discount_rate * 100 }}% bis {{ date('d.m.Y', strtotime($invoice->discount_due_date)) }}
@endif
Netto {{ number_format($invoice->subtotal, 2, ',', '.') }} €
MwSt. {{ $invoice->tax_percent * 100 }}% {{ number_format($invoice->tax, 2, ',', '.') }} €
Brutto {{ number_format($invoice->total, 2, ',', '.') }} €
@if($invoice->is_discount_period_adhered)
Skonto ({{ $invoice->discount_rate * 100 }}%) – {{ number_format($invoice->discount_amount, 2, ',', '.') }} €
Zahlbetrag mit Skonto {{ number_format($invoice->amount_due_with_discount, 2, ',', '.') }} €
@endif @if($invoice->get_warning->count() > 0)
Mahngebühren + {{ number_format($invoice->get_warning->sum('total'), 2, ',', '.') }} €
@endif @if($invoice->get_payments->count() > 0)
Zahlungseingänge – {{ number_format($invoice->get_payments->sum('amount'), 2, ',', '.') }} €
@endif
Offener Betrag {{ number_format($invoice->total + $invoice->get_warning->sum('total') - $invoice->get_payments->sum('amount'), 2, ',', '.') }} €
{{-- Tab: Mahnungen --}}
Mahnungen @if(Auth::user()->get_employee->is_mgt or Auth::user()->get_employee->is_sec or Auth::user()->get_employee->is_acc) @endif
@forelse($invoice->get_warning as $witem) @empty @endforelse
Nr. Ausgangsdatum Frist bis Mahngebühr PDF
{{ $witem->number }} {{ date('d.m.Y', strtotime($witem->income_date)) }} {{ date('d.m.Y', strtotime($witem->expiry_date)) }} {{ number_format($witem->total, 2, ',', '.') }} € {{ $witem->number }}-Mahnung
Keine Mahnungen
{{-- Tab: Zahlungseingänge --}}
Zahlungseingänge @if(Auth::user()->get_employee->is_mgt or Auth::user()->get_employee->is_sec or Auth::user()->get_employee->is_acc) @endif
@forelse($invoice->get_payments as $pitem) @empty @endforelse
# Betrag Zahlungsdatum Methode Notiz
{{ $pitem->id }} {{ number_format($pitem->amount, 2, ',', '.') }} € {{ date('d.m.Y', strtotime($pitem->payment_date)) }} {{ $pitem->get_payment_method->name }} {{ $pitem->note }}
Keine Zahlungseingänge
{{-- Tab: PDF --}}
{{-- Rechte Spalte: Timeline --}}
@if($invoice->id != 6)
@csrf
@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

@endif {{-- 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($invoice->timelines->sortByDesc('created_at') as $tt) @if($tt->is_event or $tt->is_email or $tt->is_note or $tt->is_call or $tt->is_post or $tt->is_personally) @php $isEvent = (bool) $tt->is_event; $isNote = $tt->is_note && !$tt->is_event; $isCall = (bool) $tt->is_call; $isEmail = (bool) $tt->is_email; $isPost = (bool) $tt->is_post; $isPersonally = (bool) $tt->is_personally; if ($isEvent) { $tlIcon = 'bi-robot'; $tlColor = '#6c757d'; } elseif ($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
{{ $tt->created_at ? \Carbon\Carbon::parse($tt->created_at)->format('d.m.Y - H:i') : '—' }}
{!! $tt->event_msg !!}
{{ $tt->get_employee?->first_name }} {{ $tt->get_employee?->last_name }}
@endif @empty
Noch keine Einträge.
@endforelse
@endsection