Expense Calculator

I wrote this calculator when I volunteered to work out the expenses for our 1981 ski trip to Jackson Hole. I wasn't even sure how to approach the calculation so I just started writing facts into a file. Pretty soon I realized that if I could just sum the groups and then bring those sums into other groups then I'd pretty much have it.

I wrote a small AWK script to do just that and print a report. I finished the script and the report together. See the script here . I've translated the script to CoffeeScript and bundled it as a plugin to render this page.

Jackson Hole Expenses February, '81 Cal Diller ... 71.25 Cowboy Steak House 24 M/M 26 Mexican 60 Lift Tickets 13.50 Pizza ------- CAL Bill Pooley ... 48 * 3 Lift Tickets 14.04 Breakfast 368.16 Room 29.31 Drinks ------- BILL Ward Cunningham ... 14.73 Gas 14.2 13.86 17 14.5 13.76 ------- GAS Total Gas 15 Blue Lion 48 Lift 30.55 Anthonys 69.24 Alpenhof GAS Total Gas ------- WARD Total Shared Expenses ... CAL Cal Diller BILL Bill Pooley WARD Ward Cunningham ------- TOTAL / 3 ------- SHARE Individual Share Individual Balances ... BILL Bill's Expenses SHARE DB ------- SUM 3.86 Telephone, Cal 6.01 Telephone, Ward ------- DB Due Bill CAL Cal's Expenses SHARE DB ------- SUM 3.86 DB Telephone ------- DC Due Cal WARD Ward's Expenses SHARE DB ------- SUM 6.01 DB Telephone ------- DW Due Ward Doublechecking ... DB DC DW ------- ERROR Unaccounted Funds