stake holders sharing & quota distribution to CMP - list of stake holder sharings

This commit is contained in:
2025-09-07 13:51:39 +03:30
parent bcc79d2c30
commit 6bac1bbd45
13 changed files with 298 additions and 15 deletions

View File

@@ -1,8 +1,9 @@
from apps.pos_device.models import Device
from apps.product.models import Quota
import typing
def pos_organizations_sharing_information(device: Device) -> typing.Any:
def pos_organizations_sharing_information(device: Device, quota: Quota = None) -> typing.Any:
"""
pos sharing organizations' information,
device have multiple organizations (sub_accounts) for sharing money
@@ -17,7 +18,9 @@ def pos_organizations_sharing_information(device: Device) -> typing.Any:
"account": item.organization.bank_information.first().account,
} if item.organization.bank_information.exists() else {},
"broker": item.broker.name if item.broker else None,
"amount": item.broker_amount.value if item.broker else None
"amount": quota.broker_values.filter(
broker=item.broker
).first().value if quota and item.broker else item.share_amount
} for item in stake_holders]
return sharing_information_list