From 063295110d5ab0b9e617c4ee149fda80f00e477b Mon Sep 17 00:00:00 2001 From: dfuhrmann3 Date: Fri, 3 Jul 2026 10:59:29 +0200 Subject: [PATCH] Tabelle anpassen --- main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index d84b8a6..50f00b7 100644 --- a/main.py +++ b/main.py @@ -452,7 +452,6 @@ with col2: final_data["items"] = extract_invoice_items_pure_python(pdf_text) - # 🔥 REPARATUR: Erhöhe den Zähler, um Streamlits Widget-Cache für die neue Rechnung komplett zu wipen st.session_state.invoice_counter += 1 st.session_state.extracted_data = final_data @@ -520,11 +519,9 @@ with col2: edited_items = [] - # Hole den aktuellen Rechnungs-ID-Zustand für die Widget-Keys inv_id = st.session_state.invoice_counter for idx, item in enumerate(data.get("items", [])): - # 🔥 REPARATUR: Alle Keys sind jetzt an die 'inv_id' gekoppelt. Neue Rechnung = Neue Keys = Frische Daten! with st.expander(f"📋 Position {idx+1}: {item.get('name', 'Dienstleistung')}", expanded=True): c_del, _ = st.columns([1, 4]) @@ -545,7 +542,8 @@ with col2: c_qty, c_unit, c_price, c_total = st.columns(4) with c_qty: - item_quantity = st.number_input("Menge", value=float(item.get("quantity") or 0.0), format="%.1f", step=0.1, key=f"item_qty_{inv_id}_{idx}") + # 🔥 GEÄNDERT: Format auf %.3f gesetzt, step bleibt bei 0.1 + item_quantity = st.number_input("Menge", value=float(item.get("quantity") or 0.0), format="%.3f", step=0.1, key=f"item_qty_{inv_id}_{idx}") with c_unit: item_unit = st.text_input("Einheit", value=item.get("unit", "Stk."), key=f"item_unit_{inv_id}_{idx}") with c_price: