Warenwirtschaft: AP-20 Rohstoffbestand-Filter + Kein-Rohstoffbestand-Flag
- ingredients.exclude_from_stock (Checkbox im INCI-Formular, z. B. Allergene): erscheint nie im Rohstoffbestand und nicht im Kritisch-Badge - Rohstoffbestand-Uebersicht: Umschalter "Alle" / "Nur aus Herstellerrezepturen" (?scope=recipe, nutzt scopeUsedInActiveRecipes aus AP-21) - Fix: AP-21-Migrationen hatten identischen Timestamp (add_storage lief vor create_storage und scheiterte auf MySQL am FK) - umbenannt auf 120753, Teilreste bereinigt, Migrationen sauber ausgefuehrt - Hinweise-Doku fortgeschrieben Tests: RawMaterialStockTest +2 (volle Suite 172 gruen, 624 Assertions) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
d05df498d3
commit
ea36067831
11 changed files with 113 additions and 5 deletions
|
|
@ -10,6 +10,7 @@ use App\Models\TaxRate;
|
|||
use App\Services\InventoryService;
|
||||
use App\Services\ProductionService;
|
||||
use App\Services\ProductStockService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class RawMaterialStockController extends Controller
|
||||
|
|
@ -20,10 +21,15 @@ class RawMaterialStockController extends Controller
|
|||
protected ProductStockService $productStockService,
|
||||
) {}
|
||||
|
||||
public function index(): View
|
||||
public function index(Request $request): View
|
||||
{
|
||||
// AP-20: Modus „alle" / „nur aus Herstellerrezepturen (aktiver Produkte)"
|
||||
$scope = $request->query('scope') === 'recipe' ? 'recipe' : 'all';
|
||||
|
||||
$ingredients = Ingredient::query()
|
||||
->where('active', true)
|
||||
->where('exclude_from_stock', false)
|
||||
->when($scope === 'recipe', fn ($q) => $q->usedInActiveRecipes())
|
||||
->with('materialQuality')
|
||||
->orderBy('pos')
|
||||
->orderBy('name')
|
||||
|
|
@ -57,6 +63,7 @@ class RawMaterialStockController extends Controller
|
|||
'criticalCount' => $rows->where('status', 'critical')->count(),
|
||||
'horizonOptions' => $this->horizonOptions(),
|
||||
'defaultHorizon' => 90,
|
||||
'scope' => $scope,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue