Open stewmehr opened 1 year ago
Hi @stewmehr
The first line of those generated reports contain the hledger command that was used to generate the report.
What happens if you run that yourself, but add another --file
parameter for the directives.journal, either before or after the current one? e.g. hledger --file directives.journal --file import/userA/all-years.journal <...>
Can you give an example of your directives.journal with "account info, including non-default account names and types" that would result in an empty report even when there are actual data in the userA
and userB
directories? Please also include some example user data, so that I can replicate it.
Hi @apauley
Thank you for your swift reply. I was not aware that it was possible to supply multiple --file
args even though that does make a lot of sense. Adding the directives.journal
this way leads to correct results which is a less intrusive way of fixing the issue than modifying any .journal
files. Since the directives.journal
is always created and empty by default, maybe it makes sense to add --file directives.journal
to all report commands?
If you still want to investigate this, here are the first few lines of my directives.journal
:
; journal created 2023-05-12 by hledger
account aktiva ; type: A
account fremdkapital ; type: L
account eigenkapital ; type: E
account ertraege ; type: R
account aufwendungen ; type: X
account aktiva:userA:cash
account aktiva:userA:bankX:checking
account aktiva:userB:cash
account aktiva:userB:bankY:checking
I can try to clean some of my user data later today but it will take me a little more time to supply CSVs, rules files etc. It may be faster to replicate the issue by creating a copy of the gawie
dir in the example repo and reassigning the account types there. The issue probably disappears if one uses default account names such as assets:XXX:...
, income:XXX:...
, expenses:XXX:...
etc. because those will be recognized even if no directives journal is supplied.
EDIT just to clarify: My (German) mapping of the default top-level accounts is
assets --> aktiva
liabilities --> fremdkapital
equity --> eigenkapital
income --> ertraege
expenses --> aufwendungen
I have another issue due to the missing (not included) directives.journal
file. I have a list of commodities defined there. As a result, some of the reports display them in different ways. Relevant section of my directives.journal
:
commodity 1,000.00 CAD
commodity 1,000.00 USD
commodity 1,000.00 UAH
But the report generated without including directives.journal
display totals differently:
870.45 CAD, UAH1,759.71
As discussed above, we must add directives.journal
as input to all lower granularity reports.
Describe the bug I have set up an account structure with several users in my
./import
directory (e.g../import/userA/bankX/checking/1-in
,./import/userB/bankY/checking/1-in
, etc. ...). This works fine in terms of importing CSVs and generating journal files, but I am struggling withhledger-flow report
. The generated./reports
directory looks as follows:Unfortunately, only the reports in
./reports/all
contain any numbers whereas the reports generated foruserA
anduserB
are empty. This is due to the fact that all my account info, including non-default account names and types, is stored in./directives.journal
in the top-level directory. By default, this directives file is only included in./all-years.journal
but not included in./import/user{A,B}/all-years.journal
. Thus,hledger
does not know the correct mapping of my income and expense accounts and is unable to generate any income statements or balance sheets for individual user accounts.This can easily be fixed by appending the line
to the respective
all-years.journal
files at lower levels. I am not sure if this is the most efficient solution but I cannot think of a better one right now.Version and Runtime Information
Please mention the version number of
hledger-flow
you are using:Is this the latest version? Yes Please confirm your issue using the latest version of
hledger-flow
, maybe it has already been fixed. NoAlso include the runtime options of the command you ran, e.g:
To Reproduce
Issue cannot be reproduced with data available at https://github.com/apauley/hledger-flow-example as the repo's
import
directory contains only a singleuser
directory.Expected behavior
I would expect the reports in directories other than
all
not to be empty.Desktop (please complete the following information):