closing file for 2023 and opening file for 2024

28 views
Skip to first unread message

Chris Ryan

unread,
Dec 27, 2023, 11:16:40 PM12/27/23
to hle...@googlegroups.com
Note that I'm running hledger version 1.12 on Linux Mint 20.3. I plan to soon upgrade my computer hardware (new M.2 SSD!), install the latest LTS release of Mint, and install a more recent version of hledger. But alas for now, here I am.

I did hledger close and generated closing transactions for the year just now ending:

2023/12/26 closing balances
assets:cash -22.80 = 0.00
assets:checking -211.80 = 0.00
equity 3858.00 = 0.00
expenses:communications -221.23 = 0.00
expenses:insurance -1337.50 = 0.00
expenses:legal -1650.00 = 0.00
expenses:officeSupplies -106.67 = 0.00
expenses:profdev -80.00 = 0.00
expenses:travel -228.00 = 0.00
equity:closing balances


and opening transactions for the new 2024 file:

023/12/27 opening balances
assets:cash 22.80 = 22.80
assets:checking 211.80 = 211.80
equity -3858.00 = -3858.00
expenses:communications 221.23 = 221.23
expenses:insurance 1337.50 = 1337.50
expenses:legal 1650.00 = 1650.00
expenses:officeSupplies 106.67 = 106.67
expenses:profdev 80.00 = 80.00
expenses:travel 228.00 = 228.00
equity:opening balances


Now I'm a bit puzzled because

hledger -f ASC_2024.journal is

yields the following, making it look like I had 2023's expenses in 2024:

Income Statement 2023/12/27

|| 2023/12/27
=========================++============
Revenues ||
-------------------------++------------
-------------------------++------------
||
=========================++============
Expenses ||
-------------------------++------------
expenses:communications || 221.23
expenses:insurance || 1337.50
expenses:legal || 1650.00
expenses:officeSupplies || 106.67
expenses:profdev || 80.00
expenses:travel || 228.00
-------------------------++------------
|| 3623.40
=========================++============
Net: || -3623.40


Do I perhaps need to use the -b YYYY-01-01 flag with every report command, to get only the year I want, and exclude the opening balance transaction? I can see that getting tedious for the next 12 months.

Thanks.

--
Chris Ryan
rya...@fastmail.co.uk

Henning Thielemann

unread,
Dec 28, 2023, 4:22:16 AM12/28/23
to hle...@googlegroups.com

On Thu, 28 Dec 2023, Chris Ryan wrote:

> Note that I'm running hledger version 1.12 on Linux Mint 20.3. I plan to
> soon upgrade my computer hardware (new M.2 SSD!), install the latest LTS
> release of Mint, and install a more recent version of hledger.

On any Linux distribution and version you can install latest hledger using
'cabal' (aka cabal-install) or 'stack' and a pretty recent version via
'nix'.

Francesco Ariis

unread,
Dec 28, 2023, 5:25:46 AM12/28/23
to hle...@googlegroups.com
Hello Chris,

Il 28 dicembre 2023 alle 04:16 Chris Ryan ha scritto:
> Note that I'm running hledger version 1.12 on Linux Mint 20.3. I plan to soon upgrade my computer hardware (new M.2 SSD!), install the latest LTS release of Mint, and install a more recent version of hledger. But alas for now, here I am.
>
> I did hledger close and generated closing transactions for the year just now ending:
>
> 2023/12/26 closing balances
> assets:cash -22.80 = 0.00
> assets:checking -211.80 = 0.00
> equity 3858.00 = 0.00
> expenses:communications -221.23 = 0.00
> expenses:insurance -1337.50 = 0.00
> expenses:legal -1650.00 = 0.00
> expenses:officeSupplies -106.67 = 0.00
> expenses:profdev -80.00 = 0.00
> expenses:travel -228.00 = 0.00
> equity:closing balances

This is not correct, closing/reopening handles the A&L part of your
accounts (Assets, Liabilities, Equity). From hledger manual [1], `close`
section

By default, it prints a transaction that zeroes out ALE accounts (asset,
liability, equity accounts; this requires account types to be configured);
or if ACCTQUERY is provided, the accounts matched by that.

[1] https://hledger.org/1.32/hledger.html#close

You should not have revenues/expenses in your closing/opening entry.

Happy accounting
—F

Chris Ryan

unread,
Dec 28, 2023, 7:50:42 AM12/28/23
to hle...@googlegroups.com
That was the verbatim output of hledger close.

--
Chris Ryan
rya...@fastmail.co.uk

Simon Michael

unread,
Dec 28, 2023, 11:58:39 AM12/28/23
to hledger
Hi Chris,


On Dec 27, 2023, at 18:16, Chris Ryan <rya...@fastmail.co.uk> wrote:

Note that I'm running hledger version 1.12 on Linux Mint 20.3.


Wow! Glad it's working for you.


On Dec 28, 2023, at 02:50, Chris Ryan <rya...@fastmail.co.uk> wrote:

That was the verbatim output of hledger close.


hledger 1.12's close is different (https://hledger.org/1.12/hledger.html#close), it closes all accounts by default. You can run `hledger close ^assets ^liabilities ^equity` or just delete the expenses lines manually.

Chris Ryan

unread,
Dec 28, 2023, 12:29:36 PM12/28/23
to hle...@googlegroups.com
Probably just as easy to edit the hledger close output before copying it into the respective old and new journal files. Thanks.

--
Chris Ryan
rya...@fastmail.co.uk
> --
> You received this message because you are subscribed to the Google
> Groups "hledger" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hledger+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/hledger/ACBAA29E-5281-4D84-9FCC-5B5E27DDC0FF%40joyful.com.

Chris Ryan

unread,
Dec 28, 2023, 12:41:58 PM12/28/23
to hle...@googlegroups.com
Yes, I just didn't want to bother until I install my new SSD, and new Linux Mint OS onto it, and have to do it all again. Lazy I guess.

--
Chris Ryan
rya...@fastmail.co.uk
> --
> You received this message because you are subscribed to the Google
> Groups "hledger" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hledger+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/hledger/506a784-92-ede4-4f4a-a657aa9bad33%40henning-thielemann.de.
Reply all
Reply to author
Forward
0 new messages