Warenwirtschaft: AP-42 — Rohstoff-Dichte (g/ml) für ml-Erfassung im Wareneingang
Kundenentscheid 26.08.: Rohstoffe werden in Gramm geführt, dürfen aber in ml erfasst werden; über die Dichte ergeben sich die Gramm (100 ml Propolistinktur × 0,79 = 79 g). - Neues Feld ingredients.density (g/ml, optional) inkl. Feld im INCI-Formular. - Wareneingang: Einheiten-Umschalter g/ml am Mengenfeld (nur wenn Dichte hinterlegt; Live-Hinweis mit Gramm-Umrechnung, Dichte kommt aus der Rohstoff-Suche mit). Erfassung in ml wird über die Dichte in Gramm umgerechnet und kanonisch als Gramm gespeichert — InventoryService und alle Aggregationen bleiben unverändert. purchase_unit + density_used (Snapshot) protokollieren die ml-Erfassung für Anzeige/Bearbeitung; Detailseite zeigt „790 g (= 1.000 ml)". Wareneingang-Buchung rechnet gelieferte ml ebenfalls um. - Serverseitige Validierung: ml nur mit hinterlegter Dichte. Migrationen add_density_* auf Dev-/Live-DB. 4 Tests, Suite 318 grün. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d51860af39
commit
fa852340ee
13 changed files with 332 additions and 11 deletions
|
|
@ -274,7 +274,7 @@ class StockEntryController extends Controller
|
|||
})
|
||||
->orderBy('name')
|
||||
->limit(30)
|
||||
->get(['id', 'name', 'inci']);
|
||||
->get(['id', 'name', 'inci', 'density']);
|
||||
|
||||
$results = $rows->map(function (Ingredient $i) {
|
||||
$text = $i->name;
|
||||
|
|
@ -282,7 +282,8 @@ class StockEntryController extends Controller
|
|||
$text .= ' ('.$i->inci.')';
|
||||
}
|
||||
|
||||
return ['id' => $i->id, 'text' => $text];
|
||||
// AP-42: Dichte mitliefern, damit die Maske die ml-Erfassung anbieten kann.
|
||||
return ['id' => $i->id, 'text' => $text, 'density' => $i->density !== null ? (float) $i->density : null];
|
||||
})->values()->all();
|
||||
|
||||
return response()->json(['results' => $results]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue