Reports

267 views
Skip to first unread message

karencooke

unread,
Aug 21, 2009, 9:03:48 AM8/21/09
to Ledger
Hi,

I use ledger (2.6.1) with Aquamacs emacs on Mac OS X to organise my
personal finances. I'm fine with all the basic reporting functions it
provides. My husband prefers something prettier. I've tried to
shoehorn the figures into various excel spreadsheets, but it's really
too time consuming. I've looked at ledgerplot.py from http://joyful.com/Ledger,
but the period functions don't work - it just does totals, and my
python skills are just not up to diving in (being virtually non
existent).

What do other people do for monthly income/expense/net worth style
reports?

(As an aside my husband gets paid on the 25th of the month so my month
in my reports runs from 25th to 24th, which seems to confuse most apps
which insist on being conventional and starting a month on the 1st ;)

Any hints or tips appreciated.

Thanks

Karen Cooke

idm

unread,
Aug 21, 2009, 1:24:08 PM8/21/09
to Ledger
I am really curious to hear what people have to say about this. If I
may expand on this, would anyone like to share how they generate
standard financial reports? These are the three I'm talking about:

- balance sheet
- profit/loss (AKA income/expense)
- cash flow statement

Note: I believe this is basically what Karen is asking about, but I'm
familiar with the terms above because:

1) this is what many books call the reports
2) this is also what quickbooks calls the reports

If you can generate these reports on a monthly and yearly basis, then
you have everything you need to track your finances closely, and
eventually to do taxes at the end of the year.

Best,
Ian

On Aug 21, 9:03 am, karencooke <karen.co...@gmail.com> wrote:
> Hi,
>
> I use ledger (2.6.1) with Aquamacs emacs on Mac OS X  to organise my
> personal finances. I'm fine with all the basic reporting functions it
> provides.  My husband prefers something prettier. I've tried to
> shoehorn the figures into various excel spreadsheets, but it's really
> too time consuming.  I've looked at ledgerplot.py fromhttp://joyful.com/Ledger,

Simon Michael

unread,
Aug 22, 2009, 11:58:40 AM8/22/09
to ledge...@googlegroups.com
I wrote ledgerplot.py (and Karen, sorry if it has bitrotted, I haven't touched it in a while), and when feasible I hope
to generate nicer reports from hledger, but currently I generate such reports in plaintext format using ledger or
hledger, and when necessary prettify them by hand, eg pasting into an invoice or spreadsheet or email to my tax accountant.

I save the command lines as shell scripts or aliases or in makefiles, since getting them right takes some work. Here are
most of mine. Adapting the hledger commands for ledger should be straightforward. These may be old or inaccurate but
hopefully they give some ideas. Questions/comments/alternatives welcome.


.bashrc
-------

alias 2006='hledger -f ~/personal/2006.ledger -B'
alias 2007='hledger -f ~/personal/2007.ledger -B'
alias 2008='hledger -f ~/personal/2008.ledger -B'
alias 2009='hledger -f ~/personal/current.ledger -B'
alias household='hledger -f ~/personal/household.ledger'
alias simon='hledger -f ~/personal/household.ledger print simon | hledger -f-'

alias today='hours -p today'
alias thisweek='hours -p thisweek'
alias lastweek='hours -p lastweek'
alias thismonth='hours -p thismonth'
alias lastmonth='hours -p lastmonth'
alias thisyear='hours -p thisyear'
alias lastyear='hours -p lastyear'


Makefile
--------

YEAR:=${shell date +%Y}
MONTHS=01 02 03 04 05 06 07 08 #09 10 11 12

LEDGER2=ledger2.6
LEDGER3=ledger -y %Y/%m/%d

convert-csv: # convert latest bank csv downloads to ledger files

-@mv ~/Desktop/{Checking,Savings,CreditCard}*.csv . 2>/dev/null
hledger convert Checking1.csv "assets:bank:wells fargo:checking" wellsfargo.rules >Checking1.ledger
hledger convert Savings2.csv "assets:bank:wells fargo:savings" wellsfargo.rules >Savings2.ledger
hledger convert Savings3.csv "assets:bank:wells fargo:tax savings" wellsfargo.rules >Savings3.ledger
hledger convert CreditCard4.csv "liabilities:credit cards:wells fargo" wellsfargo.rules >CreditCard4.ledger
hledger -f wellsfargo.ledger print -blastmonth

daily-checking-balance: # show wells fargo checking balance by day, for reconciling

hledger register --effective --period 'daily to today' --display 'd>[last month]' 'wells fargo:checking'

monthly-balance-sheet: # show quick monthly balance sheets for this year

@for m in $(MONTHS); do \

printf "end of $(YEAR)/$$m:\n\n"; \

hledger bal assets not:foreign liabilities -BE --depth 2 -e $(YEAR)/`expr $$m + 1`; \

echo; \

done

ar-deposits: # show actual dates of bank deposits for accounts receivable

@$(LEDGER3) reg receivable -B -l 'a<0' --effective


SCRIPTS
-------

#!/bin/sh

# balancesheet [extraoptions]

echo "Balance sheet as of `date`"
echo "totals include sub-accounts"
echo
ledger2.6 -n --balance-format '%10T %2_%-a\n' --display "l<=3" --basis --subtotal $* balance assets
echo
ledger2.6 -n --balance-format '%10T %2_%-a\n' --display "l<=3" --basis --subtotal $* balance liabilities
echo
ledger2.6 -nE --balance-format '%10T %2_%-a\n' --display "l<=4" --basis --subtotal $* balance equity
echo
echo "`ledger2.6 --balance-format '%10T %2_%-a\n' --basis $* balance liabilities equity | tail -1`liabilities + equity"
echo
ledger2.6 --balance-format '%10T %2_%-a\n' --basis $* balance assets liabilities | tail -2


#!/bin/sh

# cashflowstatement [extraoptions]

# cashflowstatement -p oct

echo "Cashflow statement"
echo "------------------"
ledger2.6 --balance-format '%10T %2_%-a\n' --basis --subtotal $* balance assets liabilities


#!/bin/sh

# profitandloss [extraoptions]

echo "Profit & Loss statement for `date +%Y` as of `date`"
echo "totals include sub-accounts"
echo
ledger2.6 -n --balance-format '%10(-T) %2_%-a\n' --display "l<=3" --basis --subtotal $* balance income
echo
ledger2.6 -n --balance-format '%10(-T) %2_%-a\n' --display "l<=2" --basis --subtotal $* balance expenses -equity
echo
ledger2.6 --balance-format '%10(-T) %2_%-a\n' --basis $* balance income expenses -equity | tail -2

idm

unread,
Aug 22, 2009, 1:03:50 PM8/22/09
to Ledger
Wow - fantastic!! I like your workflow, and I really appreciate that
you shared your scripts. I'll see what I can do with these.

-Ian

karencooke

unread,
Aug 22, 2009, 3:33:05 PM8/22/09
to Ledger


On Aug 22, 4:58 pm, Simon Michael <si...@joyful.com> wrote:
> I wrote ledgerplot.py (and Karen, sorry if it has bitrotted, I haven't touched it in a while), and when feasible I hope
> to generate nicer reports from hledger, but currently I generate such reports in plaintext format using ledger or
> hledger, and when necessary prettify them by hand, eg pasting into an invoice or spreadsheet or email to my tax accountant.
>
> I save the command lines as shell scripts or aliases or in makefiles, since getting them right takes some work. Here are
> most of mine. Adapting the hledger commands for ledger should be straightforward. These may be old or inaccurate but
> hopefully they give some ideas. Questions/comments/alternatives welcome.

Hi,

Don't worry about ledgerplot.py - what it does produce is nice, I'd
just like to be able to play with the periods a bit to cover our
particular needs. It I'm feeling up to it I'll grab a python book out
of the library next time I am there and see what I can do.

Thanks for all of your scripts too - I'll have a play with them next
week.

Karen

Reply all
Reply to author
Forward
0 new messages