@extends('layouts.app', ['title' => 'Ausgangsrechnungen']) @section('content') @php $total_warnings = 0; $total_payments = 0; @endphp {{-- Modal: Neuer Kunde --}} {{-- Modal: Neue Ausgangsrechnung --}} {{-- Modal: Rechnung bearbeiten --}} {{-- Modal: Löschen --}} {{-- Modal: PDF Vollbild --}} {{-- Hauptinhalt --}}
{{-- Alerts --}} @if(session('msg'))
{{ session('msg') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Header --}}

Ausgangsrechnungen

@if(Auth::user()->get_employee->is_acc) @endif @if(Auth::user()->get_employee->is_mgt or Auth::user()->get_employee->is_sec) @endif
@if(!empty($invoices)) {{-- Stat Cards --}}
{{-- Suche + Filter --}}
Rechnungsdatum
Zurücksetzen
{{-- Tabelle --}}
@foreach ($invoices as $item) @php $warnings = $item->get_warning->sum('total'); $payments = $item->get_payments->sum('amount'); $total_warnings += $warnings; $total_payments += $payments; $net = $item->total + $warnings - $payments; @endphp @endforeach
Rech.Nr. Kst.Nr. Betreff
@csrf
Kunde
@csrf
@csrf
Status @if(Auth::user()->get_employee->is_mgt or Auth::user()->get_employee->is_sec) / Aktion @endif
{{ $item->invoice_nr }} @if(!empty($item->get_cost_center)) @php $cc = $item->get_cost_center; $ccNr = $cc->old_number ?? $cc->number; @endphp @if(Auth::user()->get_employee->is_acc) {{ $ccNr }} – {{ $cc->name }} @else {{ $ccNr }} – {{ $cc->name }} @endif @endif {{ $item->title }} @if($item->is_discount_period_adhered)
Skonto {{ $item->discount_rate * 100 }}% bis {{ date('d.m.Y', strtotime($item->discount_due_date)) }}
@endif
@if($item->is_discount_period_adhered && now() < $item->discount_due_date)
{{ number_format($item->amount_due_with_discount, 2, ',', '.') }} €
{{ number_format($item->total, 2, ',', '.') }} € Btr.
@else
{{ number_format($item->total, 2, ',', '.') }} €
@endif @if($warnings > 0)
+{{ number_format($warnings, 2, ',', '.') }} € Mhg.
@endif @if($payments > 0)
{{ number_format($payments, 2, ',', '.') }} € Zlg.
@endif @if($warnings > 0 || $payments > 0)
{{ number_format($net, 2, ',', '.') }} € @if($net < 0)Überbezahlung!@else Ofn.@endif
@endif
{{ $item->customer->name }} @if(!empty($item->invoice_date)) {{ date('d.m.Y', strtotime($item->invoice_date)) }} @endif @php $exp = strtotime($item->expiry_date); @endphp @if($exp < strtotime('today') && !$item->is_paid) {{ date('d.m.Y', $exp) }} @else {{ date('d.m.Y', $exp) }} @endif
@if($item->is_paid) bezahlt @else offen @endif @if(Auth::user()->get_employee->is_mgt or Auth::user()->get_employee->is_sec)
@endif
Summen (aktuelle Seite)
{{ number_format($invoices->sum('subtotal'), 2, ',', '.') }} € netto
{{ number_format($invoices->sum('tax'), 2, ',', '.') }} € MwSt.
{{ number_format($invoices->sum('total'), 2, ',', '.') }} € brutto
@if($total_warnings > 0)
{{ number_format($total_warnings, 2, ',', '.') }} € Mhg.
@endif @if($total_payments > 0)
{{ number_format($total_payments, 2, ',', '.') }} € Zlg.
@endif
{{ number_format($invoices->sum('total') + $total_warnings - $total_payments, 2, ',', '.') }} € offen
@else
Keine Ausgangsrechnungen gefunden
@endif
@endsection