This commit is contained in:
behruz-dev
2025-11-06 16:33:03 +05:00
parent b9056b1127
commit f65d07f42b

View File

@@ -99,8 +99,10 @@ class PartyAmount(BaseModel):
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
if self.calculated_amount < self.paid_amount: if self.calculated_amount < self.paid_amount:
self.overdue_amount = self.paid_amount - self.calculated_amount self.overdue_amount = self.paid_amount - self.calculated_amount
self.payment_amount = 0
elif self.calculated_amount > self.paid_amount: elif self.calculated_amount > self.paid_amount:
self.payment_amount = self.calculated_amount - self.paid_amount self.payment_amount = self.calculated_amount - self.paid_amount
self.overdue_amount = 0
else: else:
self.overdue_amount = 0 self.overdue_amount = 0
self.payment_amount = 0 self.payment_amount = 0