Validate payees
This commit is contained in:
parent
607eaef264
commit
1dd254a3a7
|
@ -62,36 +62,38 @@ class LinkGroupInfo(LoginRequiredMixin, OTPRequiredMixin, ObjectRead):
|
|||
pay_list = {}
|
||||
|
||||
platform_pay_list = []
|
||||
for payee in payees["platform"]:
|
||||
cast = {
|
||||
"name": payee.name,
|
||||
"address": payee.address,
|
||||
"amount": profit_platform / len(payees["platform"]),
|
||||
"max": profit_platform,
|
||||
}
|
||||
if payee not in pay_list:
|
||||
pay_list[payee] = {}
|
||||
if "amount" in pay_list[payee]:
|
||||
pay_list[payee]["amount"] += cast["amount"]
|
||||
else:
|
||||
pay_list[payee] = dict(cast)
|
||||
platform_pay_list.append(cast)
|
||||
if "platform" in payees:
|
||||
for payee in payees["platform"]:
|
||||
cast = {
|
||||
"name": payee.name,
|
||||
"address": payee.address,
|
||||
"amount": profit_platform / len(payees["platform"]),
|
||||
"max": profit_platform,
|
||||
}
|
||||
if payee not in pay_list:
|
||||
pay_list[payee] = {}
|
||||
if "amount" in pay_list[payee]:
|
||||
pay_list[payee]["amount"] += cast["amount"]
|
||||
else:
|
||||
pay_list[payee] = dict(cast)
|
||||
platform_pay_list.append(cast)
|
||||
|
||||
requisition_pay_list = []
|
||||
for payee in payees["requisition"]:
|
||||
cast = {
|
||||
"name": payee.name,
|
||||
"address": payee.address,
|
||||
"amount": profit_requisition / len(payees["requisition"]),
|
||||
"max": profit_requisition,
|
||||
}
|
||||
if payee not in pay_list:
|
||||
pay_list[payee] = {}
|
||||
if "amount" in pay_list[payee]:
|
||||
pay_list[payee]["amount"] += cast["amount"]
|
||||
else:
|
||||
pay_list[payee] = dict(cast)
|
||||
requisition_pay_list.append(cast)
|
||||
if "requisition" in payees:
|
||||
for payee in payees["requisition"]:
|
||||
cast = {
|
||||
"name": payee.name,
|
||||
"address": payee.address,
|
||||
"amount": profit_requisition / len(payees["requisition"]),
|
||||
"max": profit_requisition,
|
||||
}
|
||||
if payee not in pay_list:
|
||||
pay_list[payee] = {}
|
||||
if "amount" in pay_list[payee]:
|
||||
pay_list[payee]["amount"] += cast["amount"]
|
||||
else:
|
||||
pay_list[payee] = dict(cast)
|
||||
requisition_pay_list.append(cast)
|
||||
|
||||
simulation[("Platform", profit_platform)] = platform_pay_list
|
||||
simulation[("Requisition", profit_requisition)] = requisition_pay_list
|
||||
|
|
Loading…
Reference in New Issue