Skip to content

Commit

Permalink
Fix bug when reg txn date > freq from 'end'
Browse files Browse the repository at this point in the history
Fixes bug for edge case where 'addrx' command raises error if
the first date of a new reg txn is greater than the 'end' date
(as passed to 'addrx') plus the reg txn's frequency.
  • Loading branch information
maread99 committed Feb 5, 2023
1 parent 020d2f7 commit 6b52cbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/beanahead/reconcile.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ def update_new_txns(
list of Transaction
`new_txns` as updated. Received order is NOT maintained.
"""
for (x_txn, new_txn) in reconciled_x_txns:
for x_txn, new_txn in reconciled_x_txns:
updated_txn = update_new_txn(new_txn, x_txn)
new_txns.insert(0, updated_txn)
new_txns.remove(new_txn)
Expand Down
2 changes: 1 addition & 1 deletion src/beanahead/rx_txns.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def create_entries(
end = END_DFLT if end is None else end
offset = get_freq_offset(rx_def)
dates = pd.date_range(rx_def.date, end + offset, freq=offset)
if len(dates) == 1:
if len(dates) < 2:
# no txns dated < end (only new definition date was evaluated)
return ([], None)
txns = []
Expand Down

0 comments on commit 6b52cbf

Please sign in to comment.