fix payment
This commit is contained in:
@@ -70,9 +70,11 @@ 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 hasattr(self, 'party_amount') and self.party_amount.paid_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
|
||||||
return super().save(*args, **kwargs)
|
return super().save(*args, **kwargs)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|||||||
Reference in New Issue
Block a user