X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/138cfa6b85e1c3cf46f85e7a0828443c11381bd6..f0d9161da1b3fe4d3a528f95df30e26d221f73d4:/src/club/models.py?ds=sidebyside 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