Skip to content

Instantly share code, notes, and snippets.

@tybl
Created May 27, 2017 14:57
Show Gist options
  • Save tybl/4e14082a2e8b8837749d93fe5b825bc2 to your computer and use it in GitHub Desktop.
Save tybl/4e14082a2e8b8837749d93fe5b825bc2 to your computer and use it in GitHub Desktop.
YNAB budgeting with ledger-cli
; This is a simple method of maintaining a budget using
; double-entry accounting software.
; Usually, double-entry accounting keeps track of
; assets, liabilities, income, and expenses. However,
; income/expense categories are different than budget
; categories. For one thing, income/expense categories
; continually grow, where budget categories tend to rise
; and fall. I decided to replace tracking my income/
; expenses with tracking my budget.
; One counterintuitive thing about this method is that
; when you have money to spend in a budget category,
; the balance will be negative.
2017-01-01 Opening Balances
Accounts:Checking $3210.98
Accounts:Savings $7654.32
; Only include credit cards that are paid in full each month.
; Their balance counts against the funds available to budget,
; which means they can be paid off immediately by
; "transferring" the funds between the accounts.
Accounts:Credit Card $-1953.79
Funds:Emergency Fund $-5000.00
Funds:Rent/Mortgage $-1059.00
Funds:Car Loan $-503.00
Funds:Groceries $-673.51
Funds:Cable/Internet $-103.00
Funds:Phone Service $-73.00
Funds:Vacation $-900.00
Funds:Spending $-600.00
2017-01-01 Paycheck
Accounts:Checking $1555.00
; To follow a YNAB like scheme of budgeting last month's
; income, new funds are held in a budget category for
; next month. Then when the new month rolls around, the
; other categories can be funded from this category.
Funds:Next Month $-1555.00
2017-01-02 A. Mortgage Bank
Accounts:Checking $-1059.00
Funds:Rent/Mortgage $1059.00
2017-01-03 Visa Mastercard payment
; Here is an example of making a payment for a credit
; card that is in the budget. Notice how no budget
; categories are adjusted here. That's because transfers
; between budgeted accounts don't affect budget balances.
; If the credit card was not a budgeted account
; (perhaps because it could not be paid in full),
; then a budget category would need to be created for its payments
; and those payments would look like the mortgage payment above.
Accounts:Checking $-976.89
Accounts:Credit Card $976.89
2017-01-04 Auto Savings and Loan
Accounts:Checking $-503.00
Funds:Car Loan $503.00
2017-01-05 Piggly Wiggly
Accounts:Credit Card $-170.00
Funds:Groceries $150.00
Funds:Spending $20.00
2017-01-12 Piggly Wiggly
Accounts:Credit Card $-160.00
Funds:Groceries $160.00
2017-01-15 Paycheck
Accounts:Checking $1555.00
Funds:Next Month $-1555.00
2017-01-19 Piggly Wiggly
Accounts:Credit Card $-152.00
Funds:Groceries $152.00
2017-01-20 America Online
Accounts:Credit Card $-103.00
Funds:Cable/Internet $103.00
2017-01-22 Better Buy
Accounts:Credit Card $-388.78
Funds:Spending $388.78
2017-01-23 Circuit Town
Accounts:Credit Card $-64.79
Funds:Spending $64.79
2017-01-25 Cingular Wireless
Accounts:Credit Card $-73.00
Funds:Phone Service $73.00
2017-01-26 Piggly Wiggly
Accounts:Credit Card $-202.10
Funds:Groceries $170.00
Funds:Spending $32.10
2017-01-31 Credit Union
Accounts:Checking $0.32
Accounts:Savings $1.19
Funds:Next Month
2017-02-01 Monthly Allocation
Funds:Next Month $3111.51
Funds:Mortgage/Rent $-1059.00
Funds:Car Loan $-503.00
Funds:Groceries $-673.51
Funds:Cable/Internet $-103.00
Funds:Phone Service $-73.00
Funds:Vacation $-100.00
Funds:Spending $-600.00
@tybl
Copy link
Author

tybl commented May 27, 2017

Also, I would blow my spending money when it became available. This led to misery because I had no spending money for the rest of the month. The solution I found was to add funds to my spending account slowly, over time. For example:

2017-01-01 Monthly Allocation
   Funds:Next Month        $600.00
   Funds:Weekly           $-600.00

2017-01-01 Weekly Allocation
   Funds:Weekly            $120.00 = $-480.00
   Funds:Spending         $-120.00

2017-01-08 Weekly Allocation
   Funds:Weekly            $120.00 = $-360.00
   Funds:Spending         $-120.00

2017-01-15 Weekly Allocation
   Funds:Weekly            $120.00 = $-240.00
   Funds:Spending         $-120.00

2017-01-22 Weekly Allocation
   Funds:Weekly            $120.00 = $-120.00
   Funds:Spending         $-120.00

2017-01-29 Weekly Allocation
   Funds:Weekly            $120.00 =    $0.00
   Funds:Spending         $-120.00

@Ramblurr
Copy link

@tblyons How has this been working for you? Could it work to use this system plus a nor.al expense tracking system? I want to avoid virtual transactions if possible.

I really like how you have modeled the "use last months income" bit from ynab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment