Stefano Zacchiroli <[email protected]> writes:

[...]

> It's tangential to the main question of this thread, but I'd like to
> mention an annoyance in Ledger's budgeting which I've encountered
> precisely when dealing with mortgage interests. Maybe someone will have
> a brilliant solution to propose!
>
> Let's assume you've a fixed interest rate mortgage. Usually the amount
> of money you pay monthly is fixed (say, 1000 USD), but the breakdown of
> that amount into principal vs interests changes over time (with the
> relative amount of interests you pay monthly diminishing over time).
>
> To book those transactions properly in ledger, you should use distinct
> accounts like Liabilities:Mortgage, Expenses:Interests, and of course
> Assets:Checking. The only leg of those periodic transactions that will
> stay constant over time is Assets:Checking; the *sum* of
> Liabilities:Mortgage and Expenses:Interests will stay constant as well,
> but the two amounts will not.
>
> How do you do budgeting/forecasting about this in Ledger?
>
> Ideally, I want Ledger to only report drifts when the sum of principal
> and interests is not as expected (which should never happen).

[...]

We use virtual accounts for budgeting loans. We track the real amounts
in the ledger file, while virtual accounts track the budget
requirements.

An automated transaction matches the liability and expense accounts, and
transforms them into a single virtual 'loan budget' account. The budget
shows money coming out of our asset account and going into the combined
loan budget account.

    = Liability:Loan A
        [Liability:Loan A]                            -1
        [Virtual:Loan A]                               1

    = Expense:Interest:Loan A
        [Expense:Interest:Loan A]                     -1
        [Virtual:Loan A]                               1

When I want to know how much money I still owe, I can pass "--real" to
ledger. The "--real" flag ignores both virtual and automatic
transactions (like budget transactions), so that means I'm not asking
budget questions. But most of the time I want to track myself against
the budget, and no flags are needed.

Here's more complete sample:

--8<---------------cut here---------------start------------->8---
; I have the following *real* accounts:

account Liability:Loan A
account Expense:Interest:Loan A
account Asset:Checking

; A virtual Loan A account for budgeting:

account Virtual:Loan A

; My budget entry is:

~ Monthly
    [Virtual:Loan A]                         $100.00
    [Asset:Checking]

; And then the magic is in the automated transaction. Sorry about the
; regular expression here, but that's what we really do

= /^(Liability|Expense:Interest):Loan A
    [$account]                                    -1
    [Virtual:Loan A]                               1

; Now my transactions

2014/10/26 Bank Of Example
    Liability:Loan A                          $50.00
    Expense:Interest:Loan A                   $50.00
    Asset:Checking                          $-100.00

2014/11/26 Bank Of Example
    Liability:Loan A                          $60.00
    Expense:Interest:Loan A                   $40.00
    Asset:Checking                          $-100.00

; For the posts I'm making today, I don't actually know what the bank
; is going to do, so I put in a guess and tag it for later revision

2015/12/26 Bank Of Example
    Liability:Loan A                          $70.00  ; :Estimate:
    Expense:Interest:Loan A                   $30.00  ; :Estimate:
    Asset:Checking                          $-100.00
--8<---------------cut here---------------end--------------->8---

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to