Skip to content

Commit

Permalink
Merge pull request #22 from 3v1n0/handle-empty-balance
Browse files Browse the repository at this point in the history
revolut: Handle empty balance fields
  • Loading branch information
mlaitinen authored May 7, 2024
2 parents f6d33cd + b6b3032 commit 82463c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ofxstatement/plugins/revolut.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def parse_record(self, line: List[str]) -> Optional[StatementLine]:
stmt_line = super().parse_record(line)

# Generate a unique ID
balance = self.parse_float(line[c["Balance"]])
balance_content = line[c["Balance"]]
balance = self.parse_float(balance_content) if balance_content else 0
stmt_line.id = md5(f"{stmt_line.date}-{stmt_line.payee}-{stmt_line.amount}-{balance}".encode())\
.hexdigest()

Expand Down

0 comments on commit 82463c6

Please sign in to comment.