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

Where to put account declarations and prices? #119

Open
learner-long-life opened this issue Nov 24, 2023 · 1 comment
Open

Where to put account declarations and prices? #119

learner-long-life opened this issue Nov 24, 2023 · 1 comment

Comments

@learner-long-life
Copy link

Is your feature request related to a problem? Please describe.
I'd like to declare accounts to take advantage of hledger's strict checking.
However, they are not tied to any particular year. I tried to them in the 1-in directory but it is not picked up by hledger-flow import to appear in all-years.journal.

Version and Runtime Information

hledger-flow 0.15.0 darwin x86_64 ghc 9.0 2b025fee477538a493cb7b5eaf163fd959aaec42

Is this the latest version?

If your request includes commands you ran and the output, please also include
the runtime options with --show-options e.g:

$ hledger-flow --show-options import

Our Example Statements Repository

None of the examples in hledger-flow use account declarations.

I encounter the following error when running

> hledger check -f ./all-year.journal -s
hledger: Error: /Users/cryptogoth/src/hledger-flow-example/import/./gawie/bogart/cheque/2016-opening.journal:2:5-38:
  | 2016-03-01 Cheque Account Opening Balance
2 |     Assets:Current:Gawie:Bogart:Cheque                R40500.00
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |     Equity:Opening Balances:Gawie:Bogart:Cheque      R-40500.00
undeclared account "Assets:Current:Gawie:Bogart:Cheque"

Describe the solution you'd like
I'd like to include a journal file in 3-journal for any account, outside of the year directories, that gets automatically included in the all-years.journal.

3-journal/
├── accounts.journal
├── 2022
│   └── 2022-12-13.journal
└── 2023
    ├── 02-10-2023.journal
    ├── 2023-01-13.journal
    ├── 2023-11-12.journal
    └── 2023-checkpoints.journal

Describe alternatives you've considered

It works to use a year that is before the timespan of any of my actual transactions, such as 1900.

3-journal/
├── 1900
│   └── accounts.journal
├── 2022
│   └── 2022-12-13.journal
└── 2023
├── 02-10-2023.journal
├── 2023-01-13.journal
├── 2023-11-12.journal
└── 2023-checkpoints.journal

Additional context

Similar use cases that would be solved by this request would be price files, for commodity, stock, and currency prices.

@bronislav
Copy link
Contributor

I think you are looking for directives.journal file that should be in the root of your repository. More here https://github.com/apauley/hledger-flow?tab=readme-ov-file#hledger-directives

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants