Skip to content

Instantly share code, notes, and snippets.

@simonmichael
Forked from anonymous/gist:6503068
Last active December 22, 2015 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonmichael/6503091 to your computer and use it in GitHub Desktop.
Save simonmichael/6503091 to your computer and use it in GitHub Desktop.
YEAR:=$(shell date +%Y)
MONTH:=$(shell date +%m)
MONTHS:=$(shell ghc -e "(putStr . unwords . map show) [1..$(MONTH)]")
# quick income statement for specified (single-word) period
INCOMESTATEMENTACCTS=^income ^expenses ^draw
INCOMESTATEMENTOPTS=--cost --effective --depth 1 #--flat --drop 1
income-statement-%:
@printf "\nincome statement for $*:\n"
$(HLEDGER) balance $(INCOMESTATEMENTACCTS) --period '$*' $(INCOMESTATEMENTOPTS)
# quick monthly income statements for this year
income-statements:
@for m in $(MONTHS); do \
make income-statement-$(YEAR)-$$m; \
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment