strip all kind of spaces, check decimal values signs
This commit is contained in:
parent
87a58baa50
commit
7559a4c93d
1 changed files with 4 additions and 4 deletions
|
|
@ -39,7 +39,7 @@ class FrenchTransaction(Transaction):
|
||||||
"""
|
"""
|
||||||
Clean a string containing an amount.
|
Clean a string containing an amount.
|
||||||
"""
|
"""
|
||||||
return text.replace(' ', '').replace('.','') \
|
return text.replace(' ', '').replace('.','').replace(u'\xa0', '') \
|
||||||
.replace(',','.').strip(u' \t\u20ac\xa0\x80€\n\r')
|
.replace(',','.').strip(u' \t\u20ac\xa0\x80€\n\r')
|
||||||
|
|
||||||
def set_amount(self, credit='', debit=''):
|
def set_amount(self, credit='', debit=''):
|
||||||
|
|
@ -53,9 +53,9 @@ class FrenchTransaction(Transaction):
|
||||||
debit = self.clean_amount(debit)
|
debit = self.clean_amount(debit)
|
||||||
|
|
||||||
if len(debit) > 0:
|
if len(debit) > 0:
|
||||||
self.amount = - Decimal(debit)
|
self.amount = - abs(Decimal(debit))
|
||||||
else:
|
else:
|
||||||
self.amount = Decimal(credit)
|
self.amount = abs(Decimal(credit))
|
||||||
|
|
||||||
def parse(self, date, raw):
|
def parse(self, date, raw):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue