After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 107929 - RFE: need an "open subaccount" variant that produces a basic ledger view
RFE: need an "open subaccount" variant that produces a basic ledger view
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Register
unspecified
Other All
: Normal enhancement
: ---
Assigned To: David Hampton
Chris Shoemaker
: 107930 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-03-09 18:41 UTC by Paolo Benvenuto
Modified: 2018-06-29 20:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The way moneysmith shows splitted txns (149.29 KB, image/png)
2006-03-16 21:04 UTC, Paolo Benvenuto
  Details
running balance from multiple accounts txn (146.15 KB, image/png)
2006-03-16 22:12 UTC, Paolo Benvenuto
  Details
Adds a balance column to the "Open Subaccounts" register with the running balance. (8.68 KB, patch)
2009-09-04 05:08 UTC, Tim M
none Details | Review
Update to the first patch, has some improvements. (9.19 KB, patch)
2009-09-06 23:57 UTC, Tim M
none Details | Review
RC3 of reg_run_balance patch, a couple minor fixes/improvements (9.35 KB, patch)
2009-09-08 03:07 UTC, Tim M
committed Details | Review

Description Paolo Benvenuto 2003-03-09 18:41:54 UTC
Opening an account with its subaccounts produces a double line register
window .
However, such a window doesn't permit to know the account balance: I'm
referring to the balance of the account with all its subaccounts, as the
column total in the principal account window.

It would be very useful to have such a register view:

date   num  description transfer
Comment 1 Paolo Benvenuto 2004-09-08 19:14:32 UTC
Opening an account with its subaccounts produces a double line register
window .
However, such a window doesn't permit to know the account balance: I'm
referring to the balance of the account with all its subaccounts, as the
column total in the principal account window.

It would be very useful to have such a register view:

date   num  description   account-from  account-to  transferred-money   balance

The account-from is the cash/bank/etc. account, or, in case that there is such
one, the primary account of the txn.

The trasferred-money is a +/- amount, considered with reference to the account-to.

The balance would be the global balance of the account whose sub-accounts are
considered, calculated with all the sub-accounts txns.

This way one could see the variation of a parent account with all its child
accounts along the dates.

Comment 2 Chris Shoemaker 2006-03-16 19:52:00 UTC
*** Bug 107930 has been marked as a duplicate of this bug. ***
Comment 3 Chris Shoemaker 2006-03-16 19:56:36 UTC
Q1: How should this handle sub-accounts whose commodities differ from their
parent's?

Q2: Does this really need to be a data-entry register? or can it be read-only,
such as a report?
Comment 4 Paolo Benvenuto 2006-03-16 21:03:20 UTC
(In reply to comment #3)
> Q1: How should this handle sub-accounts whose commodities differ from their
> parent's?

I remember I used it in MoneySmith, it showed the fields the way I show in the attacchment

> Q2: Does this really need to be a data-entry register? or can it be read-only,
> such as a report?

No, for me it could be simply a read-only register. It would be useful in order to see the running balance for the account and sub-accounts.

Now it is possible to see the account and subaccounts balance only for the current date.

Comment 5 Paolo Benvenuto 2006-03-16 21:04:37 UTC
Created attachment 61392 [details]
The way moneysmith shows splitted txns
Comment 6 Paolo Benvenuto 2006-03-16 21:05:18 UTC
In the attachment I have two txn, a two-splitted one and a no-splitted one.
Comment 7 Paolo Benvenuto 2006-03-16 22:04:11 UTC
Excuse me, the former attacchmente was wrong. It's to delete.
Comment 8 Paolo Benvenuto 2006-03-16 22:12:02 UTC
Created attachment 61399 [details]
running balance from multiple accounts txn

This png image describes what could be the work to do:

All the txns referring to the subaccounts are shown, and in the last column a running balance of the account and subaccounts is calculated, in the same form it is calculated in the main account window when balance of accounts and sub accounts is requested.

Hope this explication is useful and understandable.
Comment 9 Christian Stimming 2006-03-17 09:22:15 UTC
But if a read-only overview is enough for you, then doesn't a "transaction report" already fulfil your request? Open a "transaction report", choose the parent account and all its subaccounts, and then there should be a running balance for everything. What other feature would be missing there?
Comment 10 Paolo Benvenuto 2006-03-17 10:29:35 UTC
Well, we have the "account and its sub acconts" register, that is generated rapidly and in a very simple (from the user point of view) way, and with a fine style, similar to a single account register.

It's true, we have also the reports, that supposes that you go and choose the right report, then wait for the first report run be generated (10 min. with > 1000 accounts), click on the options, click on the accounts tab, go and look for the proper accont, mark the sub accounts flag, verify you have all the other options set in the right manner, and then run the report.... You have then a html formatted report, which is fine for exporting but not for consulting, and searching, but it's terribly difficult to generate.

The second way requires the user a work, and is very complicated. A novice user never would generate such a report.

On the contrary, the first would be accessible with a menu entry, and all the parameters would be set in the right manner.

And actually the hacking work to be done would be:
- Pick the account and its sub accounts register code
- put the register pair on the same line, or maybe let them on 2 lines as they are now in the account and its sub accounts register
- add the "total" balance in the last column, at the end of the tnx

If the 2 txns are put on the same line, a little difficulty could be when a txn involves > 2 accounts. Obviously, 2 accounts would be shown in the 1st line, the 3rd in the 2dn, etc., and the total balance would be shown only once for the txn.

Maybe letting them as they are now would simplify the task.

Actually the feature I think it's important is the possibility to see a running total balance for an account and all its subaccounts, calculated the same way (the same code?) as it's calculated in the "total" column of the main accounts tab.
Comment 11 Paolo Benvenuto 2006-05-28 18:26:10 UTC
If I remember, I put a US$ 100.00 bounty on this bug.

If I hadn't, I put it now.

A preliminary version of the solution (the first US$ 50.00 of the bounty) could correspond to the actual account and subaccount register, with one more column showing the "total" balance of the base account (where "total" is to understand the way is used in the corresponding column of the accounts window).

In other word it would be adding one more column showing, for example on the last line of the txn, the total balance for the base account.
Comment 12 Tim M 2009-09-04 05:08:46 UTC
Created attachment 142449 [details] [review]
Adds a balance column to the "Open Subaccounts" register with the running balance.

This patch adds a Balance column (similar to the single account register) which provides a total running balance of the parent account and all subaccounts.

This patch was created against an SVN trunk snapshot of unstable 3.1.

This patch needs testing, but works for me!
Comment 13 Tim M 2009-09-06 23:57:10 UTC
Created attachment 142607 [details] [review]
Update to the first patch, has some improvements.

This patch improves the original "RC1" patch in the following ways:
1. reg_run_balance_RC2.diff adds the gnc_split_register_get_rbaln() function, whose code was originally duplicated in the gnc_split_register_get_balance_fg_color() and gnc_split_register_get_rbaln_entry() functions in the first patch.

2. Modified the gnc_split_register_get_tdebcred_entry() function to display the debit/credit amount for the register's parent account and all subaccounts when the GENERAL_LEDGER register is in use (used by Show Subaccounts feature).

3. Added the get_trans_total_amount_subaccounts() function which returns the total amount of a transaction for the register's parent account and all subaccounts.
Comment 14 Tim M 2009-09-08 03:07:26 UTC
Created attachment 142671 [details] [review]
RC3 of reg_run_balance patch, a couple minor fixes/improvements

OK, here is one more update...  reg_run_balance_RC3.diff includes the following update(s):

1. Minor code cleanup

2. Fixed issue where 'negative' accounts such as the Equity accounts would show up with negative balances (negative balances would be positive and positive would be negative), but would have the correct color in "Open Subaccounts" view.  They now have the correct color and balance.

3. Fixed "Open Subaccounts" view for Income/Expense accounts which would not display debit/credit totals for transactions.

Only 'issue' left is clean-up for the overall Tools->General Ledger register. The General Ledger now displays a 'Balance' column because it is of the GENERAL_LEDGER type, but always has a $0.00 balance because transactions will always balance out.  So, a new ledger type (SUBACCOUNTS_LEDGER) may be necessary to be used for the 'open subaccounts' view so that the general ledger can be left without a balance column, or the GENERAL_LEDGER type could sift out the balance column based on the ld->type property, although I'm uncertain of how to do this myself.  The current behavior of the General Ledger register is not a bug, however, although ideally the Balance column would not be displayed in this register.  I opted not to create a new ledger type for this patch, since it could perhaps more easily be done if it is possible to compare the ld->type and only display the balance column for the GENERAL_LEDGER if the ld->type == LD_SUBACCOUNTS.
Comment 15 Christian Stimming 2009-09-18 20:04:58 UTC
Unfortunately this patch currently runs into compiler errors:

cc1: warnings being treated as errors
../../../../src/register/ledger-core/split-register-model.c: In function 'gnc_split_register_get_rbaln_entry':
../../../../src/register/ledger-core/split-register-model.c:1627: warning: implicit declaration of function 'gnc_split_register_print_info'
../../../../src/register/ledger-core/split-register-model.c:1627: error: incompatible type for argument 2 of 'xaccPrintAmount'
make[5]: *** [split-register-model.lo] Error 1
make[5]: Leaving directory `/home/chs/org/gnucash/git/trunk/build-hbci/src/register/ledger-core'

Maybe one of the recent commits incidentally renamed exactly these functions? Sorry for that.
Comment 16 Christian Stimming 2009-09-20 20:04:36 UTC
Comment on attachment 142671 [details] [review]
RC3 of reg_run_balance patch, a couple minor fixes/improvements

r18325, thanks a lot! I was able to fix the compiler error by myself (as I also caused it by committing another bugfix), see commit  message: need to use gnc_account_print_info() instead of the removed gnc_split_register_print_info().
Comment 17 Christian Stimming 2009-09-20 20:06:03 UTC
Can this be considered solved, as Tim M's patch is now in trunk?
Comment 18 Tim M 2009-09-26 18:48:29 UTC
I do believe it fulfills the original requirements:

"However, such a window doesn't permit to know the account balance: I'm
referring to the balance of the account with all its subaccounts, as the
column total in the principal account window."
Comment 19 John Ralls 2018-06-29 20:29:49 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=107929. Please update any external references or bookmarks.