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