fix - pos sharing filter brokers by quota stat
This commit is contained in:
@@ -11,6 +11,7 @@ from apps.product.models import (
|
||||
def pos_organizations_sharing_information(
|
||||
device: Device,
|
||||
quota: Quota = None,
|
||||
quota_stat=None,
|
||||
distribution: QuotaDistribution = None,
|
||||
owner_org: Organization = None
|
||||
) -> typing.Any:
|
||||
@@ -32,7 +33,8 @@ def pos_organizations_sharing_information(
|
||||
} if item.organization.bank_information.exists() else {},
|
||||
"broker": item.broker.name if item.broker else None,
|
||||
"amount": quota.broker_values.filter(
|
||||
broker=item.broker
|
||||
broker=item.broker,
|
||||
org_quota_stat=quota_stat
|
||||
).first().value if quota and item.broker else None,
|
||||
|
||||
# """
|
||||
@@ -62,7 +64,8 @@ def pos_organizations_sharing_information(
|
||||
} if item.organization.bank_information.exists() else {},
|
||||
"broker": item.broker.name if item.broker else None,
|
||||
"amount": quota.broker_values.filter(
|
||||
broker=item.broker
|
||||
broker=item.broker,
|
||||
org_quota_stat=quota_stat
|
||||
).first().value if quota and item.broker else None,
|
||||
|
||||
# """
|
||||
|
||||
@@ -303,8 +303,9 @@ class OrganizationQuotaStatsSerializer(serializers.ModelSerializer):
|
||||
}
|
||||
|
||||
sharing_list = pos_organizations_sharing_information(
|
||||
device,
|
||||
instance.quota,
|
||||
device=device,
|
||||
quota=instance.quota,
|
||||
quota_stat=instance,
|
||||
owner_org=organization
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user