Warenwirtschaft: AP-09 bis AP-13 (Produktbestand, Set-Produkte, Ausschuss, Konzepte)
- AP-09 Produktbestand inkl. Bewegungshistorie (product_stock_movements, ProductStockService) - AP-10 Rohstoffbestand-Ansicht je Lager (RawMaterialStockController) - AP-11 Bestandsschwellen / Out-of-Stock-Handling fuer Produkte und Shop - AP-12 Ausgang/Ausschuss (stock_disposals, StockDisposalController, InventoryService) - Set-Produkte (product_set_items) inkl. Aufloesung - Produktentwicklung & Hinweise-Verwaltung (Notices) - AP-13 Entwicklungskonzept Shop-Bestandsabzug im Plan dokumentiert - Feature-Tests fuer neue Module + aktualisierter Entwicklungsplan Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
78679e0c55
commit
3ee2d756e9
63 changed files with 5968 additions and 901 deletions
|
|
@ -32,17 +32,29 @@ class StockEntryController extends Controller
|
|||
]));
|
||||
}
|
||||
|
||||
public function create(): View|RedirectResponse
|
||||
public function create(Request $request): View|RedirectResponse
|
||||
{
|
||||
if (! auth()->user()->isAdmin()) {
|
||||
return redirect()->route('home');
|
||||
}
|
||||
|
||||
$model = new StockEntry([
|
||||
'ordered_at' => now()->toDateString(),
|
||||
'entry_type' => 'ingredient',
|
||||
]);
|
||||
|
||||
$ingredientId = (int) $request->query('ingredient_id');
|
||||
if ($ingredientId > 0) {
|
||||
$ingredient = Ingredient::query()->find($ingredientId);
|
||||
if ($ingredient) {
|
||||
$model->entry_type = 'ingredient';
|
||||
$model->ingredient_id = $ingredient->id;
|
||||
$model->setRelation('ingredient', $ingredient);
|
||||
}
|
||||
}
|
||||
|
||||
return view('admin.inventory.stock-entries.create', array_merge($this->formSharedData(), [
|
||||
'model' => new StockEntry([
|
||||
'ordered_at' => now()->toDateString(),
|
||||
'entry_type' => 'ingredient',
|
||||
]),
|
||||
'model' => $model,
|
||||
]));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue