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:
parent
8c460aa8bf
commit
1e7ebfb77b
3 changed files with 43 additions and 1 deletions
|
|
@ -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' => [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue