osvc

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

commit 0e453619e7df5a237964f4aaf58f6b24b1b97f8f
parent 31ae8c4b9db6914c55865aa48961e912cb3dc09f
Author: Tomas Nemec <nemi@skaut.cz>
Date:   Mon, 21 Mar 2022 06:46:42 +0100

feat: add fio-month-expense

Diffstat:
Afio-month-expense | 13+++++++++++++
Mmakefile | 2++
2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/fio-month-expense b/fio-month-expense @@ -0,0 +1,13 @@ +#!/usr/bin/env zsh +# Get expenses for single month +# +# usage: fin-month-expense <month number> + +month=$1 +[[ -z "$month" ]] && exit 1 + +year="$(date +%Y)" +from="$year-$month-01" +to=$(date -d "$year-$(($month+1))-01 -1 day" +'%Y-%m-%d') + +fio -a personal t p -f $from -t $to | jq '.[] | select(.money < 0)' diff --git a/makefile b/makefile @@ -7,9 +7,11 @@ all: install: @install -v -d "$(BINDIR)/" && install -m 0755 -v "./fin-check-invoices" "$(BINDIR)/fin-check-invoices" @install -v -d "$(BINDIR)/" && install -m 0755 -v "./fio-period" "$(BINDIR)/fio-period" + @install -v -d "$(BINDIR)/" && install -m 0755 -v "./fio-month-expense" "$(BINDIR)/fio-month-expense" uninstall: trun.lua @rm -vrf "$(BINDIR)/fin-check-invoices" @rm -vrf "$(BINDIR)/fio-period + @rm -vrf "$(BINDIR)/fio-month-expense .PHONY: all install uninstall