fix
This commit is contained in:
@@ -126,8 +126,10 @@ class CounterpartyBalance(BaseModel):
|
|||||||
total_price=models.Sum("price")
|
total_price=models.Sum("price")
|
||||||
)['total_price'] or 0
|
)['total_price'] or 0
|
||||||
party_amount = total_amount - paid_amount
|
party_amount = total_amount - paid_amount
|
||||||
return (paid_amount + income) - expence
|
if expence != paid_amount:
|
||||||
|
return (party_amount + income) - expence
|
||||||
|
else:
|
||||||
|
return (total_amount + income) - expence
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def total_balance_uzs(self):
|
def total_balance_uzs(self):
|
||||||
@@ -149,8 +151,10 @@ class CounterpartyBalance(BaseModel):
|
|||||||
total_price=models.Sum("price")
|
total_price=models.Sum("price")
|
||||||
)['total_price'] or 0
|
)['total_price'] or 0
|
||||||
party_amount = total_amount - paid_amount
|
party_amount = total_amount - paid_amount
|
||||||
# print(party_amount)
|
if expence != paid_amount:
|
||||||
return (paid_amount + income) - expence
|
return (party_amount + income) - expence
|
||||||
|
else:
|
||||||
|
return (total_amount + income) - expence
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.counterparty.name}"
|
return f"{self.counterparty.name}"
|
||||||
|
|||||||
Reference in New Issue
Block a user