Web: Mindestbestaende-Bestand zeigt richtige Einheit ("1 Packung" statt "1 Gramm")
articleLabel fiel bei leerem Gebinde-Namen auf die Basiseinheit zurueck, waehrend articleUnit durch die Packungsgroesse teilt. Dadurch stand z.B. bei Rigatoni "1 Gramm" statt "1 Packung" (500 g). Label ist jetzt an die Packungsgroesse gekoppelt und passt zur Zahl. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
0ea188374a
commit
f0c64466e2
@@ -9,8 +9,13 @@ import { locationPathById } from "../locationPath";
|
||||
import { fmt } from "../units";
|
||||
|
||||
// Artikeleinheit eines Produkts (Gebinde oder Produkteinheit) – wie in der Produktliste.
|
||||
// Wichtig: Zahl (articleUnit) und Bezeichnung (articleLabel) müssen zusammenpassen –
|
||||
// bei vorhandener Packungsgröße also „Packung" und NICHT die Basiseinheit, sonst steht
|
||||
// z.B. „1 Gramm" statt „1 Packung" (500 g) da.
|
||||
const articleUnit = (p) => (p.package_size && p.package_size > 0 ? p.package_size : (p.unit_factor || 1));
|
||||
const articleLabel = (p) => p.package_label || p.unit_name || "Stück";
|
||||
const articleLabel = (p) => (
|
||||
p.package_size && p.package_size > 0 ? (p.package_label || "Packung") : (p.unit_name || "Stück")
|
||||
);
|
||||
|
||||
/**
|
||||
* Zentrale Liste aller Mindestbestände: je Produkt/Gruppe der Gesamt-Wert und die
|
||||
|
||||
Reference in New Issue
Block a user