fix - sharing list in hand make

This commit is contained in:
2025-11-04 17:45:28 +03:30
parent 03bd9e3c0e
commit 2bf086615f
4 changed files with 641 additions and 14 deletions

View File

@@ -44,9 +44,30 @@ def pos_organizations_sharing_information(
"agency": False,
"default_account": item.default
})
else:
sharing_information_list.append({
"organization_name": "تعاونی دامداران فامنین",
"bank_account": {
"credit_card": "2222222222222222",
"sheba": "666666666666666666",
"account": "4444444444444444444444",
},
"broker": "تعاونی",
"amount": 1600,
# """
# if we will need to get agencies share amount, we can use this bellow code
#
# # item.holders_share_amount.filter(quota_distribution=distribution).first().share_amount
# # if item.holders_share_amount.filter(quota_distribution=distribution).exists() else None
# """
"agency": False,
"default_account": True
})
# if device owner is an agency organization
if owner_org.type.name == 'AGC':
print(sharing_information_list)
if owner_org.type.key == 'AGC':
sharing_information_list = agency_organization_pos_info(
agency=owner_org,
pos_sharing_list=sharing_information_list,
@@ -74,6 +95,7 @@ def agency_organization_pos_info(
).first().holders_share_amount.filter(
quota_distribution=distribution
)
agc_share_amount = agc_share_amount.first().share_amount if agc_share_amount else None
# calculate agency parent share amount