Warenwirtschaft: F-13 — Produkthistorie zeigt Kappung mit Gesamtzahl und „Alle anzeigen“

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-09-08 11:07:22 +00:00
parent 8c460aa8bf
commit 1e7ebfb77b
3 changed files with 43 additions and 1 deletions

View file

@ -96,6 +96,8 @@ class ProductStockController extends Controller
return redirect()->route('admin.inventory.product-stock.index');
}
private const HISTORY_LIMIT = 500;
public function history(Request $request): View
{
$query = ProductStockMovement::query()
@ -124,10 +126,16 @@ class ProductStockController extends Controller
}
}
$movements = $query->limit(500)->get();
// Prüfung 08.09.2026 F-13: Kappung sichtbar machen (Gesamtzahl + „Alle anzeigen“),
// statt ältere Buchungen still abzuschneiden — wie bei Produktion/Einkauf.
$limit = $request->boolean('all') ? null : self::HISTORY_LIMIT;
$listTotal = (clone $query)->count();
$movements = ($limit !== null ? $query->limit($limit) : $query)->get();
return view('admin.inventory.product-stock.history', [
'movements' => $movements,
'listLimit' => $limit,
'listTotal' => $listTotal,
'products' => Product::query()->orderBy('name')->get(['id', 'name']),
'reasonOptions' => ProductStockMovement::query()->distinct()->orderBy('reason')->pluck('reason')->filter()->values(),
'filters' => [