Is there a way to make ledger produce a balance sheet and profit and
loss statement? Anyone made a script to do that? I guess it would
require a script because you'd need a way to distinguish between
balance & p&l entries in the ledger. Thanks.
cheers,
roel
#!/bin/sh
if [ $# != 1 ]; then
echo $0 '<year>'
echo Please specify the year
exit 1
fi
YEAR=$1
SHORT_YEAR=`expr $YEAR - 2000`
PREVIOUS_YEAR=`expr $YEAR - 1`
CURRENCY="-X AUD"
LEDGER=ledger
DATA=mcoz.dat
echo Balance sheet as of $PREVIOUS_YEAR/06/30
$LEDGER -f $DATA $CURRENCY -e $PREVIOUS_YEAR/07/01 bal '^assets'
'^liabilities' '^equity'
echo
echo Income for $PREVIOUS_YEAR/$SHORT_YEAR financial year
$LEDGER -f $DATA $CURRENCY -b $PREVIOUS_YEAR/07/01 -e $YEAR/07/01 bal
'^income' '^expenses' '^currency'
echo
echo Balance sheet as of $YEAR/06/30
$LEDGER -f $DATA $CURRENCY -e $YEAR/07/01 bal '^assets' '^liabilities' '^equity'
cheers,
roel