Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bal: with --declared, include all declared accounts #1765

Merged
merged 2 commits into from
Nov 22, 2021

Conversation

simonmichael
Copy link
Owner

Together with -E, this allows showing a balance for all accounts, both
used and declared. I mainly want this for hledger-ui, but there's no
harm in exposing it in the balance command as well. This is somewhat
consistent with the accounts and payees commands.

Together with -E, this allows showing a balance for all accounts, both
used and declared. I mainly want this for hledger-ui, but there's no
harm in exposing it in the balance command as well. This is somewhat
consistent with the accounts and payees commands.
@simonmichael simonmichael added A-WISH Some kind of improvement request, hare-brained proposal, or plea. balance labels Nov 22, 2021
@simonmichael simonmichael merged commit a5e19b7 into master Nov 22, 2021
simonmichael added a commit that referenced this pull request Nov 22, 2021
)"

This reverts commit a5e19b7.
(It breaks filtering by account.)
simonmichael added a commit that referenced this pull request Nov 23, 2021
Together with -E, this allows showing a balance for all accounts, both
used and declared. I mainly want this for hledger-ui, but there's no
harm in exposing it in the balance command as well. This is somewhat
consistent with the accounts and payees commands.
simonmichael added a commit that referenced this pull request Nov 23, 2021
Together with -E, this shows a balance for both used and declared
accounts (excluding empty parent accounts, which are usually not
wanted in list-mode reports).

This is somewhat consistent with --declared in the accounts and payees
commands, except for the leaf account restriction.

The idea of this is to be able to see a useful "complete" balance
report, even when you don't have transactions in all of your declared
accounts yet. I mainly want this for hledger-ui, but there's no harm
in exposing it in the balance CLI as well.
@simonmichael
Copy link
Owner Author

I reverted this merged PR after finding issues. I have just pushed a fixed version 6319d61. This was quite tricky; I think it's good now, but I'll wait at least a day, and any feedback is welcome.

Commit message:

feat: bal: with --declared, include declared leaf accounts (#1765)

Together with -E, this shows a balance for both used and declared
accounts (excluding empty parent accounts, which are usually not
wanted in list-mode reports).

This is somewhat consistent with --declared in the accounts and payees
commands, except for the leaf account restriction.

The idea of this is to be able to see a useful "complete" balance
report, even when you don't have transactions in all of your declared
accounts yet. I mainly want this for hledger-ui, but there's no harm
in exposing it in the balance CLI as well.

Doc:

Showing declared accounts

With --declared,
accounts which have been declared with an account directive
will be included in the balance report, even if they have no transactions.
(Since they will have a zero balance, you will also need -E/--empty to see them.)

More precisely, leaf declared accounts (with no subaccounts) will be included,
since those are usually the more useful in reports.

The idea of this is to be able to see a useful "complete" balance report,
even when you don't have transactions in all of your declared accounts yet.

@simonmichael
Copy link
Owner Author

simonmichael commented Nov 25, 2021

Repushed [& merged] with fixes for bs/cf/is, showing the correct declared accounts in each subreport. No known open issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-WISH Some kind of improvement request, hare-brained proposal, or plea. balance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant