The --budget feature was mentioned as one option, what I ended up doing for
myself was to just make a dip simple script to call register with three 
different
subgroups of expenses.  It lets me break down my expenses into taxes,
into fixed expenses (e.g., rent, utilities, and insurance), and into "other"
(e.g., dining out, groceries).

#!/bin/sh

if [ $# = 0 ]; then
    year=`date +%Y`;
    month=`date +%m`;
    period="-p ${year}-${month}";
elif [ $# = 1 -a "$1" = "-a" ]; then
    period="";
elif [ $# = 2 -a "$1" = "-p" ]; then
    period="$@";
else
    echo "usage: expenses [-a | -p <period>]" 1>&2;
    exit;
fi


register="ledger --columns 155 --payee-width=14 $period -s register";
total=`${register} -n ^expenses: | awk '{total=$NF; gsub("[$,]", "", 
total); print total; }'`;

percnt() {
  awk '{if ( NR > 1 ) {printf("\n")} printf("  %s", $0)}
  END {subtotal=$NF; gsub("[$,]", "", subtotal); if (total > 0) {percent = 
(subtotal/total)*100} else {percent = 0} printf(" ~ (%0.2f%%)\n\n", 
percent); }' total=${total};
}

echo TAXES:
$register ^expenses and \( tax and not bottle \) | percnt

echo RENT, UTILITIES, AND INSURANCE:
$register ^expenses and  \( rent or utilities or insurance or 403b or 401k 
\) | percnt

echo OTHER:
$register ^expenses and not \( \( tax and not bottle \) or rent or 
utilities or insurance or 403b or 401k \) | percnt

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to