parsers: support comma-grouped amounts in BMO parser
This commit is contained in:
		| @@ -124,7 +124,7 @@ class MBNAParser(TransactionParser): | ||||
|  | ||||
| class BMOParser(TransactionParser): | ||||
|     EXTRACT_RE = re.compile( | ||||
|         r"We want to let you know that a (withdrawal|deposit) of\s+\$(\d+\.\d{2})\s+has been made (?:to|from) your account ending\s+in\s+(\d{3})",  # noqa: E501 | ||||
|         r"We want to let you know that a (withdrawal|deposit) of\s+\$([0-9,]+\.\d{2})\s+has been made (?:to|from) your account ending\s+in\s+(\d{3})",  # noqa: E501 | ||||
|         flags=re.MULTILINE, | ||||
|     ) | ||||
|  | ||||
| @@ -146,7 +146,7 @@ class BMOParser(TransactionParser): | ||||
|         if matches is None: | ||||
|             raise TransactionParsingFailed("No matches for extraction RE") | ||||
|  | ||||
|         amount = Decimal(matches[2]) | ||||
|         amount = Decimal(matches[2].replace(",", "")) | ||||
|         if matches[1] == "withdrawal": | ||||
|             amount = amount * -1 | ||||
|         date_raw = msg["Date"] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user