Help to a newbie...
Hello to everyone, I'm a very astonished new Ledger user. TOO many
features, several ways to accomplish the same goals. The hard part is to
figure out how to do it on the most optimal way.
I'm currently a GNUCash user with a programming background. I've seen the
several gnucash2ledger scripts available and decided to write my own
focusing on the very specific transformations I want to apply to my gnucash
data before bringing it to ledger.
I have some questions though and I would be immensely grateful if anyone
with a more profound experience could point me to the right direction.
First things first: on gnucash I have an account tree that mixes "real"
accounts with "virtual" ones. There are accounts that represent a bank or a
credit card, and there are accounts that represent a purpose for the money
in it, like emergency reserve, retirement plan and planned spending.
For a while there was a 1 to 1 relationship where my brokerage account only
contained funds related to my retirement portfolio (assets I plan to use
when working no more). Then more complicated things started to happen... I
was saving for expenses on the end of the year making deposits on a bank
CDB account (It's a Brazilian way of lending money to a bank and receiving
more interest that a regular savings account, I don't know what would be
the USA equivalent).
The Bank CDB account also has resources designated to my retirement, so how
to represent this? Here I discovered Ledger.
I mapped all my accounts to "real" accounts so Ledger would know where the
resources actually are.
===== PROBLEM ONE =====
== part one ==
I have a rule: 20% of everything I make gross should go to my Retirement
Fund. To accomplish that I created the following automatic transaction:
= Income
(Liabilities:Funds:Retirement Plan) 0.2
This is a sample paycheck entry:
2011/08/30 Paycheck
! Expenses:Taxes BRL 500,00
* Assets:Checking BRL 5.000,00
Income:Employer BRL -5.500,00
Which will read:
2011/08/30 Paycheck
! Expenses:Taxes BRL 500,00
* Assets:Checking BRL 5.000,00
Income:Employer BRL -5.500,00
(Liabilities:Funds:Retirement Plan) BRL -1.100,00
Creating a "virtual" debt to myself. Is this the proper way to proceed?
I'm not really worried at this point on how well my stock allocation is
doing, I want to make sure that I'm putting exactly the amount I need to
according with my rules.
== part two ==
>From my checking account the money then goes to Assets:Brokerage account
and when I buy stock it is registered like this:
2012/01/03 * Buy PETR4
Assets:Brokerage account BRL -1.010,00
Assets:Brokerage account 10 "PETR4" @ BRL 100,00
Expenses:Brokerage commission BRL 10,00
Is this the best way to represent this transaction? How do you guys do it?
How could I represent what my intent was for buying this stock? Like below?
2012/01/03/ * Buy PETR4
Assets:Brokerage account BRL -1.010,00
Assets:Brokerage account 10 "PETR4" @ BRL 100,00
Expenses:Brokerage comission BRL 10,00
[Assets:Brokerage account] -10 "PETR4" @ BRL 100,00
[Assets:Funds:Retirement] 10 "PETR4" @ BRL 100,00
Isn't this too much retyping? Could this be automated?
= tag('retirement-fund')
[$account] -1
[Assets:Funds:Retirement] 1
2012/01/03 * Buy PETR4
Assets:Brokerage account BRL -1.010,00
Assets:Brokerage account 10 "PETR4" @ BRL 100,00 ; :retirement-fund:
Expenses:Brokerage comission BRL 10,00
Is there a better way?
More important: how to tie this with what I described on part one? The
"virtual-nonbalanced debt" that was created upon receiving my paycheck. How
do I balance all these accounts so I could have an accurate Net Worth
calculated?
===== PROBLEM TWO =====
== part one ==
I have a second rule: I should keep an emergency reserve with a minimum of
BRL 10.000,00. *IF* the emergency reserve is below that point, then I
should top it off as soon as I can. If it is at least on that point then I
should deposit BRL 100,00 every month. How to accomplish this?
So, let's say that today my emergency reserve has BRL 8.000,00. How could I
instruct ledger to forecast a transaction transfering BRL 2.000,00 next
month and BRL 100,00 for every month after that?
I understand that maybe I should have a [Liabilities:Funds:Emergency
Reserve] summing up all I have to deposit back. Would this be a better way?
== part two ==
My emergency reserve fund is diversified as well. How could it be for
emergency purposes if I'm trusting only one entity? So to avoid a single
point of failure I have CDB and savings accounts on two banks. Those
accounts have resources designated to purposes other than only emergency so
how to describe money moving?
= tag('emergency-reserve')
[$account] -1
[Assets:Funds:Emergency Reserve]
2012/03/03 Emergency Reserve Deposit
Assets:Bank A CDB BRL 5.000,00 ; :emergency-reserve:
Assets:Checking
2012/03/10 Emergency Car Repair
Expenses:Car:Repair BRL 800,00
Assets:Checking
2012/03/11 Emergency Reserve Withdraw
Assets:Bank B Savings BRL -800,00 ; :emergency-reserve:
Assets:Checking
Is this acceptable? Is there a better way?
===== PROBLEM THREE =====
I am what you could call a "meta-data-bitch". If there is a way to describe
a transaction exactly as it happens on the real world and add meta data to
extract more value from it, then that is the way I prefer to go. That said,
my third problem is: because gnucash supports only one commodity per
account I need several, one for each stock, stock option, bonds, etc. I
group all these commodity-accounts into areas/sectors or markets. That way
I can analyse how much I'm allocating in each slice and adjust my next
deposit accodingly.
Ledger, however, gracefully handles multiple commodities/currencies on the
same account. Much much better in my opinion because my brokerage account
really has all my stock + any remaining balance from last month. This is
representing the world as it is.
What I'm looking for is a way to tag individual commodities to latter group
them on reports, like a balance report of Assets:Funds:Retirement grouped
by market or sector.
BRL 1.000,00 Exchange traded funds
BRL 2.000,00 Top companies
BRL 1.400,00 Startups
BRL 500,00 Government Bonds
-----------------------------
BRL 4.900,00 [Assets:Funds:Retirement]
Is there a way to do this on the commodity level instead of having to tag
each individual split? Like...
commodity "PETR4"
; type: Top companies
; sector: energy
[...]
===== ------ =====
Well, this is it! I think this is quite a large post, any guidance will be
appreciated!
Greetings from Brazil,
Raphael Abreu