fix - agency distribution show detail on pos device - v1
This commit is contained in:
@@ -80,13 +80,15 @@ def pos_organizations_sharing_information(
|
||||
|
||||
# if device owner is an agency organization
|
||||
if owner_org.type.key == 'AGC':
|
||||
sharing_information_list = agency_organization_pos_info(
|
||||
sharing_information_list_agency = agency_organization_pos_info(
|
||||
agency=owner_org,
|
||||
pos_sharing_list=sharing_information_list,
|
||||
device=device,
|
||||
distribution=distribution,
|
||||
quota_stat=quota_stat
|
||||
)
|
||||
if sharing_information_list_agency:
|
||||
return sharing_information_list_agency
|
||||
|
||||
return sharing_information_list
|
||||
|
||||
@@ -112,8 +114,9 @@ def agency_organization_pos_info(
|
||||
org_quota_stat=quota_stat
|
||||
) if agc_share_amount.exists() else None
|
||||
|
||||
agc_share_amount = agc_share_amount.first().share_amount if agc_share_amount.exists() else None
|
||||
agc_share_amount = agc_share_amount.first().share_amount if agc_share_amount else None
|
||||
|
||||
if agc_share_amount:
|
||||
# calculate agency parent share amount
|
||||
agc_parent_amount = next((item for item in pos_sharing_list if item.get('default_account')), None)
|
||||
if agc_parent_amount and agc_share_amount:
|
||||
@@ -133,6 +136,7 @@ def agency_organization_pos_info(
|
||||
|
||||
return pos_sharing_list
|
||||
return None
|
||||
return None
|
||||
|
||||
|
||||
def get_organization_by_stake_holder(id: int = None, stake_holder: StakeHolders = None) -> typing.Any:
|
||||
|
||||
Reference in New Issue
Block a user