Purchasing

@if (session('status'))
{{ session('status') }}
@endif
Reset
@php $th = function ($col, $label) use ($sort, $dir) { $next = ($sort === $col && $dir === 'asc') ? 'desc' : 'asc'; $arrow = $sort === $col ? ($dir === 'asc' ? ' ↑' : ' ↓') : ''; $url = request()->fullUrlWithQuery(['sort' => $col, 'dir' => $next, 'page' => null]); return new \Illuminate\Support\HtmlString(''.e($label).$arrow.''); }; @endphp
@forelse ($purchases as $p) @php $seen = $views[$p->id] ?? null; $changed = $p->last_other_change && (! $seen || \Illuminate\Support\Carbon::parse($p->last_other_change)->gt($seen)); @endphp @empty @endforelse
{{ $th('product', 'Product') }} Supplier Client / project {{ $th('quantity', 'Quantity') }} {{ $th('needed_by', 'Needed by') }} {{ $th('status', 'Status') }}
{{ $p->product }} @if ($changed)New changes@endif @if ($p->comments_count > 0) @php $readAt = $threadViews[$p->id] ?? null; $unread = $p->last_other_comment && (! $readAt || \Illuminate\Support\Carbon::parse($p->last_other_comment)->gt($readAt)); @endphp @endif {{ $p->supplier?->name ?? '—' }} {{ $p->order ? $p->order->client : ($p->project ?: '—') }} {{ number_format($p->quantity) }} {{ $p->needed_by->format('d.m.Y') }}@if ($p->isOverdue()) overdue@endif @include('purchases._status', ['status' => $p->status])
No purchases found.
{{ $purchases->links() }}
{{-- Thread popup --}}

Loading ...

@include('purchases._composer')
@include('purchases._new-purchase-modal')