feat(ui): group validation fields into tabs (Basis/Parteien/Positionen/PDF-Text)
Reduces scrolling - Summen und Export bleiben unterhalb der Tabs immer sichtbar. Reine UI-Umgruppierung, keine Aenderung an Feldern oder Berechnungslogik. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
efdee4cfd6
commit
c07eb860fa
42
main.py
42
main.py
|
|
@ -109,7 +109,6 @@ with col1:
|
||||||
st.success("PDF eingelesen!")
|
st.success("PDF eingelesen!")
|
||||||
uploaded_file.seek(0)
|
uploaded_file.seek(0)
|
||||||
st.pdf(uploaded_file)
|
st.pdf(uploaded_file)
|
||||||
with st.expander("Gefundener Text"): st.text(pdf_text)
|
|
||||||
|
|
||||||
with col2:
|
with col2:
|
||||||
st.subheader("2. Strukturierte Daten validieren")
|
st.subheader("2. Strukturierte Daten validieren")
|
||||||
|
|
@ -202,6 +201,13 @@ with col2:
|
||||||
if data.get("hardware_serials"):
|
if data.get("hardware_serials"):
|
||||||
st.caption(f"🔧 Erkannte Seriennummern: {', '.join(data['hardware_serials'])}")
|
st.caption(f"🔧 Erkannte Seriennummern: {', '.join(data['hardware_serials'])}")
|
||||||
|
|
||||||
|
# Reiter-Navigation: gruppiert die Eingabefelder, damit man nicht die ganze Seite
|
||||||
|
# runterscrollen muss. Summen & Export stehen bewusst UNTERHALB der Tabs (immer sichtbar).
|
||||||
|
tab_basis, tab_parteien, tab_positionen, tab_pdftext = st.tabs(
|
||||||
|
["Basis", "Parteien", "Positionen", "PDF-Text"]
|
||||||
|
)
|
||||||
|
|
||||||
|
with tab_basis:
|
||||||
# --- BT-3 RECHNUNGSTYP DROPDOWN-MENÜ ---
|
# --- BT-3 RECHNUNGSTYP DROPDOWN-MENÜ ---
|
||||||
inv_type_ui = st.selectbox(
|
inv_type_ui = st.selectbox(
|
||||||
"Rechnungstyp (BT-3)",
|
"Rechnungstyp (BT-3)",
|
||||||
|
|
@ -247,10 +253,18 @@ with col2:
|
||||||
value=str(data.get("payment_term_days", "") or "")
|
value=str(data.get("payment_term_days", "") or "")
|
||||||
)
|
)
|
||||||
|
|
||||||
i_note = st.text_area("Globale Rechnungserläuterung / Freitext (BT-22)", value=data.get("invoice_note", ""), height=150)
|
payment_means_codes_list = list(PAYMENT_MEANS_CODES.keys())
|
||||||
st.markdown("---")
|
payment_means_labels = [f"{code} - {PAYMENT_MEANS_CODES[code]}" for code in payment_means_codes_list]
|
||||||
|
selected_payment_means_label = st.selectbox(
|
||||||
|
"Zahlungsmittel (BT-81)",
|
||||||
|
options=payment_means_labels,
|
||||||
|
index=payment_means_codes_list.index("58"),
|
||||||
|
)
|
||||||
|
selected_payment_means_code = selected_payment_means_label.split(" - ")[0]
|
||||||
|
|
||||||
# Adressdaten
|
i_note = st.text_area("Globale Rechnungserläuterung / Freitext (BT-22)", value=data.get("invoice_note", ""), height=150)
|
||||||
|
|
||||||
|
with tab_parteien:
|
||||||
c_s, c_r = st.columns(2)
|
c_s, c_r = st.columns(2)
|
||||||
with c_s:
|
with c_s:
|
||||||
st.markdown("**Absender (Verkäufer):**")
|
st.markdown("**Absender (Verkäufer):**")
|
||||||
|
|
@ -271,19 +285,7 @@ with col2:
|
||||||
r_zip = st.text_input("PLZ (BT-53)", value=data.get("recipient_zip", ""))
|
r_zip = st.text_input("PLZ (BT-53)", value=data.get("recipient_zip", ""))
|
||||||
r_city = st.text_input("Stadt (BT-52) :red[*]", value=data.get("recipient_city", ""))
|
r_city = st.text_input("Stadt (BT-52) :red[*]", value=data.get("recipient_city", ""))
|
||||||
|
|
||||||
st.markdown("---")
|
with tab_positionen:
|
||||||
|
|
||||||
payment_means_codes_list = list(PAYMENT_MEANS_CODES.keys())
|
|
||||||
payment_means_labels = [f"{code} - {PAYMENT_MEANS_CODES[code]}" for code in payment_means_codes_list]
|
|
||||||
selected_payment_means_label = st.selectbox(
|
|
||||||
"Zahlungsmittel (BT-81)",
|
|
||||||
options=payment_means_labels,
|
|
||||||
index=payment_means_codes_list.index("58"),
|
|
||||||
)
|
|
||||||
selected_payment_means_code = selected_payment_means_label.split(" - ")[0]
|
|
||||||
|
|
||||||
st.markdown("### 3. Positionen")
|
|
||||||
|
|
||||||
if st.button("➕ Neue Position hinzufügen"):
|
if st.button("➕ Neue Position hinzufügen"):
|
||||||
data["items"].append({
|
data["items"].append({
|
||||||
"name": "Neue Dienstleistung", "description": "", "quantity": 1.0, "unit": "Stk.",
|
"name": "Neue Dienstleistung", "description": "", "quantity": 1.0, "unit": "Stk.",
|
||||||
|
|
@ -357,6 +359,12 @@ with col2:
|
||||||
with c_disc4:
|
with c_disc4:
|
||||||
skonto_days = st.text_input("Skonto-Frist (Tage)", value="")
|
skonto_days = st.text_input("Skonto-Frist (Tage)", value="")
|
||||||
|
|
||||||
|
with tab_pdftext:
|
||||||
|
st.text(pdf_text if pdf_text.strip() else "(Kein PDF-Text verfügbar)")
|
||||||
|
|
||||||
|
# --- SUMMEN & EXPORT: bewusst AUSSERHALB der Tabs, damit sie unabhängig vom aktiven
|
||||||
|
# Reiter immer sichtbar und ohne Scrollen erreichbar sind. ---
|
||||||
|
st.markdown("---")
|
||||||
totals = compute_invoice_totals(edited_items, discount_percent=discount_percent)
|
totals = compute_invoice_totals(edited_items, discount_percent=discount_percent)
|
||||||
computed_net_amount = totals["tax_basis_total"]
|
computed_net_amount = totals["tax_basis_total"]
|
||||||
computed_vat_amount = totals["total_vat_amount"]
|
computed_vat_amount = totals["total_vat_amount"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue