Skip to content

Commit

Permalink
Merge pull request #7 from tarioch/bugfix/wrong_base_ccy_calc
Browse files Browse the repository at this point in the history
Base ccy is amount * fxRate not / fxRate
  • Loading branch information
tarioch authored Jan 18, 2020
2 parents 92c98b8 + cda4e5f commit dda105f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tariochbctools/plugins/generate_base_ccy_prices.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def generate(entries, options_map, baseCcy):
for entry in entries:
if isinstance(entry, data.Price) and entry.amount.currency != baseCcy:
fxRate = prices.get_price(priceMap, tuple([entry.amount.currency, baseCcy]), entry.date)
priceInBaseCcy = amount.Amount(entry.amount.number / fxRate[1], baseCcy)
priceInBaseCcy = amount.Amount(entry.amount.number * fxRate[1], baseCcy)

additionalEntries.append(data.Price(
entry.meta,
Expand Down

0 comments on commit dda105f

Please sign in to comment.