Issue: https://github.com/guestready/bnbstaff/issues/24637
In #23057, payment link invoices were migrated to AccountingManager (accounting_manager/services/invoices/payment_link_invoices.py). The old logic that generated invoices outside of AccountingManager should now be removed.
Magnifinance and Hostkit webhook are out of scope for this report.
File: payment_link/services/generate_payment_link_invoice_data_service.py
Builds invoice context data (invoice number, dates, customer info) using payment_link.invoice — the old invoice relationship via InvoiceableMixin. No longer needed since AccountingManager handles invoice generation.
File: payment_link/templates/payment_success.html (lines 69–74)
{% elif payment_link.invoice.s3_file %}
<a href="{{ payment_link.invoice.s3_file.url }}">
Download Invoice as PDF
</a>The new logic (lines 59–68) already uses accounting_invoices. This elif branch falls back to the old payment_link.invoice (Magnifinance-based). Should be removed.
payment_link/templates/invoices/invoice_traveller.pdf.template.htmlpayment_link/templates/invoices/invoice_traveller_pdf_base.html
Old templates used to render payment link invoices as PDFs. Superseded by AccountingManager PDF generation.
File: staffing/mixins.py (lines 5–8)
class InvoiceableMixin:
@property
def invoice(self):
return self.invoices.first()Provides .invoice property pointing to the old invoice relationship. Used by the template fallback (item 2) and the data service (item 1). Once those are removed, this mixin is no longer needed on PaymentLink. Check if other models also inherit from it before removing the class itself.
File: accounting_manager/services/migration_services.py (lines 100–107)
accounting_invoice.pdf = payment_link.invoice.s3_file
accounting_invoice.emmission_date = payment_link.invoice.createdMigratePaymentLinkInvoices was a one-time migration service that copied old invoices into AccountingManager. References payment_link.invoice. Can be removed if migration is complete.
| # | File | Action |
|---|---|---|
| 1 | payment_link/services/generate_payment_link_invoice_data_service.py |
Delete |
| 2 | payment_link/templates/payment_success.html (lines 69–74) |
Remove elif fallback |
| 3 | payment_link/templates/invoices/invoice_traveller.pdf.template.html |
Delete |
| 4 | payment_link/templates/invoices/invoice_traveller_pdf_base.html |
Delete |
| 5 | staffing/mixins.py — InvoiceableMixin |
Remove from PaymentLink; delete class if unused elsewhere |
| 6 | accounting_manager/services/migration_services.py — MigratePaymentLinkInvoices |
Delete if migration is complete |