Skip to content

Commit

Permalink
Remove balance date hack.
Browse files Browse the repository at this point in the history
  • Loading branch information
carljm committed Dec 13, 2020
1 parent 952c3aa commit 79374d9
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions beancount_import/source/schwab_csv.py
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 79374d9

Please sign in to comment.