[GNC] Starting a new year

gnucash at 4forl1st5.slmail.me gnucash at 4forl1st5.slmail.me
Tue Jan 9 18:43:18 EST 2024


On Wednesday, January 10th, 2024 at 03:14, Grace <grace at bernevyl.com> wrote: 
> 
> Hello,
> 
> I am just wondering how folks are dealing with starting a new year?
> 
> Finishing 2023 I think is easy. You just stop using it.
> 
> However, how do I start 2024 with the finishing balances of 2023? Do I
> have set up a brand new set of accounts, or is there a way of doing this
> that I have not found?
> 
> Grace

If you are

1) Saving your GnuCash files as uncompressed XML
2) Happy editing files in a TXT editor, then the following may be of some use

then it's not too hard to start over and, as long as you keep a copy of
the "previous year" then you can't lose anything when trying it out.

Create a new tree of accounts fron (let's say ongoing.gnucash)

File->Export-Export Accounts   (save as account_tree.gnucash)

Copy account_tree.gnucash to new_yeargnucash

Copy ongoing.gnucash to old_year.gnucash

The next bits are probably best viewed in a monospcaed font 
as I have tried to line up the actions in each of the files:

old_year.gnucash                               new_year.gnucash

Grab from <gnc:template-transactions>

to last  </gnc:schedxaction>
         </gnc:book>

                                         Add to end of file

Grab the   <gnc:count-data cd:type="schedxaction">5</gnc:count-data>
count data 
line for the 
schedexaction

                                         Add after the 
                                         <gnc:count-data cd:type="commodity">
                                         <gnc:count-data cd:type="account">
                                         lines

Grab the two lines

<gnc:count-data cd:type="book">1</gnc:count-data>
<gnc:book version="2.0.0">

                                        Add before the 
                                         <gnc:count-data cd:type="commodity">
                                         <gnc:count-data cd:type="account">
                                         lines
                                         so as to balance the closing gnc:book


Need to disable the SchedTXNs in the old file, which you
can do, one-at-a-time, from within GnuCash of by editing
the XML and

Replace every 

<sx:enabled>y</sx:enabled>

with

<sx:enabled>n</sx:enabled>


Open up ongoing.gnucash in GnuCash

Create a report from the "Account Summary" template that
will give you all of the Opening blanaces you need to
populate the new file.

In the report creation dialog, I set the following:

Tab:General
Change the date to the last date of the previous period

Tab:Accounts
Make the level of subaccounts "All"
Only need Assets & Liabilities and Children

Tab:Display
Uncheck Include accounts with zero balances

Tab:Commodities
Report's Currency: GBP     (Just make sure it's the files default currency)
Price Source: Most Recent

Export as old_year-report-acc_sum.html


Open up new_year.gnucash in GnuCash

Enter the various Opening Balances with reference to your
HTML report file.

Save new_year.gnucash 

That's it.


GnuCash on opening your new file, will do a very good job
of adding in any "missing" bits, when it comes to save the
new file for the first time.

Aside: if you keep making copies of the new_year.gnucash 
before you operate on it, you will be able to see what Gnucash
is doing to it.

GnuCash is an incredible program in that respect: the authors
deserve a lot of credit for their work.


FWIW, people who want to try and get a better understanding of
the format of a Gnucash XML file could do a lot worse than to
create a brand new file, with a set of minimal accounts, enter
one tranaction, and maybe one commodity and commodity price, 
and squirrel that file away for future reference.


I hope that helps and/or gives you something upon which to
create your own approach, although, as many folk on here 
will tell you, you may not need to have seperate files for 
seperate years, but if you want to, then you can do.





More information about the gnucash-user mailing list