Possible price conversion issue with mixed-currency quotes

Denis Potapov d at potapov.id.au
Thu Oct 29 19:24:43 EDT 2026


Hi all,

I think I may have found a bug in price conversion when a price database 
contains a mix of stock prices quoted in the book’s base currency and in 
another currency.

For example, my book’s base currency is AUD, but SSS is quoted in USD on 
the exchange. In the attached screenshot, the balance sheet and price 
editor show SSS valued at 1,500 AUD, using the SSS price in USD and the 
USD-to-AUD exchange rate.

The lower part of the screenshot shows the same windows, but with one 
additional price entry: an SSS price in AUD dated earlier than the 
USD-denominated prices. The balance sheet is set to use the price 
closest to the report date, but it uses the older AUD price and values 
SSS at 1,000 AUD instead.

I traced this behavior to get_nearest_price in gnc-pricedb.cpp. The 
direct_price_conversion call appears to take precedence over 
indirect_price_conversion. I also tried changing the code to use 
indirect_price_conversion for all conversions, which seemed to avoid the 
issue.

Does this sound like a bug that should be fixed? If so, I’d be happy to 
submit a patch or pull request.

Thanks,

D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bugreport.png
Type: image/png
Size: 913550 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20261030/a27f81b0/attachment-0001.png>


More information about the gnucash-devel mailing list