|
|
|
|
@ -69,6 +69,9 @@ class CoursePayment(Payment): |
|
|
|
|
amount=self.amount, |
|
|
|
|
payment=self, |
|
|
|
|
) |
|
|
|
|
else: |
|
|
|
|
author_balance.amount = self.amount |
|
|
|
|
author_balance.save() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SchoolPayment(Payment): |
|
|
|
|
@ -85,7 +88,7 @@ class SchoolPayment(Payment): |
|
|
|
|
weekday__in=self.weekdays, |
|
|
|
|
).aggregate( |
|
|
|
|
models.Sum('month_price'), |
|
|
|
|
).month_price_sum |
|
|
|
|
).get('month_price__sum', 0) |
|
|
|
|
self.amount = month_price_sum |
|
|
|
|
super().save(*args, **kwargs) |
|
|
|
|
author_balance = getattr(self, 'authorbalance', None) |
|
|
|
|
@ -94,3 +97,6 @@ class SchoolPayment(Payment): |
|
|
|
|
amount=month_price_sum, |
|
|
|
|
payment=self, |
|
|
|
|
) |
|
|
|
|
else: |
|
|
|
|
author_balance.amount = self.amount |
|
|
|
|
author_balance.save() |
|
|
|
|
|