fix
This commit is contained in:
@@ -126,7 +126,7 @@ 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 (party_amount + income) - expence
|
return (paid_amount + income) - expence
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -149,8 +149,8 @@ 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)
|
# print(party_amount)
|
||||||
return (party_amount + income) - expence
|
return (paid_amount + income) - expence
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.counterparty.name}"
|
return f"{self.counterparty.name}"
|
||||||
|
|||||||
@@ -61,16 +61,6 @@ class Party(BaseModel):
|
|||||||
return f'P - {self.number}'
|
return f'P - {self.number}'
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
# if self.status in ['NEW', 'CANCELLED', 'DRAFT']:
|
|
||||||
# self.process = 0
|
|
||||||
# elif self.status == 'EXPECTED':
|
|
||||||
# self.process = 25
|
|
||||||
# elif self.status == 'PROCESS':
|
|
||||||
# self.process = 50
|
|
||||||
# elif self.status == 'PURCHASED':
|
|
||||||
# self.process = 75
|
|
||||||
# elif self.status == 'PARTY_IS_MADE':
|
|
||||||
# self.process == 100
|
|
||||||
percentage = 0
|
percentage = 0
|
||||||
count = 0
|
count = 0
|
||||||
for order in self.orders.all():
|
for order in self.orders.all():
|
||||||
|
|||||||
Reference in New Issue
Block a user