From 41499d42df589c9c7f6a3e2adc86726e4ba7bcf7 Mon Sep 17 00:00:00 2001 From: Baptiste Delpey Date: Mon, 11 May 2015 15:07:37 +0200 Subject: [PATCH] bnp investment fix --- modules/bnporc/deprecated/perso/investment.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/bnporc/deprecated/perso/investment.py b/modules/bnporc/deprecated/perso/investment.py index 57945c16..ab899e41 100644 --- a/modules/bnporc/deprecated/perso/investment.py +++ b/modules/bnporc/deprecated/perso/investment.py @@ -38,7 +38,7 @@ def clean_cells(cells): def clean_amount(amount): - return Decimal(FrenchTransaction.clean_amount(amount)) if amount else NotAvailable + return Decimal(FrenchTransaction.clean_amount(amount)) if amount and amount != ' NS' else NotAvailable def clean_amounts(amounts): @@ -63,7 +63,8 @@ class AccountMarketInvestment(Page): inv.unitprice = clean_amount(tr2td.xpath('.//td[@class="hdotc1nb"]')[0].text) inv.description = u'' - inv.diff = inv.quantity * inv.unitprice - inv.valuation + if inv.unitprice: + inv.diff = inv.quantity * inv.unitprice - inv.valuation yield inv