Warenwirtschaft: Review-Fix — Hinweis auf kritische Rohstoffe außerhalb der Rezepturen
Der Default-Scope 'recipe' blendet rezepturlose Rohstoffe aus, das Sidebar-Badge zählt aber alle aktiven kritischen — Badge und Seite konnten sich widersprechen. Die recipe-Ansicht zeigt jetzt einen Hinweis mit 'Alle anzeigen', sobald das Badge mehr zählt; Empty-State-Text scope-abhängig. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
80d0687f95
commit
f4256bfc89
5 changed files with 65 additions and 2 deletions
|
|
@ -58,10 +58,21 @@ class RawMaterialStockController extends Controller
|
|||
];
|
||||
});
|
||||
|
||||
$criticalCount = $rows->whereIn('status', ['critical', 'critical_ordered'])->count();
|
||||
|
||||
// Review 20.07.2026: Das Sidebar-Badge zählt ALLE aktiven kritischen Rohstoffe,
|
||||
// die Standardansicht (Scope „recipe") blendet aber rezepturlose aus. Ohne
|
||||
// Hinweis widersprächen sich Badge (z. B. „1") und Seite („0 kritisch").
|
||||
// Differenz nur im recipe-Scope ausweisen.
|
||||
$hiddenCriticalCount = $scope === 'recipe'
|
||||
? max(0, $this->inventoryService->criticalIngredientCount() - $criticalCount)
|
||||
: 0;
|
||||
|
||||
return view('admin.inventory.raw-material-stock.index', [
|
||||
'rows' => $rows,
|
||||
// Audit N-4: gleiche Zählweise wie die Kacheln (kritisch inkl. bereits bestellt).
|
||||
'criticalCount' => $rows->whereIn('status', ['critical', 'critical_ordered'])->count(),
|
||||
'criticalCount' => $criticalCount,
|
||||
'hiddenCriticalCount' => $hiddenCriticalCount,
|
||||
'horizonOptions' => $this->horizonOptions(),
|
||||
'defaultHorizon' => 90,
|
||||
'scope' => $scope,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue