fix: Adjust header alignment and footer content in PDF receipt generation

This commit is contained in:
2026-03-24 08:06:37 +01:00
parent 4c360655c1
commit d54e9a6ed5
+2 -1
View File
@@ -6,6 +6,7 @@ import string, random
class Recibo(FPDF): class Recibo(FPDF):
def header(self): def header(self):
self.set_font('Arial', 'B', 15) self.set_font('Arial', 'B', 15)
self.cell(0, 10, "Comercialmeria S.L")
self.cell(0, 10, 'RECIBO DE PAGO', ln=True, align='C') self.cell(0, 10, 'RECIBO DE PAGO', ln=True, align='C')
self.ln(10) self.ln(10)
@@ -33,7 +34,7 @@ def generar_recibo(cliente: str, total: float, objetos: list, metodo_pago: str):
DATA.append( DATA.append(
(str(i["amount"]), str(i["product_name"]), str(i["price"]), str(float(i["price"])*int(i["amount"]))) (str(i["amount"]), str(i["product_name"]), str(i["price"]), str(float(i["price"])*int(i["amount"])))
) )
pdf.cell(0, 10, "DETALLE DEL COBRO", ln=True, align='C') pdf.cell(0, 10, "DETALLE DEL COBRO", ln=True, align='R')
pdf.ln(5) pdf.ln(5)
with pdf.table() as table: with pdf.table() as table: