Commit 61e135fa authored by Martin Sicot's avatar Martin Sicot Committed by Romain Bignon

[yomoni] Valuation diff corrected for invesments

When trying to use iter_invesments on accounts which have only cash on
them, the valuation diff would fail because in the JSON the values is
Closes: 26798@sibi
parent adcac736
......@@ -143,7 +143,9 @@ class YomoniBrowser(APIBrowser):
i.unitvalue = CleanDecimal().filter(inv['valeurCotation'])
i.valuation = CleanDecimal().filter(inv['montantEuro'])
i.vdate = Date().filter(inv['datePosition'])
i.diff = CleanDecimal().filter(inv['performanceEuro'])
# performanceEuro is null sometimes in the JSON we retrieve.
if inv['performanceEuro']:
i.diff = CleanDecimal().filter(inv['performanceEuro'])[].append(i)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment