fucking changes
This commit is contained in:
@@ -71,13 +71,14 @@ class Party(BaseModel):
|
|||||||
self.process = 75
|
self.process = 75
|
||||||
elif self.status == 'PARTY_IS_MADE':
|
elif self.status == 'PARTY_IS_MADE':
|
||||||
self.process = 100
|
self.process = 100
|
||||||
if not self.payment_percentage:
|
# if not self.payment_percentage:
|
||||||
if hasattr(self, 'party_amount') and self.party_amount.paid_amount > 0 and self.party_amount.payment_amount > 0:
|
# if hasattr(self, 'party_amount') and self.party_amount.paid_amount > 0 and self.party_amount.payment_amount > 0:
|
||||||
self.payment_percentage = (self.party_amount.paid_amount / self.party_amount.payment_amount) * 100
|
# self.payment_percentage = (self.party_amount.paid_amount / self.party_amount.payment_amount) * 100
|
||||||
self.party_amount.save()
|
# self.party_amount.save()
|
||||||
else:
|
|
||||||
self.payment_percentage = 100.0
|
# else:
|
||||||
self.status == 'PURCHASED'
|
# self.payment_percentage = 100.0
|
||||||
|
# self.status == 'PURCHASED'
|
||||||
return super().save(*args, **kwargs)
|
return super().save(*args, **kwargs)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
@@ -106,6 +107,15 @@ class PartyAmount(BaseModel):
|
|||||||
else:
|
else:
|
||||||
self.overdue_amount = 0
|
self.overdue_amount = 0
|
||||||
self.payment_amount = 0
|
self.payment_amount = 0
|
||||||
|
if not self.party.payment_percentage:
|
||||||
|
if hasattr(self, 'party_amount') and self.paid_amount > 0 and self.payment_amount > 0:
|
||||||
|
self.payment_percentage = (self.paid_amount / self.payment_amount) * 100
|
||||||
|
self.party_amount.save()
|
||||||
|
self.party.save()
|
||||||
|
else:
|
||||||
|
self.party.payment_percentage = 100.0
|
||||||
|
self.party.status == 'PURCHASED'
|
||||||
|
self.party.save()
|
||||||
return super().save(*args, **kwargs)
|
return super().save(*args, **kwargs)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user