Skip to content

Commit

Permalink
Account reconciliation status was fixed - JalAccount.last_operation_d…
Browse files Browse the repository at this point in the history
…ate() method now ignores future transactions.
  • Loading branch information
titov-vv committed Jan 24, 2024
1 parent e557992 commit 13fb3db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jal/db/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import jal.db.closed_trade
from jal.constants import Setup, BookAccount, PredefinedAccountType, PredefinedAsset
from jal.db.country import JalCountry
from jal.db.helpers import format_decimal
from jal.db.helpers import format_decimal, now_ts


class JalAccount(JalDB):
Expand Down Expand Up @@ -198,6 +198,7 @@ def last_operation_date(self) -> int:
"LEFT JOIN accounts AS a ON o.account_id=a.id WHERE a.id=:account_id",
[(":account_id", self._id)])
last_timestamp = 0 if last_timestamp == '' else last_timestamp
last_timestamp = now_ts() if last_timestamp > now_ts() else last_timestamp # Skip future operations
return last_timestamp

# FIXME This method now looks duplicated with open_trades_list() - need some unification
Expand Down

0 comments on commit 13fb3db

Please sign in to comment.