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(
|
def pos_organizations_sharing_information(
|
||||||
device: Device,
|
device: Device,
|
||||||
quota: Quota = None,
|
quota: Quota = None,
|
||||||
|
quota_stat=None,
|
||||||
distribution: QuotaDistribution = None,
|
distribution: QuotaDistribution = None,
|
||||||
owner_org: Organization = None
|
owner_org: Organization = None
|
||||||
) -> typing.Any:
|
) -> typing.Any:
|
||||||
@@ -32,7 +33,8 @@ def pos_organizations_sharing_information(
|
|||||||
} if item.organization.bank_information.exists() else {},
|
} if item.organization.bank_information.exists() else {},
|
||||||
"broker": item.broker.name if item.broker else None,
|
"broker": item.broker.name if item.broker else None,
|
||||||
"amount": quota.broker_values.filter(
|
"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,
|
).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 {},
|
} if item.organization.bank_information.exists() else {},
|
||||||
"broker": item.broker.name if item.broker else None,
|
"broker": item.broker.name if item.broker else None,
|
||||||
"amount": quota.broker_values.filter(
|
"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,
|
).first().value if quota and item.broker else None,
|
||||||
|
|
||||||
# """
|
# """
|
||||||
|
|||||||
@@ -303,8 +303,9 @@ class OrganizationQuotaStatsSerializer(serializers.ModelSerializer):
|
|||||||
}
|
}
|
||||||
|
|
||||||
sharing_list = pos_organizations_sharing_information(
|
sharing_list = pos_organizations_sharing_information(
|
||||||
device,
|
device=device,
|
||||||
instance.quota,
|
quota=instance.quota,
|
||||||
|
quota_stat=instance,
|
||||||
owner_org=organization
|
owner_org=organization
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user