Last active
February 14, 2020 16:51
-
-
Save asciipip/98d56d64ed2f0ce56a0931382f8aae55 to your computer and use it in GitHub Desktop.
Ledger Balance Sheet
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
#!/bin/bash | |
DEPTH=2 | |
LG="ledger -f main.ledger --force-color --depth=$DEPTH" | |
BALANCE_FORMAT="%(justify(scrub(display_total), 10, -1, true, color)) %(depth_spacer)%-(ansify_if(partial_account(options.flat), blue if color))\n%/%\$1\\n%/----------\\n" | |
$LG source </dev/null || exit 1 | |
paste -d '|' \ | |
<($LG --balance-format="$BALANCE_FORMAT" bal "$@" ^Assets) \ | |
<($LG --balance-format="$BALANCE_FORMAT" --invert bal "$@" ^Liabilities ^Equity) \ | |
| column -nt -s '|' \ | |
| less -RF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment