parsers: credit card transactions are negative amounts
This commit is contained in:
parent
595c763932
commit
0009d98791
@ -71,7 +71,7 @@ class RogersBankParser(TransactionParser):
|
|||||||
matches = self.EXTRACT_RE.search(content)
|
matches = self.EXTRACT_RE.search(content)
|
||||||
if matches is None:
|
if matches is None:
|
||||||
raise TransactionParsingFailed("No matches for extraction RE")
|
raise TransactionParsingFailed("No matches for extraction RE")
|
||||||
amount = Decimal(matches[1].replace(",", ""))
|
amount = Decimal(matches[1].replace(",", "")) * -1
|
||||||
date_raw = matches[2]
|
date_raw = matches[2]
|
||||||
payee = matches[3]
|
payee = matches[3]
|
||||||
date = datetime.strptime(date_raw, "%b %d, %Y").date()
|
date = datetime.strptime(date_raw, "%b %d, %Y").date()
|
||||||
@ -109,7 +109,7 @@ class MBNAParser(TransactionParser):
|
|||||||
matches = self.EXTRACT_RE.search(content)
|
matches = self.EXTRACT_RE.search(content)
|
||||||
if matches is None:
|
if matches is None:
|
||||||
raise TransactionParsingFailed("No matches for extraction RE")
|
raise TransactionParsingFailed("No matches for extraction RE")
|
||||||
amount = Decimal(matches[1].replace(",", ""))
|
amount = Decimal(matches[1].replace(",", "")) * -1
|
||||||
payee = matches[2]
|
payee = matches[2]
|
||||||
date_raw = matches[5]
|
date_raw = matches[5]
|
||||||
return Transaction(
|
return Transaction(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user