22 lines
871 B
Python
22 lines
871 B
Python
from apps.pos_device.models import Device
|
|
import typing
|
|
|
|
|
|
def pos_organizations_sharing_information(device: Device) -> typing.Any:
|
|
"""
|
|
pos sharing organizations' information,
|
|
device have multiple organizations (sub_accounts) for sharing money
|
|
"""
|
|
stake_holders = device.stake_holders.select_related('broker', 'broker_amount', 'organization')
|
|
|
|
sharing_information_list = [{
|
|
"organization_name": item.organization.name,
|
|
# "credit_card": item.organization.bank_information.first().card or "",
|
|
# "sheba": item.organization.bank_information.first().sheba,
|
|
# "account": item.organization.bank_information.first().account,
|
|
"broker": item.broker.name if item.broker else None,
|
|
"amount": item.broker_amount.value if item.broker else None
|
|
} for item in stake_holders]
|
|
|
|
return sharing_information_list
|