mirror of
https://github.com/we-promise/sure.git
synced 2026-05-29 15:34:58 +00:00
Add Interactive Brokers Provider (#1722)
* Display multi-currency holdings correctly * Implement IBKR provider * Fix: Use historical exchange rate for historical prices * Add brokerage exchange rate for trades * Sync historical balances from IBKR * Add logos in activity history * Fix privacy mode blur in account view * Improve IBKR XML Flex report parser errors
This commit is contained in:
committed by
GitHub
parent
3c4c32584a
commit
ce5d7dd736
@@ -37,10 +37,7 @@ class Balance::SyncCache
|
||||
@converted_entries ||= account.entries.excluding_split_parents.includes(:entryable).order(:date).to_a.map do |e|
|
||||
converted_entry = e.dup
|
||||
|
||||
# Extract custom exchange rate if present on Transaction
|
||||
custom_rate = if e.entryable.is_a?(Transaction)
|
||||
e.entryable.extra&.dig("exchange_rate")
|
||||
end
|
||||
custom_rate = e.entryable.exchange_rate if e.entryable.respond_to?(:exchange_rate)
|
||||
|
||||
# Use Money#exchange_to with custom rate if available, standard lookup otherwise
|
||||
converted_entry.amount = converted_entry.amount_money.exchange_to(
|
||||
|
||||
Reference in New Issue
Block a user