Skip to content

Commit

Permalink
fix: schwab_csv_creditline balance sign
Browse files Browse the repository at this point in the history
  • Loading branch information
redstreet committed Apr 10, 2024
1 parent e82d4c5 commit cc6feaf
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Schwab Credit Line (eg: Pledged Asset Line) .csv importer."""

from beancount_reds_importers.importers.schwab import schwab_csv_checking
from beancount_reds_importers.libtransactionbuilder import banking


class Importer(schwab_csv_checking.Importer):
Expand All @@ -12,3 +13,9 @@ def custom_init(self):
self.column_labels_line = (
'"Date","Type","CheckNumber","Description","Withdrawal","Deposit","RunningBalance"'
)

def get_balance_statement(self, file=None):
"""Return the balance on the first and last dates"""

for i in super().get_balance_statement(file):
yield banking.Balance(i.date, -1 * i.amount, i.currency)

0 comments on commit cc6feaf

Please sign in to comment.