1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643
|
;;; -*- mode: org; mode: beancount; coding: utf-8; -*-
#+STARTUP: showall
;;;
;;; This is a basic example demo file, with some example accounts and
;;; some example transactions. A real-life Ledger file has a lot
;;; more transactions in it, and possibly a very different set
;;; of accounts; feel free to define your own and to change
;;; everything in here if you use this as a template. You can be
;;; creative, because all the account categories and commodities
;;; are entirely generic. (More comments are sprinkled below.)
;;;
;;; The order in which the transactions are declared does not
;;; matter at all... personally I like to organize transactions
;;; in chronological order, within sections that are
;;; more-or-less by account. I normally pretty much keep them in
;;; the order that the converted OFX file presents them. Here
;;; however, I've ordered the transactions for better clarity of
;;; presentation, since this is a file with sample transactions.
* Options
option "title" "Beancount Example Ledger"
option "operating_currency" "USD"
option "operating_currency" "CAD"
* Initialization
;;; Declaration of Accounts.
;;; Here you can declare a list of valid accounts, and
;;; optionally, a constraint on which kind of commodity they are
;;; allowed to hold (helps you track down mistakes).
;;;
;;; Note that
;;;
;;; - the system supports any currencies, and works with
;;; multiple commodities in the same Ledger.
;;;
;;; - No distinction is made between currency commodities (e.g.
;;; USD, EUR, USD) and investment commodities (e.g. FB, AMZN,
;;; AAPL, MSFT).
;;;
;;; - The Assets, Liabilities, Equity, Income, Expenses
;;; categories are not special; they are simply a convention;
;;; be creative if you like. There are really only two kinds
;;; of accounts: debit accounts and credit accounts, and the
;;; type is only used for reporting (maybe).
;defaccount De Assets:Fixed:Home USD
1970-01-01 open Assets:UTrade:Account USD
1970-01-01 open Assets:UTrade:Account:AAPL AAPL
1970-01-01 open Assets:UTrade:Account:EWJ EWJ
;defaccount De Assets:Loans
1970-01-01 open Assets:AccountsReceivable
;defaccount Cr Liabilities:AccountsPayable
1970-01-01 open Liabilities:BestBank:Mortgage:Loan USD
1970-01-01 open Liabilities:Credit-Card:VISA USD
1970-01-01 open Liabilities:Condo-Management USD
1970-01-01 open Equity:Opening-Balances
1970-01-01 open Income:Interest:Checking
1970-01-01 open Income:Interest:Savings
1970-01-01 open Income:Dividends
1970-01-01 open Income:Capital-Gains
1970-01-01 open Income:Salary:AcmeCo
1970-01-01 open Expenses:Financial:Fees
1970-01-01 open Expenses:Financial:Commissions
1970-01-01 open Expenses:Insurance:Life
1970-01-01 open Expenses:Food:Restaurant
1970-01-01 open Expenses:Food:Grocery
1970-01-01 open Expenses:Food:Alcool
1970-01-01 open Expenses:Communications:Phone
1970-01-01 open Expenses:Communications:Mail
;defaccount De Expenses:Transportation:Parking
1970-01-01 open Expenses:Transportation:Taxi
;defaccount De Expenses:Transportation:Trains
;defaccount De Expenses:Transportation:PublicTrans
;defaccount De Expenses:Taxes:US-State-California USD
1970-01-01 open Expenses:Taxes:US-Federal USD
1970-01-01 open Expenses:Govt-Services USD
1970-01-01 open Expenses:Clothes
1970-01-01 open Expenses:Car:Gas
1970-01-01 open Expenses:Sports
1970-01-01 open Expenses:Sports:Gear
1970-01-01 open Expenses:Fun:Movie
;defaccount De Expenses:Fun:Museum
1970-01-01 open Expenses:Books
;defaccount De Expenses:Travel:Flights
;defaccount De Expenses:Travel:Accomodation
;defaccount De Expenses:Toys:Photography
;defaccount De Expenses:Toys:Computer
;defaccount De Expenses:Office-Supplies
1970-01-01 open Expenses:Medical
1970-01-01 open Expenses:Charity
;defaccount De Expenses:Misc
;defaccount De Expenses:Home:Repair
;defaccount De Expenses:Home:Maintenance
;defaccount De Expenses:Home:Taxes:Municipal
;defaccount De Expenses:Home:Taxes:School
;defaccount De Expenses:Home:Insurance
;defaccount De Expenses:Home:Monthly
;defaccount De Expenses:Home:Monthly:Internet
1970-01-01 open Expenses:Home:Monthly:Condo-Fees
;defaccount De Expenses:Home:Monthly:Electricity
1970-01-01 open Expenses:Home:Monthly:Loan-Interest
;defaccount De Expenses:Home:Monthly:Water
;defaccount De Expenses:Home:Acquisition:Furniture
;defaccount De Expenses:Home:Acquisition:Renovations
;defaccount De Expenses:Home:Acquisition:Legal
;defaccount De Expenses:Home:Acquisition:Inspection
;;; You can provide mappings from the account numbers ("account
;;; ids") that are normally found in OFX files that the
;;; banks/brokers provide, mapping to account names in this
;;; Ledger file. This way, a script that converts the OFX into
;;; Ledger-compatible syntax is able to automatically figure out
;;; the right account names.
;;; Account number mappings.
;;accid "123456789012" Assets:BestBank:Checking
;;accid "123456789012" Assets:BestBank:Savings
;;accid "1234567890" Liabilities:BestBank:Mortgage:Loan
;;accid "1234567890123456" Liabilities:Credit-Card:VISA
;;accid "1234567890" Assets:UTrade:Account
* Assets:BestBank:Checking
1970-01-01 open Assets:BestBank:Checking USD
;; This entry tells the software to automatically insert an
;; entry at this date, of the amount required to fulfill the
;; next check directive (chronologically) in the account (for
;; all commodities present). If the required amount is 0, no
;; entry is added.
2007-12-31 pad Assets:BestBank:Checking Equity:Opening-Balances
;; This directive tells the software to assert that at the given
;; date, in the given account, a specific amount of the given
;; commodity was present.
2008-01-01 balance Assets:BestBank:Checking 1412.24 USD
;; A check deposit, e.g. depositing a government check.
2008-01-05 * "GST CANADA" "Deposit from govt for consumer tax rebate"
Assets:BestBank:Checking 77.76 USD
Expenses:Taxes:US-Federal
;; This is how salary direct deposit entries might show up
;; within the checking account section. Note how the salaries
;; are negative amounts... that's because Income is a credit
;; account category, and the numbers there are negative (you can
;; interpret this as the "amount of work-dollars that you took
;; from society and placed into your account").
2008-01-10 * "ACME" "Salary paid from employer"
Assets:BestBank:Checking 2000.00 USD
Income:Salary:AcmeCo -2000 USD
2008-01-25 * "ACME" "Salary paid from employer"
Assets:BestBank:Checking 2000.00 USD
Income:Salary:AcmeCo
2008-02-10 * "ACME" "Salary paid from employer"
Assets:BestBank:Checking 2000.00 USD
Income:Salary:AcmeCo
2008-02-25 * "ACME" "Salary paid from employer"
Assets:BestBank:Checking 2000.00 USD
Income:Salary:AcmeCo
;; Withdrawal from another bank's ATM machine (with fees).
2008-01-12 * "ATM withdrawal - 00044242"
Assets:BestBank:Checking -301.50 USD
Expenses:Financial:Fees 1.50 USD
Assets:Cash
;; ATM withdrawal (without fees).
2008-01-30 * "ATM withdrawal"
Assets:BestBank:Checking -800.00 USD
Assets:Cash
2008-02-10 * "ATM withdrawal"
Assets:BestBank:Checking -500.00 USD
Assets:Cash
2008-02-24 * "ATM withdrawal"
Assets:BestBank:Checking -500.00 USD
Assets:Cash
;; Automated withdrawal for Life insurance payments.
2008-01-02 * "LIFE INSURANCE -- LONDON LIFE"
Assets:BestBank:Checking -42.69 USD
Expenses:Insurance:Life
2008-02-02 * "LIFE INSURANCE -- LONDON LIFE"
Assets:BestBank:Checking -42.69 USD
Expenses:Insurance:Life
;; A purchase from a store using the bank's debit card.
2008-01-17 * "Interac Purchase - 1341 - ACCES SPORTS S"
Assets:BestBank:Checking -89.00 USD
Expenses:Sports:Gear
;; A monthly fee that the bank takes for its deposit banking services.
2008-01-10 * "MONTHLY FEE"
Assets:BestBank:Checking -4.00 USD
Expenses:Financial:Fees
;; A typical bank's return on checking accounts.
2008-01-12 * "Deposit interest"
Assets:BestBank:Checking 0.02 USD
Income:Interest:Checking
;; An example of using the A/R account: I bought an electronic
;; toy for a friend, and I wanted to track the amount that he
;; should pay back to me. Instead of placing it in expenses, I
;; made it a receivable, which was cancelled later on where he
;; paid me back.
2008-03-26 * "Bought an iPhone to Gilbert (had to use ATM)"
Assets:AccountsReceivable 431.92 USD
Expenses:Financial:Fees 3.00 USD
Assets:Cash -434.92 USD
;; Notice that the amount pay back was for an approximate
;; amount, so the overflow I placed in the cash account.
2008-04-02 * "Gilbert paid back for iPhone"
Assets:Cash 440.00 CAD
Assets:AccountsReceivable -431.92 USD
Assets:Cash
;; At the end of the month, I take my statements, look at the
;; bottom and enter the amount that the bank says was there at
;; that date. It should corroborate with the data in my Ledger.
2008-02-01 balance Assets:BestBank:Checking 661.49 USD
* Assets:BestBank:Savings
1970-01-01 open Assets:BestBank:Savings USD
2007-12-31 pad Assets:BestBank:Savings Equity:Opening-Balances
2008-01-01 balance Assets:BestBank:Savings 12000 USD
;; Interest paid on balance in savings account.
2008-01-03 * "DEPOSIT INTEREST"
Assets:BestBank:Savings 95.69 USD
Income:Interest:Savings
;; An entry that indicates a bank transfer from a checking account to a savings account.
;; There is a choice to locate this entry with the savings or with the checking, it's up to you.
2008-01-29 * "Transfer from checking to savings account"
Assets:BestBank:Savings 2000.00 USD
Assets:BestBank:Checking
2008-02-03 * "DEPOSIT INTEREST"
Assets:BestBank:Savings 102.34 USD
Income:Interest:Savings
2008-02-03 * "Transferring money to brokerage account for better investment."
Assets:BestBank:Savings -10000.00 USD
Assets:UTrade:Account
;; A monthly check using the amount on the stament.
2008-03-01 balance Assets:BestBank:Savings 2340.19 USD
;; Automated mortgage payments from the savings account.
2008-01-12 * "MORTGAGE PAYMENT"
Assets:BestBank:Savings -464.46 USD
Liabilities:BestBank:Mortgage:Loan 171.01 USD
Expenses:Home:Monthly:Loan-Interest
2008-01-27 * "MORTGAGE PAYMENT"
Assets:BestBank:Savings -464.46 USD
Liabilities:BestBank:Mortgage:Loan 171.01 USD
Expenses:Home:Monthly:Loan-Interest
2008-02-12 * "MORTGAGE PAYMENT"
Assets:BestBank:Savings -464.46 USD
Liabilities:BestBank:Mortgage:Loan 171.01 USD
Expenses:Home:Monthly:Loan-Interest
2008-02-27 * "MORTGAGE PAYMENT"
Assets:BestBank:Savings -464.46 USD
Liabilities:BestBank:Mortgage:Loan 171.01 USD
Expenses:Home:Monthly:Loan-Interest
2008-03-12 * "MORTGAGE PAYMENT"
Assets:BestBank:Savings -464.46 USD
Liabilities:BestBank:Mortgage:Loan 171.01 USD
Expenses:Home:Monthly:Loan-Interest
2008-03-27 * "MORTGAGE PAYMENT"
Assets:BestBank:Savings -464.46 USD
Liabilities:BestBank:Mortgage:Loan 171.01 USD
Expenses:Home:Monthly:Loan-Interest
* Liabilities:Credit-Card:VISA
2007-12-31 pad Liabilities:Credit-Card:VISA Equity:Opening-Balances
2008-01-01 balance Liabilities:Credit-Card:VISA -791.34 USD
;; Paying back my credit card.
2008-01-22 * "Online Banking payment - 5051 - VISA"
Assets:BestBank:Checking -791.34 USD
Liabilities:Credit-Card:VISA
;; Expenses at restaurants on credit card.
2008-01-15 * "Cafe Imagination" ""
Liabilities:Credit-Card:VISA
Expenses:Food:Restaurant 47.00 USD
2008-01-19 * "Soupe Bol" ""
Liabilities:Credit-Card:VISA -21.00 USD
Expenses:Food:Restaurant
2008-01-27 * "Scola Pasta" ""
Liabilities:Credit-Card:VISA
Expenses:Food:Restaurant 51.17 USD
;; Cell phone bill via credit crad.
2008-01-19 * "FIDO" ""
Liabilities:Credit-Card:VISA
Expenses:Communications:Phone 121.96 USD
* Assets:UTrade:Account
2007-12-31 pad Assets:UTrade:Account Equity:Opening-Balances
2008-01-01 balance Assets:UTrade:Account 31273.02 USD
;; Some example trades.
;;
;; - Notice how I like to create a special account to contain
;; each kind of commodity. This choice is an arbitrary one: I
;; could keep all the stocks in the one investing account
;; (which would then contain many different kinds of
;; commodities) but doing it this way I can more easily track
;; the book value of the remaining shares that I have. I think
;; there may be a better way to do this.
;;
;; - Usually I enter the final amounts from the trade
;; confirmation slips that get emailed to me, because the
;; information there is more precise and detailed than what I
;; seem to get from the online brokerage interface. YMMV.
;;
;; - I still don't have a good generic way to deal with the
;; capital gains automatically, so I enter them by hand for
;; now. The challenge is to find a generic way to account
;; for capital gains while accounting for commissions and
;; trade fees the correct way (they should get removed from the
;; capital gains at both ends of a trade).
;;
;; - Note that the "185.40 USD" cost amount below refers to the
;; price PER UNIT of AAPL. If you wanted to provided a cost for
;; the full amount, you could use two brackets, e.g. {{185.40 USD}}.
2008-01-08 * "Buy some Apple Computer"
Assets:UTrade:Account:AAPL 30 AAPL {185.40 USD}
Assets:UTrade:Account
Expenses:Financial:Commissions 9.95 USD
;; A dividend payment.
2008-02-02 * "DIVIDEND from AAPL position"
Assets:UTrade:Account 0.68 USD
Income:Dividends
;; Because of my skirt-length statistic computation.
2008-02-28 * "Sell off my Apple"
Assets:UTrade:Account:AAPL -30 AAPL {185.40 USD} @ 193.02 USD
Assets:UTrade:Account 5780.65 USD
Expenses:Financial:Commissions 9.95 USD
Income:Capital-Gains
;; The line that says "BOOK AAPL" means to insert the amount that
;; corresponds to the gains/losses for the commodity "AAPL" within
;; the account for the posting in this transaction that includes AAPL
;; (Assets:UTrade:Account:AAPL, found automatically).
;; The inventory booking is done in FIFO order.
;;
;; The capital gain will show up as a negative number...
;; that's because Income is a credit account, like a salary.
;; This position is kept long, so it gets reflected below in the check.
2008-02-10 * "Buy some japanese ETF from iShares"
Assets:UTrade:Account:EWJ 100 EWJ {13.34 USD}
Assets:UTrade:Account
Expenses:Financial:Commissions 9.95 USD
;; Run checks against statement summary of positions that gets
;; mailed periodically.
2008-03-01 balance Assets:UTrade:Account 40138.45 USD
2008-03-01 balance Assets:UTrade:Account:AAPL 0 AAPL
2008-03-01 balance Assets:UTrade:Account:EWJ 100 EWJ
* Expenses:Insurance:Life
;; Estimate of value of life insurance policy, to account for
;; total net worth.
2008-01-01 * "Life insurance policy resale value"
Expenses:Insurance:Life 4407.06 USD
Equity:Opening-Balances
* Assets:Fixed:Home
;; You could use this account in order to reevaluate your home.
* Expenses:Home:Monthly:Condo-Fees
2007-12-31 pad Liabilities:Condo-Management Equity:Opening-Balances
2008-01-01 balance Liabilities:Condo-Management -41.11 USD
2008-01-01 * "Propri-Manage" ""
Expenses:Home:Monthly:Condo-Fees 212.61 USD
Liabilities:Condo-Management
2008-01-14 * "(998) Propri-Manage" "cheque sent by snail mail"
Liabilities:Condo-Management 800.00 USD
Assets:BestBank:Checking
2008-02-01 * "Propri-Manage" ""
Expenses:Home:Monthly:Condo-Fees 212.61 USD
Liabilities:Condo-Management
2008-03-01 * "Propri-Manage" ""
Expenses:Home:Monthly:Condo-Fees 212.61 USD
Liabilities:Condo-Management
2008-03-10 * "Propri-Manage" "special billing, spring works"
Expenses:Home:Monthly:Condo-Fees 61.25 USD
Liabilities:Condo-Management
2008-04-01 balance Liabilities:Condo-Management 59.81 USD
* Assets:Cash
* Expenses:*
1970-01-01 open Assets:Cash
2007-12-30 pad Assets:Cash Equity:Opening-Balances
;; Amount in wallet at a given time.
2007-12-31 balance Assets:Cash 200 CAD
2007-12-31 balance Assets:Cash 300 USD
;; Because I don't track individual cash expenses very tightly,
;; I still need to distribute the cash that disappeared into
;; appropriate expense categories. What I like to do is
;; guesstimate that about 80% of it goes into restaurants, and
;; 20% into wine bars. What frequency and categories you choose
;; to use is highly dependent on your lifestyle...
2008-01-02 * "Distribution of cash expenses"
Expenses:Food:Restaurant 300.00 USD
Expenses:Food:Alcool 100.00 USD
Assets:Cash
2008-01-16 * "Distribution of cash expenses"
Expenses:Food:Restaurant 300.00 USD
Expenses:Food:Alcool 100.00 USD
Assets:Cash
2008-02-02 * "Distribution of cash expenses"
Expenses:Food:Restaurant 300.00 USD
Expenses:Food:Alcool 100.00 USD
Assets:Cash
2008-02-16 * "Distribution of cash expenses"
Expenses:Food:Restaurant 300.00 USD
Expenses:Food:Alcool 100.00 USD
Assets:Cash
2008-03-02 * "Distribution of cash expenses"
Expenses:Food:Restaurant 300.00 USD
Expenses:Food:Alcool 100.00 USD
Assets:Cash
2008-03-16 * "Distribution of cash expenses"
Expenses:Food:Restaurant 300.00 USD
Expenses:Food:Alcool 100.00 USD
Assets:Cash
;;
;; Some common cash expenses.
;;
2008-02-18 * "DMV" "Renewal of driver's license."
Expenses:Govt-Services 110.00 USD
Assets:Cash
2008-01-21 * "WHOLE FOODS" ""
Expenses:Food:Grocery 54.03 USD
Assets:Cash
2008-01-21 * "USPS" "sent package to mom"
Expenses:Communications:Mail 4.43 USD
Assets:Cash
2008-02-04 * "taxi home from meeting"
Expenses:Transportation:Taxi 12.00 USD
Assets:Cash
;; Short weekend trip to Skii Mountain.
;;
;; You can use the pushtag and poptag directives to mark all
;; transactions between them with a specific tag. Later on you
;; can filter the postings to a tag by using a cmdline. This
;; allows you to find out what expenses were incurred during a
;; specific trip.
pushtag #ski-trip
2008-01-27 * "SUNONO" "fill'er up"
Expenses:Car:Gas 40 USD
Assets:Cash
2008-01-27 * "SKII" "Lift tickets"
Expenses:Sports 120 USD
Assets:Cash
2008-01-27 * "Dinner at chalet"
Expenses:Food:Restaurant 35.33 USD
Assets:Cash
2008-01-28 * "breakfast"
Expenses:Food:Restaurant 17.23 USD
Assets:Cash
2008-01-28 * "a new hat, it was cold"
Expenses:Clothes 40.02 USD
Assets:Cash
poptag #ski-trip
2008-03-03 * "ALDO" "new shoes"
Expenses:Clothes 121.20 USD
Assets:Cash
2008-02-24 * "AMC" "movies with girlfriend"
Expenses:Fun:Movie 24 USD
Assets:Cash
2008-03-06 * "Barnes & Noble" "books on accounting"
Expenses:Books 74.43 USD
Assets:Cash -74.43 USD
2008-02-03 * "ITHURTS MEDICAL CENT" "x-ray for broken bones"
Expenses:Medical 312.00 USD
Assets:Cash
2008-03-02 * "ZEN CENTER" "Donation to Zen center"
Expenses:Charity 50 USD
Assets:Cash
2008-03-01 balance Assets:Cash 200.00 CAD
2008-03-01 balance Assets:Cash 30.96 USD
2008-03-15 price USD 1.0934 CAD
2013-07-03 event "location" "New York City"
|