X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/cddac847a30124abd1e4cf5458c4e36d5682515a..d5a5399ebf7c51aae90dd4df2a803faaa08807d9:/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