[kwlug-disc] ledger demo file

Chris Frey cdfrey at foursquare.net
Mon May 5 23:11:16 EDT 2014


Hi list,

Here's my demo ledger file, for those who wish to play around with it.

I'd be happy to field questions if there are any left.

Enjoy!
- Chris

-------------- next part --------------


;
; Ledger - The Bran Muffin of Accounting Tools
;		All the power, none of the fat.
;
;		http://ledger-cli.org
;
; Income - where money comes from
; Expenses - where money goes
; Assets - where money sits
; Liabilities - what you owe
; Equity - net worth transfered into the ledger (hence, negative)
;		i.e. the balance of all of the above







; Ledger's features
;
;
; Automatic balancing - will give you an error if any account
;			does not balance.
;
; Use your favourite editor to enter your ledger data!!
;
; Never writes - Ledger only reads your data to report and
;		calculate.  It never changes your files.
;
; Different currencies, conversions, and units.
;
; Daily data entry is simple.





; Keeping your ledger:
;
;
; Ledger files are plain text.
;
; Each entry has: date, clear flag, optional ID, payee, and list
;		of accounts and values that must balance to 0
;
; If one account is empty, it will automatically be filled with
; the balance.  In this case, -1400.00
;
; Account names are created as you use them.  Account names
; may contain spaces.

2014/05/05 * (15493) MicroCorp, bi-weekly pay
	Assets:Chequing				1400.00
	Income:MicroCorp


; Command line usage
;
;
; Specify your ledger:
;	ledger -f demo.ldg
;
; Or
;
; Use the environment:
;	export LEDGER_FILE=demo.ldg
;
;	export LEDGER_FILE=/path/to/demo.ldg
;






; Ledger commands - introduction
;
;
;
;
; The two main ledger commands:
;
;	ledger [-s] bal
;
;	ledger reg
;








; Starting with existing balances.
;
; But wait!  What if I haven't started this year until now?

; Dated end of last month to avoid messing with May's totals
2014/04/30 * Opening balance, year to date
	Assets:Chequing				300.00
	Non-Liquid Assets:RRSP			15032.21
	Non-Liquid Assets:House			158000.00
	Non-Liquid Assets:Jetta			4000.00
	Liabilities:Mortgage			-81329.32
	Liabilities:Visa			-231.93
	Income:MicroCorp			11200.00
	Expenses:Interest:Mortgage		1350.00
	Expenses:Hydro				432.29
	Expenses:Groceries			1280.00
	Equity:Opening Balance


; The Year shortcut
;
;
; Use the Y command to set the year, so you don't have to
; enter it every time.

Y2014

05/01 * Petty cash
	Expenses:Cash				40.00
	Assets:Chequing

05/01 * Burrito Boys
	Expenses:Restaurants			5.50
	Expenses:Cash




; Cleared vs. Uncleared
;
;
; You can use the cleared flag to keep track of cheques or
; other items that do not get processed immediately.
;
; Entries with an '*' mark are cleared, without are uncleared.
; By default, ledger reports all items.  Filter with -C and -U
;
; Logically, all cheques that *you* write can be cleared
; immediately.  But incoming cheques may take time.

05/02 Grandparents, birthday money
	Assets:Chequing				20.00
	Income:Gifts




; Duplicating existing entries
;
;
; $ ledger entry DATE PAYEE ACCOUNT
;
; Example: say I visited Burrito Boys on the 05/02 as well.
;	$ ledger entry 05/02 burrito
;
; From vim:   :r!ledger entry 05/02 burrito
;
; Try it here:








; Handling cheques and transaction ID's
;
;
; Cheques have numbers - record them!
;
; Banking bill payments have numbers - record them!
;
; Display these with --code-as-payee in the reg report.

05/04 * (032) Provincial Raving Looney Party
	Expenses:Donations			40.00
	Assets:Chequing

05/04 * (3215) Hydro bill
	Expenses:Hydro				92.38
	Assets:Chequing



; Recording dates
;
;
; Each transaction can have an actual date and an effective date.
;
; For example, you may receive a cheque dated 2014/04/10
; on 2014/04/20 and only deposit it to your bank on 2014/05/05.
;
; By default ledger uses the actual dates, unless you specify
; --effective



04/10=05/05 * (23104) Ontario Trillium Benefit
	Assets:Chequing				60.00
	Income:Tax Benefits



; Recording dates, continued:
;
;
; Sometimes you may wish to split a bill across multiple
; months.  You can do this with comments containing
; bracketed dates.  Plain date is actual, and =date is
; effective.


05/30 * Car insurance
	Expenses:Insurance		112.00 ; [2014/01/01]
	Expenses:Insurance		112.00 ; [2014/02/01]
	Expenses:Insurance		112.00 ; [2014/03/01]
	Expenses:Insurance		112.00 ; [2014/04/01]
	Expenses:Insurance		112.00 ; [2014/05/01]
	Liabilities:Insurance		-560.00



; Automatic transactions
;
;
; Some transactions happen on every instance of another transaction
;	- savings, when paid
;	- taxes, if self-employed
;

; Save 10% on every paycheque
= /^Income:MicroCorp/
	* Assets:Savings			-0.10
	* Assets:Chequing			0.10

05/26 * MicroCorp, bi-weekly pay
	Assets:Chequing				1400.00
	Income:MicroCorp



; Virtual transactions
;
; In some cases, you may wish to move or allocate money
; in virtual accounts without actually moving it.  This will
; create two worlds: reality and virtual.
;
; By default, ledger displays the virtual, if any virtual
; transactions exist.  If you want reality, use -R.

; Balanced version
05/02 * Planning for vacation
	[Assets:Vacation]			200.00
	[Assets:Chequing]






; Budgets
;
; Budgets in ledger are simply a summary transaction for a time
; period.
;	ledger -s -p may --add-budget bal ^exp

~ Monthly
	Expenses:Fuel				100.00
	Expenses:Groceries			400.00
	Expenses:Restaurants			200.00
	Expenses:Hydro				100.00
	Expenses:Interest:Mortgage		340.00
	Assets

~ Yearly
	Expenses:House:Repair			1000.00
	Assets


; Sample data!

05/03 * Zehrs
	Expenses:Groceries			89.52
	Liabilities:Visa

05/03 * Esso
	Expenses:Fuel				62.01
	Liabilities:Visa

04/30=05/04 * Visa bill from 2014/04
	Liabilities:Visa			231.93
	Assets:Chequing

06/03 * Burrito Boys
	Expenses:Restaurants			5.50
	Expenses:Cash

06/09 * MicroCorp
	Assets:Chequing				1400.00
	Income:MicroCorp

06/23 * MicroCorp
	Assets:Chequing				1400.00
	Income:MicroCorp













; Currencies and units
;
;
; Ledger supports multiple currencies and custom units.
;
; Ledger also supports currency conversions.
;






; continued...





; Example 1:    Track inventory
;
;
; Units can be any label.


05/15 * New system for office
	Suppliers:CompuLoad			-1 thinkpad
	Suppliers:CompuLoad			-1 printer
	Inventory:Office









; Example 2:    Track time.
;
; Ledger recognizes hour and minute short forms.
;
; Ledger can read timeclock-formatted time logs, so you can
; track time spent per project, and then manage the totals in
; ledger.  The timeclock logs will be read into virtual
; accounts to accumulate the time.

05/04 * Preparation for KWLUG ledger presentation
	Projects:KWLUG				4h
	Time:Life







; Example 2, continued:
;
; Converting time to money
;
; You can give a value for an amount in one unit in another
; amount, using the @ symbol.

05/04 * Setup and test nightly backups
	Projects:Client:Labour			30m
	Time:Life

05/04 * (INV32802) Client invoice
	Receivable:Client
	Projects:Client:Labour			-0.5h @ 100.00

05/05 * Paid
	Assets:Chequing				50.00
	Receivable:Client




; Example 3:   Currencies and Commodities
;
;
; Prices for various commodities and currencies at various
; times are stored in a prices database.  By default, ledger
; reads from ~/.pricedb, so you could have an automated process
; updating this.  (Can also use LEDGER_PRICE_DB environment var)

; Example price.db for this demo:
P 2014/05/01 12:01:00 AAPL 123.30
P 2014/05/02 12:01:00 AAPL 126.30
P 2014/05/03 12:01:00 AAPL 114.83
P 2014/05/04 12:01:00 AAPL 130.92
P 2014/05/05 12:01:00 AAPL 132.21
P 2014/05/06 12:01:00 AAPL 162.73




; Example 3, continued:
;
;
; Currencies and commodities can use any text indicator.
;
; $20.00  - Currency: dollar
; ?50     - Currency: pound
; 50 EUR  - Currency: euro
; 40 AAPL - Commodity: 40 shares of Apple stock


05/02 * Apple stock
	Assets:Stock				10 AAPL @ 126.30
	Assets:Chequing





; Example 3, continued:
;
;
; View the baseline cost of commodities when you bought them:
;	ledger -B -s bal ^assets:stock
;
; View what their current value:
;	ledger -V -s bal ^assets:stock
;
; View net gain/loss in the register:
;	ledger -g reg ^assets:stock








; Reporting balances!
;
;
; Show balance of accounts:
;	ledger bal
;
;
; Show subaccounts:
;	ledger -s bal
;
;
; Show only certain accounts:
;	ledger -s bal ^ass ^li		# assets vs. liabilities
;	ledger -s bal ^exp ^inc		# expenses vs. income





; Limit by dates
;
;
; A specific year:
;	ledger -p 2014 -s bal
;
; A specific month for this year:
;	ledger -p may -s bal
;	ledger -p june -s bal
;
;	ledger -s -p may bal ^exp ^inc		# :-)
;
; Range by dates: (show two months)
;	ledger --begin 2014/01/01 --end 2014/03/01 -s bal
;
; End dates are NOT inclusive.



; The register report
;
;
; Show all transactions for a given account:
;	ledger reg ^li.*visa
;
; Show expenses, totaled by month:
;	ledger -M reg ^exp
;
; Weekly: -W
; Yearly: -Y
;
; Show expenses by day of week (what day do I spend the most?)
;	ledger --dow reg ^exp
;
; Wide output: -w
; By payee: -P


; Sorting
;
;
; Normally, ledger entries are entered in order, but if not:
;
;	ledger --sort date reg ^exp














; Bought lettuce, bananas, etc.
05/05 * Zehrs
	Expenses:Phone Card		11.30
	Expenses:Groceries
	Liabilities:Visa		-20.39


;
; Thank you!
;
; For more information, visit:
;
;		http://ledger-cli.org/
;
;		man ledger
;
;
; For those interested, I have written scripts to help with
; common reporting.  Contact me on KWLUG-disc or directly.
;
; Chris Frey <cdfrey at foursquare.net>
; 2014/05/05
;
;









More information about the kwlug-disc mailing list