<div dir="ltr"><div>Hi Sherlock,</div><div>Thanks for the reminder! I have submitted the bug.</div><div><br></div><div>Chang</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Sep 2, 2025 at 7:57 PM Sherlock Holmes <<a href="mailto:sh025622@gmail.com">sh025622@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Chang,<br>
<br>
If you haven't already, you may want to try to complete the registration <br>
function again and file your bug on Bugzilla.<br>
<br>
If you're not able, let me know and I'll attempt to file it for you.<br>
<br>
Regards,<br>
<br>
Sherlock<br>
<br>
<br>
On 8/23/25 1:43 PM, Chang Wang wrote:<br>
> Hi all,<br>
> I noticed an issue with the Trial Balance report when using stock <br>
> trading and multiple currencies. Even when transactions are balanced, <br>
> the Trial Balance report appears to break due to incorrect calculation <br>
> of unrealized gains.<br>
><br>
> I've attached an uncompressed minimal example to illustrate the problem.<br>
><br>
> Steps to reproduce:<br>
> Open the attached book.<br>
> Generate a Trial Balance report with reporting currency set to USD, <br>
> price source set to Last up through report date, and enable Show <br>
> Foreign Currencies and Exchange Rates.<br>
><br>
> Observed behavior:<br>
> The report shows an Unrealized Gain of $20,800, which is incorrect.<br>
><br>
> Expected behavior:<br>
> The Unrealized Gain should be $200.<br>
><br>
> Explanation:<br>
> The example contains three transactions:<br>
> 1) 08/02/2025 - Buy one stock for 10,200 JPY.<br>
> 2) 08/03/2025 - Exchange 100,000 JPY for 100,000 USD.<br>
> 3) 08/04/2025 - Buy one stock for 10,400 JPY.<br>
><br>
> The JPY/USD rate is fixed at 1 on all days, so there should be no <br>
> realized or unrealized currency gains. Stock prices are set at 10X00 <br>
> JPY on 08/0X/2025, where X = 1, 2, 3, 4.<br>
><br>
> Therefore, in USD reporting currency, the Trial Balance should show <br>
> unrealized gains as:<br>
> (10,400 * 2) - 10,200 - 10,400 = 200 JPY = 200 USD<br>
><br>
> Notably, the Balance Sheet report does display the correct unrealized <br>
> gain. And if transaction 3) or transaction 2) is removed, the Trial <br>
> Balance turns out to be correct.<br>
><br>
> I'm not familiar with Scheme, so I wasn't able to locate the problem <br>
> in the source code. I also wasn't able to file a bug on Bugzilla, <br>
> since the registration function appears to be broken.<br>
><br>
> Thanks for your attention,<br>
> Chang<br>
><br>
> _______________________________________________<br>
> gnucash-devel mailing list<br>
> <a href="mailto:gnucash-devel@gnucash.org" target="_blank">gnucash-devel@gnucash.org</a><br>
> <a href="https://lists.gnucash.org/mailman/listinfo/gnucash-devel" rel="noreferrer" target="_blank">https://lists.gnucash.org/mailman/listinfo/gnucash-devel</a><br>
</blockquote></div>