add - org quota stat to inventory_entry / inventory_balance to org_quota_stat

This commit is contained in:
2025-11-19 16:49:00 +03:30
parent f633e24d90
commit 386008b309
6 changed files with 50 additions and 0 deletions

View File

@@ -470,6 +470,7 @@ class Quota(BaseModel):
organization=org
)
return {
"id": stat.first().id if stat.exists() else 0,
"quota_weight": stat.first().total_amount if stat.exists() else 0,
"remaining_weight": stat.first().remaining_amount if stat.exists() else 0,
"quota_distributed": stat.first().total_distributed if stat.exists() else 0,
@@ -817,6 +818,7 @@ class OrganizationQuotaStats(BaseModel):
total_amount = models.PositiveBigIntegerField(default=0)
total_distributed = models.PositiveBigIntegerField(default=0)
inventory_received = models.PositiveBigIntegerField(default=0)
inventory_entry_balance = models.PositiveBigIntegerField(default=0)
sold_amount = models.PositiveBigIntegerField(default=0)
remaining_amount = models.PositiveBigIntegerField(default=0) # total - sold
stat_type = models.CharField(max_length=150, choices=(