From 79374d9a6393385c5c4511304774bb3ec060715d Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Sun, 13 Dec 2020 11:41:25 -0700 Subject: [PATCH] Remove balance date hack. --- beancount_import/source/schwab_csv.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/beancount_import/source/schwab_csv.py b/beancount_import/source/schwab_csv.py index 9f3475d6..f7209738 100644 --- a/beancount_import/source/schwab_csv.py +++ b/beancount_import/source/schwab_csv.py @@ -453,15 +453,6 @@ def get_narration_prefix(self) -> str: return "BUYSTOCK" -# TODO Hack: I usually download positions in the evening, but my beancount files are -# structured with balances before transactions, which means they are effectively -# start-of-day balances (and changing that now would require retroactively changing dates -# on lots of transactions and/or balances). So for now just add one day to date of all -# balance entries. Best option might be to check time on positions CSV and add one day if -# the positions CSV is from sufficiently late in the day? -ONE_DAY = datetime.timedelta(days=1) - - @dataclass(frozen=True) class RawPosition: date: datetime.date @@ -481,7 +472,7 @@ def get_balance(self, account: str) -> BalanceEntry: assert qty is not None amount = Amount(Decimal(str(qty)), currency=self.symbol) return BalanceEntry( - date=self.date + ONE_DAY, + date=self.date, account=f"{account}:{self.symbol}", amount=amount, filename=self.filename,