PDF: alle Zeilen linksbundig (Label: Wert untereinander)
This commit is contained in:
38
app.py
38
app.py
@@ -264,44 +264,34 @@ def invoice_pdf():
|
|||||||
pdf.line(left, pdf.get_y() + 6, 195, pdf.get_y() + 6)
|
pdf.line(left, pdf.get_y() + 6, 195, pdf.get_y() + 6)
|
||||||
pdf.set_draw_color(0, 0, 0)
|
pdf.set_draw_color(0, 0, 0)
|
||||||
|
|
||||||
# --- Positionstabelle ---
|
# --- Positionen (alles linksbundig) ---
|
||||||
table_y = pdf.get_y() + 10
|
pdf.set_x(left)
|
||||||
pdf.set_xy(left, table_y)
|
pdf.ln(10)
|
||||||
pdf.set_font("Arial", "B", 10)
|
pdf.set_font("Arial", "B", 10)
|
||||||
pdf.cell(85, 6, "Leistungsbeschreibung")
|
pdf.cell(0, 6, "Leistungsbeschreibung:", ln=True)
|
||||||
pdf.cell(20, 6, "Menge", align='R')
|
|
||||||
pdf.cell(30, 6, "Einzelpreis", align='R')
|
|
||||||
pdf.cell(30, 6, "Gesamt", ln=True, align='R')
|
|
||||||
|
|
||||||
pdf.set_draw_color(200, 200, 200)
|
|
||||||
pdf.line(left, pdf.get_y() + 0.5, 195, pdf.get_y() + 0.5)
|
|
||||||
pdf.set_draw_color(0, 0, 0)
|
|
||||||
|
|
||||||
pdf.set_font("Arial", "", 10)
|
pdf.set_font("Arial", "", 10)
|
||||||
pdf.set_x(left)
|
pdf.set_x(left)
|
||||||
pos_label = f"3D-Druck: {projekt}" if projekt else "3D-Druck"
|
pos_label = f"3D-Druck: {projekt}" if projekt else "3D-Druck"
|
||||||
pdf.cell(85, 7, pos_label)
|
pdf.cell(0, 6, pos_label, ln=True)
|
||||||
pdf.cell(20, 7, str(stueckzahl), align='R')
|
pdf.set_x(left)
|
||||||
pdf.cell(30, 7, f"{calc['verkaufspreis']:.2f} EUR", align='R')
|
pdf.cell(0, 6, f"Menge: {stueckzahl} Stuck", ln=True)
|
||||||
pdf.cell(30, 7, f"{gesamt_netto:.2f} EUR", ln=True, align='R')
|
pdf.set_x(left)
|
||||||
|
pdf.cell(0, 6, f"Einzelpreis: {calc['verkaufspreis']:.2f} EUR", ln=True)
|
||||||
pdf.line(left, pdf.get_y() + 0.5, 195, pdf.get_y() + 0.5)
|
pdf.set_x(left)
|
||||||
|
pdf.cell(0, 6, f"Gesamt: {gesamt_netto:.2f} EUR", ln=True)
|
||||||
|
|
||||||
# --- Summen ---
|
# --- Summen ---
|
||||||
pdf.set_x(left)
|
pdf.set_x(left)
|
||||||
pdf.ln(8)
|
pdf.ln(8)
|
||||||
pdf.set_font("Arial", "", 10)
|
pdf.set_font("Arial", "", 10)
|
||||||
pdf.cell(130, 6, "Nettobetrag:")
|
pdf.cell(0, 6, f"Nettobetrag: {gesamt_netto:.2f} EUR", ln=True)
|
||||||
pdf.cell(50, 6, f"{gesamt_netto:.2f} EUR", ln=True, align='R')
|
|
||||||
if calc.get('mwst_ausweisen'):
|
if calc.get('mwst_ausweisen'):
|
||||||
pdf.set_x(left)
|
pdf.set_x(left)
|
||||||
pdf.cell(130, 6, "MwSt. (19%):")
|
pdf.cell(0, 6, f"MwSt. (19%): {gesamt_mwst:.2f} EUR", ln=True)
|
||||||
pdf.cell(50, 6, f"{gesamt_mwst:.2f} EUR", ln=True, align='R')
|
|
||||||
pdf.set_font("Arial", "B", 12)
|
pdf.set_font("Arial", "B", 12)
|
||||||
pdf.set_x(left)
|
pdf.set_x(left)
|
||||||
label_total = "GESAMTBETRAG (brutto):" if calc.get('mwst_ausweisen') else "GESAMTBETRAG:"
|
label_total = "GESAMTBETRAG (brutto):" if calc.get('mwst_ausweisen') else "GESAMTBETRAG:"
|
||||||
pdf.cell(130, 8, label_total)
|
pdf.cell(0, 8, f"{label_total} {gesamt_brutto:.2f} EUR", ln=True)
|
||||||
pdf.cell(50, 8, f"{gesamt_brutto:.2f} EUR", ln=True, align='R')
|
|
||||||
|
|
||||||
# --- Zahlungsbedingungen ---
|
# --- Zahlungsbedingungen ---
|
||||||
pdf.set_font("Arial", "", 9)
|
pdf.set_font("Arial", "", 9)
|
||||||
|
|||||||
Reference in New Issue
Block a user