|
|
|
|
@ -193,8 +193,9 @@ class CoursePayment(Payment): |
|
|
|
|
verbose_name_plural = 'Платежи за курсы' |
|
|
|
|
|
|
|
|
|
def save(self, *args, **kwargs): |
|
|
|
|
amount_data = Payment.calc_amount(course_payment=self) |
|
|
|
|
self.amount = amount_data.get('amount') |
|
|
|
|
if self.status is None: |
|
|
|
|
amount_data = Payment.calc_amount(course_payment=self) |
|
|
|
|
self.amount = amount_data.get('amount') |
|
|
|
|
super().save(*args, **kwargs) |
|
|
|
|
author_balance = getattr(self, 'authorbalance', None) |
|
|
|
|
if not author_balance: |
|
|
|
|
@ -226,8 +227,9 @@ class SchoolPayment(Payment): |
|
|
|
|
return days |
|
|
|
|
|
|
|
|
|
def save(self, *args, **kwargs): |
|
|
|
|
amount_data = Payment.calc_amount(school_payment=self) |
|
|
|
|
self.amount = amount_data.get('amount') |
|
|
|
|
if self.status is None: |
|
|
|
|
amount_data = Payment.calc_amount(school_payment=self) |
|
|
|
|
self.amount = amount_data.get('amount') |
|
|
|
|
super().save(*args, **kwargs) |
|
|
|
|
|
|
|
|
|
@property |
|
|
|
|
|