forked from simonmichael/hledger
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
;examples:multi-year: how to show year-end balances in closed files [s…
- Loading branch information
1 parent
b41aa27
commit f27ecae
Showing
6 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
; 2021.journal | ||
|
||
2021-06-01 opening balances ; start:2021 | ||
assets 20 = 20 | ||
equity:start | ||
|
||
2021-07-01 income | ||
income | ||
assets 1 | ||
|
||
2021-12-31 closing balances ; start:2022 | ||
assets -21 = 0 | ||
equity:start | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
; 2022.journal | ||
|
||
2022-01-01 opening balances ; start:2022 | ||
assets 21 = 21 | ||
equity:start | ||
|
||
2022-07-01 income | ||
income | ||
assets 1 | ||
|
||
2022-12-31 closing balances ; start:2023 | ||
assets -22 = 0 | ||
equity:start | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; 2023.journal | ||
|
||
2023-01-01 opening balances ; start:2023 | ||
assets 22 = 22 | ||
equity:start | ||
|
||
2023-07-01 income | ||
income | ||
assets 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Multiple yearly journal files, demonstrating the tags and commands | ||
suggested in the [close command's doc](https://hledger.org/dev/hledger.html#example-exclude-openingclosing-transactions>) | ||
for flexible multi-year reporting. | ||
See `reports`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env sh | ||
|
||
# Suppressing redundant starting/ending balances transactions as suggested in | ||
# https://hledger.org/dev/hledger.html#example-exclude-openingclosing-transactions . | ||
# All of these will show the year-end balances correctly. | ||
# In each case, we exclude all transactions tagged with start: except the earliest. | ||
|
||
hledger bs -Y -f 2021.journal -f 2022.journal -f 2023.journal expr:'tag:start=2021 or not tag:start' | ||
hledger bs -Y -f 2021.journal -f 2022.journal expr:'tag:start=2021 or not tag:start' | ||
hledger bs -Y -f 2022.journal -f 2023.journal expr:'tag:start=2022 or not tag:start' | ||
hledger bs -Y -f 2021.journal expr:'tag:start=2021 or not tag:start' | ||
hledger bs -Y -f 2022.journal expr:'tag:start=2022 or not tag:start' | ||
hledger bs -Y -f 2023.journal # unclosed file, no query needed | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters