Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-09-05 Thread Christopher Lam
Hi All The state of balsheet-pnl for now, imho is feature complete and has nicer well-documented internal functions. However I'm still stumped by various equity calculations, unsure how to emulate all combinations of trading/unrealized/realized gains/losses. JRalls has helpfully created some

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-17 Thread Christopher Lam
Hi David I refer you to a prior discussion: https://lists.gnucash.org/pipermail/gnucash-user/2018-June/077758.html I appreciate balance-sheet is a formal accounting report. The problem is, as always, within the details. Initially I thought we could leave currencies unconverted. Then Geert

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-16 Thread David T. via gnucash-devel
Hi, I admit that I haven’t been following the details of thsi thread that closely, but it would seem to me that if a user has selected price source “Latest,” then the report will of necessity include an Unrealized Gains line in order to balance, as John said. I agree with his suggestion that

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-16 Thread John Ralls
Chris, That’s because you used price source = “latest” which uses the most recent price in the pricedb for the purchase as well as the valuation. Regards, John Ralls > On Aug 16, 2018, at 12:58 AM, Christopher Lam > wrote: > > Hi John > > Just to be a pain again... I found a small

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-16 Thread Christopher Lam
Hi John Just to be a pain again... I found a small discrepancy - (This is different from the previously noted missing-capital-gains situation) * if trading-accounts are enabled, * a single 100AAPL purchase @ $100 each dated 01/01/18 * a new increased price $200 on 01/06/18 is recorded, *

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-14 Thread Christopher Lam
Hi John Thank you - plenty of material here for test cases. I note your observation that selling a stock at an increased price, in a book without trading-accounts, without properly booking the capital-gain to income leads to an incorrect balance-sheet. This is illus by txn-A and txn-B below.

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-13 Thread John Ralls
So I see. Even though I carefully put them at the end. Fortunately Chris should have gotten a direct copy without Mailman’s interference. Regards, John Ralls > On Aug 13, 2018, at 8:33 AM, Adrien Monteleone > wrote: > > John, > > Mailman was hungry. It ate your screenshots. > > Regards,

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-13 Thread Adrien Monteleone
John, Mailman was hungry. It ate your screenshots. Regards, Adrien > > > Chris, > > To demonstrate the price difference on assets creating an “Unrealized Gain” > line, I created a fake account with Trading Accounts off and purchased on 1 > January 100 shares of a stock for $100, then

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-13 Thread John Ralls
> On Aug 12, 2018, at 10:04 PM, Christopher Lam > wrote: > > Hi Jralls > > So just wish to double check my understanding of gnucash's data format for a > balance-sheet on date X > > There are two possibilities for displaying the right-hand-side > > Liabilities + Equity + Retained Earnings

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-13 Thread Adrien Monteleone
Sorry John, I forgot that GnuCash used the same term for the calculated amount. Yet another case where my fingers need to slow down and let my brain ponder things. Regards, Adrien > On Aug 13, 2018, at 9:08 AM, John Ralls wrote: > > Adrien, > > Yes, that’s formally correct. As I’ve said

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-13 Thread John Ralls
Adrien, Yes, that’s formally correct. As I’ve said repeatedly in this thread, GnuCash has long had a design feature that one can get a balanced Balance Sheet report without closing one’s book. The Balance Sheet report does that by summing up the expense and income accounts’ balances and

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-12 Thread Adrien Monteleone
Are not Retained Earnings part of Equity? And then, that account would only be used in a close books process, not without it. Closing the books should zero the income and expense accounts TO Retained Earnings. Regards, Adrien > On Aug 13, 2018, at 12:04 AM, Christopher Lam > wrote: > > Hi

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-12 Thread Christopher Lam
Hi Jralls So just wish to double check my understanding of gnucash's data format for a balance-sheet on date X There are two possibilities for displaying the right-hand-side 1. Liabilities + Equity + Retained Earnings + Trading Balances 2. Liabilities + Equity + Retained Earnings +

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-11 Thread John Ralls
Chris, Remember that we’ve long advised users that they need not close their books, they can run a balance sheet report for any day. IMO removing that capability would be a major breakage. I suspect that you needed to use trading accounts because you didn’t book the trading gains and losses

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-11 Thread Christopher Lam
Hi John I've managed to make the left-side (activa?) match the right-side (passiva?) https://screenshots.firefox.com/RNvkjaxnYyxpGkYn/null 1) it does require closing books on the balance-sheet date 2) it does require adding trading-accounts The existing balsheet introduces/calculates the

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-09 Thread Adrien Monteleone
> On Aug 9, 2018, at 7:37 AM, Geert Janssens wrote: > > For reports on the other hand it's not important what Gtk+ implements as the > reports are html rendered via webkit (essentially a built-in webbrowser) so > the W3C css rules matter here.. Can’t believe I didn’t remember that. This

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-09 Thread Geert Janssens
Op donderdag 9 augustus 2018 13:22:09 CEST schreef Adrien Monteleone: > > On Aug 8, 2018, at 10:02 PM, Christopher Lam > > wrote: > > > > Hi devs, > > > > > > Account Balances are either displayed indented (same as account-depth, > > with a few exceptions) or single-column. I'd rather not do

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-09 Thread Adrien Monteleone
> On Aug 8, 2018, at 10:02 PM, Christopher Lam > wrote: > > Hi devs, > > > Account Balances are either displayed indented (same as account-depth, with a > few exceptions) or single-column. I'd rather not do indenting in CSS because > I can't figure out CSS. The CSS style would be “:n

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-08 Thread Christopher Lam
Hi devs, On 09/08/18 08:32, John Ralls wrote: On Aug 8, 2018, at 8:51 AM, Geert Janssens wrote: I haven't been following every detail of this. However I note on most balance sheets the total assets doesn't match total net worth (or liabilities/equity). In most, this is fixed by including the

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-08 Thread John Ralls
> On Aug 8, 2018, at 8:51 AM, Geert Janssens wrote: > > I haven't been following every detail of this. However I note on most balance > sheets the total assets doesn't match total net worth (or > liabilities/equity). > In most, this is fixed by including the retained earnings. > > I

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-08 Thread Geert Janssens
I haven't been following every detail of this. However I note on most balance sheets the total assets doesn't match total net worth (or liabilities/equity). In most, this is fixed by including the retained earnings. I believe at least in most European countries the "left hand side" (Assets,

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-08 Thread Christopher Lam
Hi Frank, I would think if the multiple categories of accounts are desired, they should be designed in the Chart of Accounts rather than the balance sheet. At least this is what I'd design my book as, rather than trying to code various formulas in scheme. I've rendered the same test book

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-07 Thread Frank H. Ellenberger
Hi Adrien, Am 31.07.2018 um 02:27 schrieb Adrien Monteleone: > Frank, > > I’ve been following this for a while, and perhaps I’m not understanding, but > are the groupings just presentational? Usually the sums of this groups are economic indicators, e.g. if current assets < current liabilities

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-07 Thread Adrien Monteleone
> On Aug 7, 2018, at 5:00 PM, Frank H. Ellenberger > wrote: > > > > No, the grouping should be part of the account template - at least in > the current state. At some point in the future one could think about > additional account attributes to improve reporting... > I think this is only a

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-07 Thread Frank H. Ellenberger
Am 06.08.2018 um 14:40 schrieb Christopher Lam: > > (*: we all know Gnucash has evolved through generations rather than a > grand design ) ... because there is no all-purpose, all-country grand design. > 1) Frank et al requests some analysis of accounts for grouping into > Short/Long, etc. I

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-06 Thread Christopher Lam
Hi All Thank you for feedback - I *do* take all feedback into account, even if I don't always agree with them-- and this is from my understanding of Gnucash evolution(*) rather from any expert knowledge of accounting. (*: we all know Gnucash has evolved through generations rather than a

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-06 Thread Geert Janssens
Op dinsdag 31 juli 2018 03:04:25 CEST schreef Adrien Monteleone: > I see too that some child amounts show in two currencies but not others. > (looks like just the GBP accounts) Is this intended or just an illustration > (or an omission)? I think this is to illustrate how the report would look if

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-06 Thread Geert Janssens
Op vrijdag 27 juli 2018 15:01:17 CEST schreef Christopher Lam: > Latest iteration of balsheet > > * restored amount-indenting. IMHO this is now producing sane indenting > for any subtotal strategy For a completely different idea: is indenting something that could be handled with a css

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-06 Thread Adrien Monteleone
Chris, Here are my impressions and questions, perhaps I’m not understanding what you were trying to show with the screenshot. (does this contain illustrations of multiple presentation possibilities all-in-one or is this intended as how the report will look by default?) The asset summary at

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-08-06 Thread Adrien Monteleone
Frank, I’ve been following this for a while, and perhaps I’m not understanding, but are the groupings just presentational? If that’s the case, I would think the place to address this is in the report options, not the account structure. (you could use any structure you need, and easily

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-07-27 Thread Christopher Lam
Latest iteration of balsheet * restored amount-indenting. IMHO this is now producing sane indenting for any subtotal strategy * restore dual columns (i.e. left=asset/income, right=liability/expense) * the above two only enabled when multicols are disabled * option to toggle amount/account

[GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-07-25 Thread Frank H. Ellenberger
Am 19.07.2018 um 13:09 schrieb Christopher Lam: > Hi Frank > Thank you - I can restore the dual-columns when the periods have been > disabled. > I'd prefer to limit the number of options; so, if the "period duration" is > disabled, the report will automatically show dual columns while intl. IFRS

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-07-19 Thread Christopher Lam
Hi Frank Thank you - I can restore the dual-columns when the periods have been disabled. I'd prefer to limit the number of options; so, if the "period duration" is disabled, the report will automatically show dual columns (Asset/Income=left, Liability+Equity/Expense = right). This works? Can you

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-07-18 Thread Frank H. Ellenberger
Hi Chris, Am 18.07.2018 um 15:13 schrieb Christopher Lam: > The state of balsheet-pnl.scm, is as follows: > > I think it is stable and featureful enough to be a replacement, but > there are no tests yet to validate a transition. This may happen over > the next few months. > > It incorporates

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-07-18 Thread Christopher Lam
The state of balsheet-pnl.scm, is as follows: I think it is stable and featureful enough to be a replacement, but there are no tests yet to validate a transition. This may happen over the next few months. It incorporates all balance-sheet.scm and income-statement.scm functionality with the

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-07-04 Thread Christopher Lam
Still at https://raw.githubusercontent.com/christopherlam/gnucash/maint-balsheet-pnl/gnucash/report/standard-reports/balsheet-pnl.scm Latest - removed accountname formatting in recursive-bal. Now they are styled normally but the amounts are bold/bigger if they contain children-amounts.

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-07-04 Thread Christopher Lam
Oops https://screenshots.firefox.com/pttTjFEtYTJLXzam/null Sorry for spam, fixed screenshot On 04/07/18 21:20, Christopher Lam wrote: Forgot to include a screenshot to illustrate https://screenshots.firefox.com/Z7HOv5pb2qbRc5NP/null - recursive balance vs. multilevel (and saner alignment

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-07-04 Thread Christopher Lam
Forgot to include a screenshot to illustrate https://screenshots.firefox.com/Z7HOv5pb2qbRc5NP/null - recursive balance vs. multilevel (and saner alignment of numbers) - common-currency vs. original currency (notice better handling of missing USD/GBP prices than balance-sheet.scm) - for this

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-07-04 Thread Christopher Lam
I've restored multilevel-subtotals... using an easier tack than previously: instead of keeping lists(1 per account-depth) of lists (1 per column) of collectors, it'll just climb up the hierarchy and print parent acc's balance+children until the next account-depth is reached. Please help beta

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-07-03 Thread Christopher Lam
Broadly yes, one approach is that parent accounts always show totals for themselves+children, the other approach is the totals appear after each parent+children. Same information presented in 2 different ways. The difference is that the recursive subtotals are easier When reaching an

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-07-03 Thread Geert Janssens
Op dinsdag 3 juli 2018 02:57:50 CEST schreef Christopher Lam: > Hi Stephen, Dave > > Thank you - > > Dave - the changes are merely cosmetic therefore easy. > > It sounds there are still 2 desired presentational types - (1) Dave's > approach = *recursive-bal* - 'parent' accounts generally

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-07-02 Thread Christopher Lam
Hi Stephen, Dave Thank you - Dave - the changes are merely cosmetic therefore easy. It sounds there are still 2 desired presentational types - (1) Dave's approach = *recursive-bal* - 'parent' accounts generally collect their children account amounts; if they also have their own amount, the

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-07-02 Thread DaveC49
Chris, I have the multicolumn report up and running in V3.2. In addition to adding your file I also had to incorporate it in the CMakeLists.txt in ~/gnucash/report/standard-reports to have it available from the menu. Initially I will just comment on the presentation, as I don't have a testfile

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-06-24 Thread John Ralls
Chris, OK, I think that’s a good choice. As a general design principle I’d like to see the reports use QofQuery as much as possible--and extend QofQuery as necessary--because that makes it easier to reimplement as database queries. Regards, John Ralls > On Jun 24, 2018, at 2:50 AM,

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-06-24 Thread Christopher Lam
Seeking beta testers. This will not be in v3.2. https://github.com/christopherlam/gnucash/tree/maint-balsheet-pnl Or, anyone with a relatively recent maint can copy the file directly into the build's standard-reports folder:

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-06-24 Thread Christopher Lam
I think I'll forego a noclosing_balance upgrade in C. According to https://bugzilla.gnome.org/show_bug.cgi?id=570042 the "Closing Entries" transactions did not always receive a special KVP-based flag until the commit on https://github.com/Gnucash/gnucash/commit/4b2800145 on datafiles

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-06-23 Thread Christopher Lam
Hi John, the split->noclosing_balance is updated in xaccAccountRecomputeBalance. Will continue copypasta coding until it works! On Sat, 23 Jun 2018, 23:56 John Ralls wrote: > > > > On Jun 22, 2018, at 9:42 PM, Christopher Lam > wrote: > > > > Hi All > > > > I'm working through

Re: [GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-06-23 Thread John Ralls
> On Jun 22, 2018, at 9:42 PM, Christopher Lam > wrote: > > Hi All > > I'm working through balance-sheet.scm and overhauling this report. > > At the same time, I can see that balance-sheet.scm and income-statement.scm > can be merged together. > > After all > > * balance sheet =

[GNC-dev] New balsheet (and P report), API considerations, and (slow?) KVP in Account.cpp

2018-06-22 Thread Christopher Lam
Hi All I'm working through balance-sheet.scm and overhauling this report. At the same time, I can see that balance-sheet.scm and income-statement.scm can be merged together. After all * balance sheet = asset/liability/equity balance at date X, * income statement = difference in