mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-07-18 23:30:20 +02:00
Soge Credit changed
This commit is contained in:
@ -353,7 +353,7 @@ class SogeCredit(models.Model):
|
||||
def amount(self):
|
||||
if self.valid:
|
||||
return self.credit_transaction.total
|
||||
amount = sum(transaction.total for transaction in self.transactions.all())
|
||||
amount = sum(max(transaction.total - 2000, 0) for transaction in self.transactions.all())
|
||||
if 'wei' in settings.INSTALLED_APPS:
|
||||
from wei.models import WEIMembership
|
||||
if not WEIMembership.objects\
|
||||
@ -441,7 +441,7 @@ class SogeCredit(models.Model):
|
||||
With Great Power Comes Great Responsibility...
|
||||
"""
|
||||
|
||||
total_fee = sum(transaction.total for transaction in self.transactions.all() if not transaction.valid)
|
||||
total_fee = sum(max(transaction.total - 2000, 0) for transaction in self.transactions.all() if not transaction.valid)
|
||||
if self.user.note.balance < total_fee:
|
||||
raise ValidationError(_("This user doesn't have enough money to pay the memberships with its note. "
|
||||
"Please ask her/him to credit the note before invalidating this credit."))
|
||||
|
Reference in New Issue
Block a user