hledger/bin/hledger-report1.sh
2023-10-24 13:38:08 +01:00

19 lines
539 B
Bash
Executable File

#!/usr/bin/env bash
# A custom compound report - like incomestatement but with different
# subheadings/subreports. A bit hacky but quick and short.
# See also hledger-report1.hs.
echo "Report1 Statement $(date +%Y-%m-%d)"
printf "\nRevenues\n"
hledger bal expr:"type:r and $@" | tail +2
printf "\nOperating Expenses\n"
hledger bal expr:"type:x and operating and $@" | tail +2
printf "\nOther expenses\n"
hledger bal expr:"type:x and not:operating and $@" | tail +2
printf "\nGrand Total\n"
hledger bal expr:"type:rx and $@" | tail -1