Unbalanced balance sheet, "Trading Gains", #537476

Mike Alexander mta at umich.edu
Tue Dec 1 00:32:20 EST 2009


--On November 30, 2009 6:38:23 PM -0500 Phil Longstaff 
<plongstaff at rogers.com> wrote:

> On Mon, 2009-11-30 at 18:09 -0500, Mike Alexander wrote:
>> --On November 30, 2009 3:25:06 PM -0500 Forest Bond
>> <forest at alittletooquiet.net> wrote:
>>
>> > Hi,
>> >
>> > On Mon, Nov 30, 2009 at 01:13:14PM -0500, Forest Bond wrote:
>> >> > It should  be impossible to get a "Trading Gains" or "Trading
>> >> > Losses" line in the  balance sheet report unless you have at
>> >> > least one trading account.
>> >
>> > I snooped around a little in balance_sheet.scm.  Here's what I
>> > know:
>> >
>> > * trading-accounts is an empty list.
>> > * neg-trading-balance is non-zero.
>> >
>> > That means that this expression:
>> >
>> > (gnc:accountlist-get-comm-balance-at-date trading-accounts date-tp)
>> >
>> > Is returning a non-zero commodity collector.  Is it possible that
>> > gnc:accountlist-get-comm-balance-at-date incorrectly handles an
>> > empty account list?  That's what it looks like to me, but it seems
>> > like that would break a lot of reports, right?
>> >
>> > I don't know the code well enough to see what could cause that
>> > problem.
>>
>> Thanks for doing the research to isolate the problem.  I think I
>> know  what's causing it and should have a fix later tonight or
>> tomorrow.
>
> I'm ready to release 2.3.8 any time.  Please let me know as soon as
> you can whether you want me to hold off releasing it for you or if
> you think the fixes will be more extensive.

I just checked in a change (r18455) that should fix this problem.  Let 
me know if it's still broken.  I still don't know what's causing the 
problem that Christian describes in 
<https://bugzilla.gnome.org/show_bug.cgi?id=537476#c26>.  Until I can 
figure that one out we'll need to leave qof_book_use_trading_accounts 
ifdefed out.  In other words, I don't think anything is holding up 
2.3.8.  I wish I could figure out what's causing this problem, but it's 
a mystery right now.

          Mike




More information about the gnucash-user mailing list