From eecca69306713c16027c8295b48d7d17d9acf4d4 Mon Sep 17 00:00:00 2001 From: Ruchir Shukla Date: Sat, 11 Oct 2014 12:23:10 +0530 Subject: [PATCH 1/3] add default currency in case bankstatement do not have ccy tag --- account_banking_camt/camt.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/account_banking_camt/camt.py b/account_banking_camt/camt.py index c27956b4b..b36301e9a 100644 --- a/account_banking_camt/camt.py +++ b/account_banking_camt/camt.py @@ -150,7 +150,12 @@ CAMT Format parser identifier) ) - statement.local_currency = self.xpath(node, './ns:Acct/ns:Ccy')[0].text + #Assuming If there is no Ccy tag then it belongs to defaut currency + if not self.xpath(node, './ns:Acct/ns:Ccy'): + statement.local_currency = 'EUR' + else: + statement.local_currency = self.xpath(node, + './ns:Acct/ns:Ccy')[0].text statement.start_balance = self.get_start_balance(node) statement.end_balance = self.get_end_balance(node) number = 0 From 196cd3dec023c958d45916735e8c0965fdb9af2e Mon Sep 17 00:00:00 2001 From: Ruchir Shukla Date: Wed, 15 Oct 2014 11:08:57 +0530 Subject: [PATCH 2/3] replace fixed currency to company currency --- account_banking_camt/camt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_banking_camt/camt.py b/account_banking_camt/camt.py index b36301e9a..fb01e0505 100644 --- a/account_banking_camt/camt.py +++ b/account_banking_camt/camt.py @@ -152,7 +152,7 @@ CAMT Format parser #Assuming If there is no Ccy tag then it belongs to defaut currency if not self.xpath(node, './ns:Acct/ns:Ccy'): - statement.local_currency = 'EUR' + statement.local_currency = statement.company_id.currency_id.id else: statement.local_currency = self.xpath(node, './ns:Acct/ns:Ccy')[0].text From 510665d0b5c737f56362ab2a5849ec841cee0476 Mon Sep 17 00:00:00 2001 From: Ruchir Shukla Date: Wed, 15 Oct 2014 11:11:11 +0530 Subject: [PATCH 3/3] put space after comment --- account_banking_camt/camt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_banking_camt/camt.py b/account_banking_camt/camt.py index fb01e0505..627a0419c 100644 --- a/account_banking_camt/camt.py +++ b/account_banking_camt/camt.py @@ -150,7 +150,7 @@ CAMT Format parser identifier) ) - #Assuming If there is no Ccy tag then it belongs to defaut currency + # Assuming If there is no Ccy tag then it belongs to defaut currency if not self.xpath(node, './ns:Acct/ns:Ccy'): statement.local_currency = statement.company_id.currency_id.id else: