Closing out a year -- quick question

28 views
Skip to first unread message

niels...@gmail.com

unread,
Apr 4, 2023, 3:39:03 PM4/4/23
to hledger
Is the "close" command supposed to generate both the closing balances and the opening balances (i.e., with one command)?

Some of the documentation suggests that, but I am not getting that behavior in 1.29.

Thank you!

Rob

Simon Michael

unread,
Apr 4, 2023, 4:14:34 PM4/4/23
to hledger
Hi Rob, all,

in 1.29, close changed to show only a closing transaction by default. To see both closing and opening, you should now use `hledger close --migrate`.

This is mentioned in the release notes but not clearly enough (https://github.com/simonmichael/hledger/issues/2020).

I was trying to make this command easier, but it's not yet satisfactory. The different uses and modes are still hard to explain.

It's a pain, but currently I'm leaning towards:

1. in 1.29.2, fixing the unannounced breakage, by restoring 1.28's `--open-acct` flag and legacy `--closing` and `--opening` flags and `equity` command alias.

2. in 1.30, attempting another UI cleanup: always operating on ALE accounts by default, adding --close for clarity, and deprecating --retain (at least). So it would become:

hledger close [--close|--open|--migrate] [ACCTQUERY]
  [--close-acct=ACCT] [--open-acct=ACCT] [--close-desc=STR] [--open-desc=STR]

  Show a closing transaction (default), opening transaction, or both, for the matched accounts (default: most asset/liability/equity accounts).
  The account balances will be transferred to/from ACCT (default: equity:opening/closing).
  This command is useful for transferring balances to a new file, and a few other things.
  Eg it can be used to retain revenues and expenses, like this:

  hledger close --close-desc 'retain earnings' --close-acct 'equity:retained earnings' type:rx

And if it's ever needed, the above retain incantation could be provided as an easier `hledger retain` command or script.

Comments and other ideas most welcome.

-Simon



--
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/29c263d3-bf99-4346-818e-b7b964348cccn%40googlegroups.com.

Message has been deleted

Simon Michael

unread,
Apr 4, 2023, 6:09:06 PM4/4/23
to hledger
Or perhaps drop the --migrate flag, and make it

hledger close [--close[=FILE]|--open[=FILE]] [ACCTQUERY] [OTHEROPTS]

Examples:

hledger close   # show just the closing transaction, default behaviour
hledger close --close   # same
hledger close --open   # show just the opening transaction
hledger close --close --open   # show both transactions
hledger close --close=2023.journal --open=2024.journal   # append the two transactions to their respective files



Simon Michael

unread,
Apr 4, 2023, 6:13:31 PM4/4/23
to hledger
Or make some use of the existing -o/--output-file option:

hledger close --close --open -o NEWFILE    # -o causes it to write the closing txn to default journal and opening txn to NEWFILE


Simon Michael

unread,
Apr 4, 2023, 8:44:34 PM4/4/23
to hledger
On Apr 4, 2023, at 09:39, niels...@gmail.com <niels...@gmail.com> wrote:

Is the "close" command supposed to generate both the closing balances and the opening balances (i.e., with one command)?

Some of the documentation suggests that, but I am not getting that behavior in 1.29.


Which documentation, by the way ? The manuals are expected to be always up to date, but random cookbook docs are not.

niels...@gmail.com

unread,
Apr 5, 2023, 9:49:59 AM4/5/23
to hledger
I think I now see what was happening. In some of my internet searches, I was coming across old documentation, which described the prior behavior (i.e., "close" generating both the closing and opening transactions).

I then got confused when I looked at the hledger documentation, which says:

--open: as above, but prints just the opening transaction. This can be useful for starting a new file, leaving the old file unchanged.

When I read "as above," my eyes went up to the main heading of "close" rather than immediately above to "--migrate." This was my misreading. For any who might be tempted to make the same mistake, the "--open" section could be rewritten as:

--open: the same as --migrate, but prints just the opening transaction. This can be useful for starting a new file, leaving the old file unchanged.

Rob
Message has been deleted

Simon Michael

unread,
Apr 5, 2023, 7:08:00 PM4/5/23
to hledger
Thanks Rob. That doc has been rewritten, and will hopefully be clearer when I push it.

Simon Michael

unread,
Apr 7, 2023, 12:24:28 PM4/7/23
to hledger
Latest plans for `close` in 1.29.2:


On Apr 4, 2023, at 10:19, niels...@gmail.com <niels...@gmail.com> wrote:

Thank you, and I have some ideas re the documentation that may be helpful in the meantime.

Once I get confident enough with GitHub, I will submit the requests there. 

Rob

Reply all
Reply to author
Forward
0 new messages