PDF: Tabelle mit Spalten (Menge, EP, Gesamt rechts), Summen und Zahlbar links
This commit is contained in:
31
app.py
31
app.py
@@ -264,23 +264,30 @@ def invoice_pdf():
|
||||
pdf.line(left, pdf.get_y() + 6, 195, pdf.get_y() + 6)
|
||||
pdf.set_draw_color(0, 0, 0)
|
||||
|
||||
# --- Positionen (alles linksbundig) ---
|
||||
pdf.set_x(left)
|
||||
pdf.ln(10)
|
||||
# --- Positionstabelle ---
|
||||
table_y = pdf.get_y() + 10
|
||||
pdf.set_xy(left, table_y)
|
||||
pdf.set_font("Arial", "B", 10)
|
||||
pdf.cell(0, 6, "Leistungsbeschreibung:", ln=True)
|
||||
pdf.cell(85, 6, "Leistungsbeschreibung")
|
||||
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_x(left)
|
||||
pos_label = f"3D-Druck: {projekt}" if projekt else "3D-Druck"
|
||||
pdf.cell(0, 6, pos_label, ln=True)
|
||||
pdf.set_x(left)
|
||||
pdf.cell(0, 6, f"Menge: {stueckzahl} Stuck", ln=True)
|
||||
pdf.set_x(left)
|
||||
pdf.cell(0, 6, f"Einzelpreis: {calc['verkaufspreis']:.2f} EUR", ln=True)
|
||||
pdf.set_x(left)
|
||||
pdf.cell(0, 6, f"Gesamt: {gesamt_netto:.2f} EUR", ln=True)
|
||||
pdf.cell(85, 7, pos_label)
|
||||
pdf.cell(20, 7, str(stueckzahl), align='R')
|
||||
pdf.cell(30, 7, f"{calc['verkaufspreis']:.2f} EUR", align='R')
|
||||
pdf.cell(30, 7, f"{gesamt_netto:.2f} EUR", ln=True, align='R')
|
||||
|
||||
# --- Summen ---
|
||||
pdf.line(left, pdf.get_y() + 0.5, 195, pdf.get_y() + 0.5)
|
||||
|
||||
# --- Summen (linksbundig) ---
|
||||
pdf.set_x(left)
|
||||
pdf.ln(8)
|
||||
pdf.set_font("Arial", "", 10)
|
||||
|
||||
Reference in New Issue
Block a user