import changes in notification
This commit is contained in:
@@ -275,7 +275,7 @@ class StakeHolders(BaseModel):
|
||||
default = models.BooleanField(default=False)
|
||||
|
||||
def __str__(self):
|
||||
return f'Device: {self.assignment.device.serial}-organization: {self.organization.name}'
|
||||
return f'ID: {self.id}-Device: {self.assignment.device.serial}-organization: {self.organization.name}'
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
return super(StakeHolders, self).save(*args, **kwargs)
|
||||
|
||||
@@ -47,20 +47,26 @@ def pos_organizations_sharing_information(
|
||||
})
|
||||
|
||||
# if device owner is an agency organization
|
||||
if owner_org.type.name == 'AGC':
|
||||
sharing_information_list.append({
|
||||
"organization_name": owner_org.parent_organization.name,
|
||||
"bank_account": {
|
||||
"credit_card": owner_org.parent_organization.bank_information.first().card,
|
||||
"sheba": owner_org.parent_organization.bank_information.first().sheba,
|
||||
"account": owner_org.parent_organization.bank_information.first().account,
|
||||
} if owner_org.parent_organization.bank_information.exists() else {},
|
||||
"amount": quota.pricing_items.get(
|
||||
name='base_price'
|
||||
) if quota.pricing_items.filter(
|
||||
name='base_price'
|
||||
) else None,
|
||||
"default_account": True
|
||||
})
|
||||
# if owner_org.type.name == 'AGC':
|
||||
agc_share_amount = owner_org.pos_stake_holders.filter(
|
||||
device=device,
|
||||
).first().holders_share_amount.filter(
|
||||
quota_distribution=distribution
|
||||
)
|
||||
sharing_information_list.append({
|
||||
"organization_name": owner_org.parent_organization.name,
|
||||
"bank_account": {
|
||||
"credit_card": owner_org.parent_organization.bank_information.first().card,
|
||||
"sheba": owner_org.parent_organization.bank_information.first().sheba,
|
||||
"account": owner_org.parent_organization.bank_information.first().account,
|
||||
} if owner_org.parent_organization.bank_information.exists() else {},
|
||||
# "amount": quota.pricing_items.get(name='base_price').value if quota.pricing_items.filter(
|
||||
# name='base_price'
|
||||
# ) else None,
|
||||
# "agency_amount": agc_share_amount.first().share_amount if agc_share_amount else None,
|
||||
"amount": 5000,
|
||||
"agency_amount": 2000,
|
||||
"default_account": True
|
||||
})
|
||||
|
||||
return sharing_information_list
|
||||
|
||||
Reference in New Issue
Block a user