added SWR

This commit is contained in:
2022-06-09 17:08:40 +02:00
parent f97e03204f
commit ee46c0d9b0
6 changed files with 57 additions and 10 deletions

View File

@@ -21,7 +21,6 @@ import hashlib
import imaplib
from sqlalchemy.exc import DBAPIError
from ..security import groupfinder
import json

View File

@@ -50,6 +50,7 @@ def portfolio(request):
# totaliser les pourcentages
total += item.pc_cible
swr_rate = 3.5
if total != 100:
message = 'Attention, le total de votre répartition cible est incorrect : %s.' % total
@@ -111,7 +112,9 @@ def portfolio(request):
'total_valeur': total_valeur,
'total_pv': total_pv,
'total_pc_value': total_pc_value,
'total_rdt': total_rdt
'total_rdt': total_rdt,
'swr_rate' : swr_rate,
'swr_amount': float(member.pf_valeur) * swr_rate / 100,
}
@view_config(route_name='actif_edit', renderer='../templates/portfolio/actif_edit.pt', permission='view')