diff --git a/ios/Sources/CheckInView.swift b/ios/Sources/CheckInView.swift index 07e2135..0f52a1f 100644 --- a/ios/Sources/CheckInView.swift +++ b/ios/Sources/CheckInView.swift @@ -137,11 +137,17 @@ struct CheckInView: View { ItemAddSheet(productId: item.id, onDone: { status = "\(item.name): Einzelstück(e) angelegt." }) - } else { + } else if item.foodLike { + // Lebensmittel + Verbrauchsgegenstand: Charge mit Menge/MHD. CheckInFormView(product: item, units: units, locations: locations) { message in status = message product = nil } + } else { + // Menge je Lagerort (Gegenstand): ohne MHD, direkt Menge + Lagerort. + ObjectAddSheet(product: item, locations: locations, + einheit: item.unitName.isEmpty ? "Stück" : item.unitName, + perform: { status = "\(item.name): Menge eingelagert." }) } } } diff --git a/ios/Sources/ObjectStockView.swift b/ios/Sources/ObjectStockView.swift index 5763747..a6d73e6 100644 --- a/ios/Sources/ObjectStockView.swift +++ b/ios/Sources/ObjectStockView.swift @@ -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 } }