diff --git a/caotek_mesavoirs/templates/portfolio/portfolio.pt b/caotek_mesavoirs/templates/portfolio/portfolio.pt
index ac3f95b..fcffe47 100644
--- a/caotek_mesavoirs/templates/portfolio/portfolio.pt
+++ b/caotek_mesavoirs/templates/portfolio/portfolio.pt
@@ -52,9 +52,9 @@
${layout.to_percent(member.pf_plusvalue_pc, 1)} |
- | Rendemant brut |
- ${layout.to_euro(member.pf_rendement)} |
- ${layout.to_percent(member.pf_rdt_pc, 1)} |
+ Safe Withdrawal Rate |
+ ${layout.to_euro(swr_amount)} |
+ ${layout.to_percent(swr_rate, 1)} |
@@ -107,7 +107,6 @@
Valeur |
+/- Valeur |
% de +/- |
- Rdt brut |
% TER |
% PF |
@@ -125,7 +124,6 @@
${layout.to_euro(ligne.plus_value)} |
${ligne.pc_plusvalue} |
${ligne.pc_plusvalue} |
- ${layout.to_euro(ligne.rendement)} |
${layout.zero2space(ligne.ter)} |
${ligne.pc_allocation} |
@@ -136,7 +134,6 @@
${layout.to_euro(total_pv)} |
${layout.to_euro(total_pv)} |
${layout.to_percent(total_pc_value, 1)} |
- ${layout.to_euro(total_rdt)} |
|
100.0 |
diff --git a/caotek_mesavoirs/views/members.py b/caotek_mesavoirs/views/members.py
index 922db5b..4aabbec 100644
--- a/caotek_mesavoirs/views/members.py
+++ b/caotek_mesavoirs/views/members.py
@@ -21,7 +21,6 @@ import hashlib
import imaplib
from sqlalchemy.exc import DBAPIError
-from ..security import groupfinder
import json
diff --git a/caotek_mesavoirs/views/portfolio.py b/caotek_mesavoirs/views/portfolio.py
index b3ca9cf..5789d12 100644
--- a/caotek_mesavoirs/views/portfolio.py
+++ b/caotek_mesavoirs/views/portfolio.py
@@ -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')
diff --git a/development.ini b/development.ini
index 47456bc..4fc943e 100644
--- a/development.ini
+++ b/development.ini
@@ -21,7 +21,6 @@ pyramid.includes =
sqlalchemy.url = mysql://root:phuoc!@localhost/bd_mesavoirs?charset=utf8
caotek_mesavoirs.admin_email = cao.thien-phuoc@orange.fr
-
# Mailer configuration
mail.host = smtp.orange.fr
mail.port = 25
diff --git a/email_avnes_purge.py b/email_avnes_purge.py
new file mode 100644
index 0000000..2e63666
--- /dev/null
+++ b/email_avnes_purge.py
@@ -0,0 +1,50 @@
+# -*- coding: utf8 -*-
+#
+# Compter les emails BEFORE DATE
+#
+
+from pprint import pprint
+import datetime
+import imaplib
+
+# connecter au serveur IMAP
+conn = imaplib.IMAP4_SSL('mail.gandi.net')
+conn.login('bureau@avnes.org', 'ConCho#56')
+# lister les dossiers
+typ, data = conn.list()
+print('Liste des dossiers :')
+pprint(data)
+
+# delete mails before 14 years
+before_date = (datetime.date.today() - datetime.timedelta(365.25 * 13)).strftime("%d-%b-%Y")
+print("Delete emails before " + before_date)
+
+# select ALL
+conn.select('INBOX')
+
+rv, data = conn.search(None, '(BEFORE {0})'.format(before_date))
+nb_mails = str(len(data[0]))
+print(nb_mails + " emails founded")
+
+resp = input ("Enter 'c' to continue, or 'a' to abort : ")
+if resp=="c":
+ print("Moving " + nb_mails + " emails to Trash")
+ messages = data[0].split(b' ')
+ for mail in messages:
+ # move to trash
+ conn.store(mail, '+X-GM-LABELS', '\\Trash')
+
+ #This block empties trash, remove if you want to keep, Gmail auto purges trash after 30 days.
+ print("Emptying Trash & Expunge...")
+ conn.select('[Gmail]/Corbeille')
+ conn.store("1:*", '+FLAGS', '\\Deleted')
+ # delete all the selected messages
+ conn.expunge()
+ print("Script completed")
+else:
+ print("Script aborted")
+
+# deconnexion du serveur
+conn.close()
+conn.logout()
+
diff --git a/production.ini b/production.ini
index 411af8f..1f591da 100644
--- a/production.ini
+++ b/production.ini
@@ -21,7 +21,6 @@ sqlalchemy.url = mysql://phuoc:phuoc!@localhost/bd_mesavoirs?charset=utf8
sqlalchemy.pool_recycle = 3600
caotek_mesavoirs.admin_email = phuoc@caotek.fr
-
# Mailer configuration
mail.host = localhost
mail.port = 25