Typically as your liabilities increase you'd be offsetting them with 
expenses, to balance the accounts.

Then you would run a report on your expenses for the time period you were 
interested in.

For example:

2016-09-19 Amazon.com - Beautyko Ideaworks 12-Piece Wood Touch-Up Markers
Expenses:Household $6.99
Liabilities:USAA:Visa

or if you're directly drawing down on an asset:

2016-09-19 * Starbucks
Expenses:Dining $2.45
Assets:Starbucks Card

And then you'd just run something like 'ledger register -s -p 2016-09-19 
^expenses':

$ ledger register -s -p 2016-09-19 ^expenses |tee ~/X
2016-09-19 - 2016-09-19 Expenses:Dining               $9.34   $9.34
                        Expenses:Dining:Tip           $1.00  $10.34
                        Expenses:Groceries:Prepared   $7.38  $17.72
                        Expenses:Groceries:Produce   $10.98  $28.70
                        Expenses:Groceries:Wine       $8.99  $37.69
                        Expenses:Household            $6.99  $44.68


I typically want to see my expenses broken down into subgroups.   There may 
be a clever way to do this within ledger, but I just created a shell script 
to do that for me:


#!/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 HOUSING, INSURANCE, AND UTILITIES:
$register ^expenses and  \( rent or HOA or utilities or insurance or 403b or 
401k \) | percnt

echo OTHER:
$register ^expenses and not \( \( tax and not bottle \) or rent or HOA 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 ledger-cli+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to