osvc

scripts to save some time with self-employed stuff
git clone git://gtms.dev/osvc
Log | Files | Refs

fio-month-expense (307B)


      1 #!/usr/bin/env zsh
      2 # Get expenses for single month
      3 #
      4 # usage: fin-month-expense <month number>
      5 
      6 month="$1"
      7 [[ -z "$month" ]] && exit 1
      8 
      9 year="$(date +%Y)"
     10 from="$year-$month-01"
     11 to=$(date -d "$year-$(($month + 1))-01 -1 day" +'%Y-%m-%d')
     12 
     13 fio -a personal t p -f $from -t $to | jq '.[] | select(.money < 0)'