JourneyJoker/payment/pdfviews.py
Klaus-Uwe Mitterer d2792b8aa3 Refactor payment app
Generate invoice from HTML
Remove now unused dependency on PyInvoice
2021-06-10 13:18:52 +02:00

9 lines
No EOL
322 B
Python

from pdf.views import PDFView
class InvoicePDFView(PDFView):
template_name = "payment/invoice.html"
def get_context_data(self, **kwargs):
kwargs.setdefault('type', "Rechnung")
kwargs.setdefault('title', f'{kwargs["type"]} #{kwargs["object"].id}')
return super().get_context_data(**kwargs)