mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-09-10 08:13:12 +00:00
24 lines
681 B
Python
24 lines
681 B
Python
from django.db import models
|
|
from django.shortcuts import redirect
|
|
from django.urls import reverse
|
|
|
|
from cotisations.models import Paiement
|
|
from cotisations.payment_methods.mixins import PaymentMethodMixin
|
|
|
|
|
|
class ChequePayment(PaymentMethodMixin, models.Model):
|
|
"""
|
|
The model allowing you to pay with a cheque.
|
|
"""
|
|
payment = models.OneToOneField(
|
|
Paiement,
|
|
related_name='payment_method',
|
|
editable=False
|
|
)
|
|
def end_payment(self, invoice, request):
|
|
invoice.valid = False
|
|
invoice.save()
|
|
return redirect(reverse(
|
|
'cotisations:cheque:validate',
|
|
kwargs={'invoice_pk': invoice.pk}
|
|
))
|