iOS: Menge je Lagerort - Lagerort scannen + Einlagern ohne MHD

- Lagerort per QR scannen in Menge-hinzufuegen/entfernen/umlagern (Ziel), nicht
  nur ueber das Dropdown suchen.
- Beim Einlagern laufen "Menge je Lagerort"-Gegenstaende jetzt ueber die Mengen-
  Eingabe (ObjectAddSheet) statt durch den Charge-Weg mit MHD - Socken & Co.
  fragen kein MHD mehr ab.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Scarriffle
2026-07-29 11:22:40 +02:00
parent 7c359a8f5d
commit 120dfea66a
2 changed files with 31 additions and 1 deletions

View File

@@ -193,11 +193,15 @@ struct ObjectAddSheet: View {
@State private var quantity = ""
@State private var busy = false
@State private var error: String?
@State private var locScanShown = false
var body: some View {
Form {
Section {
LocationPicker(title: "Lagerort", locations: locations, selection: $locationId)
Button { locScanShown = true } label: {
Label("Lagerort scannen", systemImage: "qrcode.viewfinder")
}
QuantityField(label: "Menge", text: $quantity, suffix: einheit)
}
if let error { Section { Text(error).foregroundStyle(.red).font(.callout) } }
@@ -209,6 +213,10 @@ struct ObjectAddSheet: View {
.navigationTitle("Menge hinzufügen")
.navigationBarTitleDisplayMode(.inline)
.toolbar { ToolbarItem(placement: .topBarLeading) { Button("Abbrechen") { dismiss() } } }
.fullScreenCover(isPresented: $locScanShown) {
LocationScannerView(locations: locations) { loc in locationId = loc.id }
.ignoresSafeArea()
}
}
private func save() async {
@@ -239,12 +247,16 @@ struct ObjectRelocateSheet: View {
@State private var quantity = ""
@State private var busy = false
@State private var error: String?
@State private var locScanShown = false
var body: some View {
Form {
Section {
LocationPicker(title: "Von", locations: locations, selection: $fromId)
LocationPicker(title: "Nach", locations: locations, selection: $toId)
Button { locScanShown = true } label: {
Label("Ziel-Lagerort scannen", systemImage: "qrcode.viewfinder")
}
QuantityField(label: "Menge", text: $quantity, suffix: product.unitName)
}
if let error { Section { Text(error).foregroundStyle(.red).font(.callout) } }
@@ -255,6 +267,10 @@ struct ObjectRelocateSheet: View {
.navigationTitle("Umlagern")
.navigationBarTitleDisplayMode(.inline)
.toolbar { ToolbarItem(placement: .topBarLeading) { Button("Abbrechen") { dismiss() } } }
.fullScreenCover(isPresented: $locScanShown) {
LocationScannerView(locations: locations) { loc in toId = loc.id }
.ignoresSafeArea()
}
.onAppear { fromId = initialFrom }
}
@@ -288,11 +304,15 @@ struct ObjectRemoveSheet: View {
@State private var note = ""
@State private var busy = false
@State private var error: String?
@State private var locScanShown = false
var body: some View {
Form {
Section {
LocationPicker(title: "Lagerort", locations: locations, selection: $locationId)
Button { locScanShown = true } label: {
Label("Lagerort scannen", systemImage: "qrcode.viewfinder")
}
QuantityField(label: "Menge", text: $quantity, suffix: einheit)
Picker("Grund", selection: $reason) {
ForEach(RemovalReasons.all, id: \.value) { Text($0.label).tag($0.value) }
@@ -309,6 +329,10 @@ struct ObjectRemoveSheet: View {
.navigationTitle("Aus Bestand entfernen")
.navigationBarTitleDisplayMode(.inline)
.toolbar { ToolbarItem(placement: .topBarLeading) { Button("Abbrechen") { dismiss() } } }
.fullScreenCover(isPresented: $locScanShown) {
LocationScannerView(locations: locations) { loc in locationId = loc.id }
.ignoresSafeArea()
}
.onAppear { locationId = initialLoc }
}