gruene-seele/resources/views/admin/inventory/stock-entries/index.blade.php
Kevin Adametz a8f6fef38e Warenwirtschaft: einheitliches UI-Design (AP-19)
- Zentrale, wiederverwendbare Design-Partial wawi-ui.blade.php (gescoptes Inline-CSS, kein Build noetig)
- Bausteine: Seitenkopf, Kennzahlen-Kacheln, Karten, Toolbar/Suche, aufgeraeumte Tabellen, Status-Pills, Datenblatt-Definitionsliste, Name-Zelle mit fester Icon-Spalte, Leer-Zustaende
- Umgestellt: alle Uebersicht-/Listen- und Detailseiten unter admin/inventory
- Responsive: Detail-Datenblaetter brechen unter 768px gestapelt um (Label oben, Wert linksbuendig); Icon-Spalte verhindert Versatz bei Zeilenumbruch
- Entwicklungsplan um AP-19 + UI-Konvention ergaenzt

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 13:09:55 +00:00

108 lines
5.7 KiB
PHP

@extends('layouts.layout-2')
@section('content')
@include('admin.inventory.partials.wawi-ui')
<div class="wawi-page">
<div class="wawi-page-head">
<div>
<h1 class="wawi-page-head__title">{{ __('Einkauf & Wareneingang') }}</h1>
<p class="wawi-page-head__subtitle">{{ __('Bestellungen und Wareneingänge von Rohstoffen und Verpackung') }}</p>
</div>
<div class="wawi-page-head__actions">
@if(Auth::user()->isAdmin())
<a href="{{ route('admin.inventory.stock-entries.create') }}" class="btn btn-primary btn-sm">
<span class="fas fa-plus mr-1"></span>{{ __('Neuer Einkauf') }}
</a>
@endif
</div>
</div>
<div class="wawi-card">
<div class="card-datatable table-responsive p-2">
<table class="datatables-style table wawi-table">
<thead>
<tr>
<th style="max-width: 90px;"></th>
<th>{{ __('Status') }}</th>
<th>{{ __('Bestellt') }}</th>
<th>{{ __('Art') }}</th>
<th>{{ __('Artikel') }}</th>
<th>{{ __('Lieferant') }}</th>
<th>{{ __('Menge') }}</th>
<th style="max-width: 60px;"></th>
</tr>
</thead>
<tbody>
@foreach($values as $row)
<tr>
<td class="text-nowrap">
<a href="{{ route('admin.inventory.stock-entries.show', $row) }}" class="btn icon-btn btn-sm btn-primary" title="{{ __('Ansicht') }}">
<span class="far fa-eye"></span>
</a>
@if(Auth::user()->isAdmin() && $row->status === 'pending')
<a href="{{ route('admin.inventory.stock-entries.edit', $row) }}" class="btn icon-btn btn-sm btn-secondary" title="{{ __('Bearbeiten') }}">
<span class="far fa-edit"></span>
</a>
@endif
@if(Auth::user()->isAdmin())
<a href="{{ route('admin.inventory.stock-entries.copy', $row) }}" class="btn icon-btn btn-sm btn-info" title="{{ __('Duplizieren') }}">
<span class="far fa-copy"></span>
</a>
@endif
</td>
<td data-sort="{{ $row->status === 'pending' ? 0 : 1 }}">
@if($row->status === 'pending')
<span class="wawi-pill wawi-pill--warning">{{ __('Offen') }}</span>
@else
<span class="wawi-pill wawi-pill--ok">{{ __('Eingegangen') }}</span>
@endif
</td>
<td data-sort="{{ $row->ordered_at?->timestamp ?? 0 }}">{{ $row->ordered_at?->format('d.m.Y') }}</td>
<td>{{ $entryTypeLabels[$row->entry_type] ?? $row->entry_type }}</td>
<td>
@if($row->entry_type === 'ingredient' && $row->ingredient)
<span class="wawi-item-name">{{ $row->ingredient->name }}</span>
@elseif($row->packagingItem)
<span class="wawi-item-name">{{ $row->packagingItem->name }}</span>
@else
@endif
</td>
<td>{{ $row->supplier?->name ?? '—' }}</td>
<td>
@if($row->unit === 'gram')
{{ \App\Services\Util::formatNumber($row->ordered_quantity) }} g
@else
{{ \App\Services\Util::formatNumber($row->ordered_quantity, 0) }} {{ __('Stk.') }}
@endif
</td>
<td>
@if(Auth::user()->isAdmin() && $row->status === 'pending')
<form action="{{ route('admin.inventory.stock-entries.destroy', $row) }}" method="post" class="d-inline"
onsubmit="return confirm(@json(__('Eintrag wirklich löschen?')));">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-link text-danger p-0" title="{{ __('Löschen') }}"><i class="far fa-trash-alt"></i></button>
</form>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$('.datatables-style').dataTable({
"bLengthChange": false,
"iDisplayLength": 100,
"order": [[1, "asc"], [2, "desc"]],
"columnDefs": [{"orderable": false, "targets": [0, 7]}],
"language": {"url": "/js/German.json"}
});
});
</script>
@endsection