Is there any way I can customise/move columns in an Account Register just like you can do so in the Account Tab Display

Jim Martin jmartin9 at frontiernet.net
Wed Jan 22 14:14:45 EST 2014


I want to report 'success' as far as I can tell (but who knows what darkness..)

Sorry for being tardy in posting (12/5/2013) it has taken me a while to wade through 
things and get a successful recompiling (see overview below in code comments).

First of all, thanks to those, particularly Derek Atkins and John Ralls, 

who replied to my post and offered suggestions
[--  I really had gotten tired of waiting (?2 years) for the register code re-write

--   and that sort of thing is way beyond my abilities / time resources]

Since I don't use many features of gnucash, it may be that I simply don't 
know if this simple 'individual fix'  broke something else.
I will probably run both 'old' and 'new' for a while to make sure data loss doesn't happen
---My goal was not to learn the scheme or guile language or write a 'report'
---nor to print out stuff from mysql (the precompiled debian package did not handle it anyway)
---nor to learn the whole structure of gnucash code  (what an incredible thought!)
--But to make a quick and dirty patch for my own simple usability need 

My very limited abilities now enable me to see things onscreen pretty much the
way my two banks lay it out for online activity - which is what I wanted and is very helpful.

(unfortunately the one bank lists in reverse chronological order also, 
and if one changes the date sort order --  the balance column disappears on their
online display - not very friendly either, but ho hum)

One final hint for other frustrated newbies -  I now have to start the program 
from a terminal using the invocation:

    gnucash-env gnucash &

I'm sure theres a better way, but I just lack the time to wade through another
forest

#Code below is from  directory gnucash-2.4.12/src/register/ledger-core/
#
#in file    split-register-layout.c    lines 80-118  
#
#changing columns '5' and '6' - but  Nothing Else
#   [for example
#                    gnc_table_layout_set_cell (layout, curs, FDEBT_CELL, 0, 5)]
#  is changed to:    gnc_table_layout_set_cell (layout, curs, FDEBT_CELL, 0, 6)]
#
#I continued the reversal of   '5' and '6'  through line 170
#
#I got this source code from a debian/ubuntu/mint repository (?for raring) using
#
#sudo apt-get source gnucash
#
#I had previously tried compiling 2.4.14 from a tarball source on sourceforge
#and also tried compiling from a clone on github of 2.6.0
#
#neither of those worked due to dependency hell and compiler errors  
#(compiling on Linux Mint 15 - cinnamon on an old Dell Latitude D410 laptop)
#
#The debianized 2.4.12 source, however, did compile with the changes below!!

static void
gnc_split_register_set_cells (SplitRegister *reg, TableLayout *layout)
{
    CellBlock *curs;
    CellBlock *curs_last;

    switch (reg->type)
{
    case BANK_REGISTER:
    case CASH_REGISTER:
    case ASSET_REGISTER:
    case CREDIT_REGISTER:
    case LIABILITY_REGISTER:
    case INCOME_REGISTER:
    case EXPENSE_REGISTER:
    case EQUITY_REGISTER:
    case TRADING_REGISTER:
    {
        curs = gnc_table_layout_get_cursor (layout,
                                            CURSOR_SINGLE_LEDGER);

        gnc_table_layout_set_cell (layout, curs, DATE_CELL,  0, 0);
        gnc_table_layout_set_cell (layout, curs, NUM_CELL,   0, 1);
        gnc_table_layout_set_cell (layout, curs, DESC_CELL,  0, 2);
        gnc_table_layout_set_cell (layout, curs, MXFRM_CELL, 0, 3);
        gnc_table_layout_set_cell (layout, curs, RECN_CELL,  0, 4);
        if (reg->is_template)
        {
            gnc_table_layout_set_cell (layout, curs, FDEBT_CELL, 0, 6);
            gnc_table_layout_set_cell (layout, curs, FCRED_CELL, 0, 5);
        }
        else
        {
            gnc_table_layout_set_cell (layout, curs, DEBT_CELL,  0, 6);
            gnc_table_layout_set_cell (layout, curs, CRED_CELL,  0, 5);
        }
    
 
Jim Martin has sent this e-mail to you.


More information about the gnucash-user mailing list