If a payment method that had bank info on it was added to an invoice, we
would include the bank data on the PDF even if the method was not marked
as active. It would still not show on the webpage of available methods,
but if someone forwarded the PDF alone for payment, they would get the
bank info for an inactive method. So fix that.
# Include bank info on the invoice if any payment method chosen
# provides it. If more than one supports it then the one with
# the highest priority (=lowest sortkey) will be used.
- for pm in self.invoice.allowedmethods.all():
+ for pm in self.invoice.allowedmethods.filter(active=True):
if pm.config and 'bankinfo' in pm.config and len(pm.config['bankinfo']) > 1:
m = pm.get_implementation()
if not (hasattr(m, 'available') and not m.available(self.invoice)):