John Wiegley wrote at 2017-03-17 17:26 -0500:
>The thing is, the balance report iterates over all the
>*transactions* matching your query to build up the set of accounts
>it should report; that way, it doesn't report accounts outside of
>that query.
Okay, so `--empty` only affects accounts that *have* had activity in
the matching transaction set but have a final balance of zero.
>Even if I did create all the accounts mentioned in the "account"
>directives, there would be no associated transactions for the
>balance report to find. So maybe what we need to do is inject some
>dummy "Starting balance" transactions, that simply draw from
>Equity:Opening Balances in the amount of integer 0.
Do you mean, create the accounts mentioned by the `account` command
*if* the `--empty` option is used? This seems like it would work in
general, it would fix the problem for me, and it is similar to what I
did in the dummy automated transaction in the original post (and
repeated below). I am not aware of what effect this might have, if
any, on the output of other report commands.
~~~
= expr true
Assets 0
Expenses 0
Expenses:Clothing 0
Expenses:Food 0
Income 0
~~~
Also, is it necessary to assume that the user is using an account
structure that includes "Equity:Opening Balances"? Why not just use
the list of accounts (see the example above)? Or maybe this does not
matter.