fix
This commit is contained in:
@@ -102,7 +102,10 @@ class PartyAmount(BaseModel):
|
||||
verbose_name = 'Partiya Summasi'
|
||||
verbose_name_plural = 'Partiya summalari'
|
||||
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if self.calculated_amount < self.paid_amount:
|
||||
self.payment_amount = self.paid_amount - self.calculated_amount
|
||||
return super().save(*args, **kwargs)
|
||||
|
||||
class DeletedParty(BaseModel):
|
||||
party = models.ForeignKey(Party, on_delete=models.CASCADE, related_name='deleted_parties')
|
||||
|
||||
@@ -103,6 +103,8 @@ class PartyAmountSerializer(serializers.ModelSerializer):
|
||||
"calculated_amount",
|
||||
"paid_amount",
|
||||
"payment_amount",
|
||||
"debt_amount",
|
||||
"total_expense_amount",
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user