X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/138cfa6b85e1c3cf46f85e7a0828443c11381bd6..15cae7d86e624d8afdb7eac794b58990ded9e64b:/src/club/models.py diff --git a/src/club/models.py b/src/club/models.py index 089bbbd33..a0722d38e 100644 --- a/src/club/models.py +++ b/src/club/models.py @@ -299,6 +299,7 @@ class PayUOrder(payu_models.Order): def send_receipt(cls, email, year): Contact = apps.get_model('messaging', 'Contact') Funding = apps.get_model('funding', 'Funding') + BillingAgreement = apps.get_model('paypal', 'BillingAgreement') payments = [] try: @@ -325,6 +326,9 @@ class PayUOrder(payu_models.Order): 'amount': order.get_amount(), }) + for ba in BillingAgreement.objects.filter(schedule__email=email): + payments.extend(ba.get_donations(year)) + fundings = Funding.objects.filter( email=email, payed_at__year=year