Skip to content

Commit

Permalink
Correction of mistakes introduced by renamed methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
titov-vv committed May 23, 2024
1 parent 58de81a commit 8bc5e95
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion jal/data_export/tax_reports/russia.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from decimal import Decimal
from jal.constants import PredefinedAsset, PredefinedCategory
from jal.db.helpers import remove_exponent
from jal.db.operations import LedgerTransaction, AssetPayment, CorporateAction
from jal.db.asset import JalAsset
from jal.db.category import JalCategory
Expand Down
2 changes: 1 addition & 1 deletion jal/db/tax_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def prepare_tax(self):
profit_rub = Decimal('0')
value_rub = Decimal('0')
for position in positions:
qty = position.qty()
qty = position.open_qty()
price = position.open_price()
o_rate = account_currency.quote(position.open_operation().settlement(), tax_currency)[1]
position_profit = qty * (self.quote - price)
Expand Down
4 changes: 2 additions & 2 deletions jal/widgets/price_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def load_open_trades(self, account, asset, end_time):
text = ''
operation = trade.open_operation()
if operation.type() == LedgerTransaction.Trade:
if trade.qty() >= 0:
if trade.open_qty() >= 0:
marker_color = CustomColor.LightGreen
text = self.tr("Buy")
else:
Expand All @@ -131,7 +131,7 @@ def load_open_trades(self, account, asset, end_time):
trades.append({
'timestamp': operation.timestamp() * 1000, # timestamp to ms
'price': trade.open_price(),
'qty': trade.qty(),
'qty': trade.open_qty(),
'color': marker_color,
'text': text
})
Expand Down

0 comments on commit 8bc5e95

Please sign in to comment.