On Wed, Jul 2, 2014 at 7:28 PM, James A. Robinson <[email protected]> wrote:

> On Wed, Jul 2, 2014 at 3:55 PM, Martin Blais <[email protected]> wrote:
> > But if you mean "continuously", e.g., given some unrealized gain against
> > positions, how much of it can be considered due to the tax-man, always
> > calculated based on current ledger, I think you would need a custom
> script
> > to report that. You do have the cost basis of all assets in the Ledger,
> so
> > it would be possible to use this to estimate your taxes.
>
> Thanks, I think I do mean more of the continuously
> updating scenario.  Basically using the cost basis
> calculation and adding that to a virtual account
> that calculates the expected taxes.
>
> Say I have a ledger consisting of a salary paycheck:
>
> $ cat X
> 2014-01-01 * MyCo Paycheck
>         Assets:401k:MyCo                       $100.00  ; 401k: employer
> basic
>         Assets:401k:MyCo                       $100.00  ; 401k: employer
> match
>         Assets:401k:MyCo                       $100.00  ; 401k: pre-tax
>         Assets:401k:MyCo                       $100.00  ; 401k: post-tax
>         Assets:Prepaid Tax:Income:Federal      $400.00
>         Liabilities:Tax:Income:Federal        $-400.00
>         Expenses:Tax:Income:Federal            $400.00
>         Expenses:Tax:Federal:MED/EE             $60.00
>         Expenses:Tax:Federal:OASDI/EE          $100.00
>         Expenses:Tax:Ca:Dis/EE                  $20.00
>         Assets:Prepaid Tax:Income:Ca           $300.00
>         Liabilities:Tax:Income:Ca             $-300.00
>         Expenses:Tax:Income:Ca                 $300.00
>         Expenses:Insurance:Medical              $50.00
>         Expenses:Insurance:Vision                $6.00
>         Income:MyCo:Salary                  $-2,000.00
>         Income:MyCo:MyCo:Basic                $-100.00
>         Income:MyCo:MyCo:Match                $-100.00
>         Assets:MyBank:Checking
>
> I can use exact values to calculate the expected tax
> liability and prepaid tax (exactly equal in this case):
>
> $ ledger -f X balance Assets:Prepaid
>              $700.00  Assets:Prepaid Tax:Income
>              $300.00    Ca
>              $400.00    Federal
> --------------------
>              $700.00
>
> $ ledger -f X balance Liabilities
>             $-700.00  Liabilities:Tax:Income
>             $-300.00    Ca
>             $-400.00    Federal
> --------------------
>             $-700.00
>


You don't need these postings:

2014-01-01 * MyCo Paycheck
...
        Assets:Prepaid Tax:Income:Federal      $400.00
        Liabilities:Tax:Income:Federal        $-400.00
...
        Assets:Prepaid Tax:Income:Ca           $300.00
        Liabilities:Tax:Income:Ca             $-300.00

Those look incorrect to me. These won't work to calculate the tax you have
to pay in the future, which depends not on your contributions, but on the
amount of "distributions" when you take the money out, if we're talking
about pre-tax money (the amount of which hopefully will have grown
substantially at that point).

I would say: remove those entries and write a script that fetches the
current market value of the pre-tax account and calculate from that value
the amount of tax you will eventually have to pay, with reasonable
assumptions about the tax rate at the expected time of withdrawal (i.e. if
this is retirement, a low tax rate as you may not be working anymore). I
don't think you can use Ledger to have it compute that for you, though you
definitely can use Ledger to compute the market value of that 401k account.




and I can pivot report on the 401k balance:
>
> $ ledger -f X balance 401k --pivot=401k
>              $400.00  401k
>              $100.00    employer basic:Assets:401k:MyCo
>              $100.00    employer match:Assets:401k:MyCo
>              $100.00    post-tax:Assets:401k:MyCo
>              $100.00    pre-tax:Assets:401k:MyCo
> --------------------
>              $400.00
>
> Later on I'll be taking those dollars and buying
> stocks or something:
>
> 2014-02-02 * 401K Investment
> Assets:401k:VIPSX      29.607 VIPSX @@ $400.00
>  Assets:401k:MyCo
>
> The pivot report show that I'd have a $100.00
> cost basis in the 401k, and that everything else
> (employer basic, employer match, pre-tax), plus
> whatever gains made in excess of $400.00 due
> to changes in the stocks, have a liability equal
> to some appropriate tax rate.
>

Again, that's incorrect, once the investments grow, your "liability"
amounts will all be wrong.

As for the after-tax amounts, what I'd do if I were you is hold that in a
separate account from the pre-tax amounts. They're probably separate "real
world" accounts anyway, aren't they? (I'm curious, I haven't use after-tax
401k contributions yet, but I doubt they fold them into the same 401k
account.)

If it turns out that both pre-tax and after-tax money can be held in a
single real-world account - again, I'd really like to know how this works -
you could just create two subaccounts.



So I'd like to figure out a way to get a running
> approximation of taxes due, so that I can have
> a more accurate net worth report, similar to the
> Liabilities:Income:Tax accounts I maintain as
> part of the salary entry.
>

Just to be clear: when you say "tax due" here, you mean, taxes to be paid
on distributions, right?


Ha... I think you just gave me a fun idea!  I'll write a plugin in
Beancount that automatically adds a "future tax expense" entry to offset
pre-tax money for the balance sheet, e.g. if I have a 401k account with a
value of say 100,000 USD in it, it would automatically insert an entry at
the latest day like this:

  2014-07-03 F "Taxes to be paid on distributions."
    Expenses:Taxes:Federal        27000 USD
    Expenses:Taxes:StateNY         8000 USD
    Liabilities:FutureTaxesOnDistirbutiosn  -35000 USD

This would make the balance sheet reflect only post-tax money, and thus be
more meaningful.
If I want to see post-tax money, I'll just enable the plugin from a
command-line option.
I'd have to find some generic way to identify which accounts are pre-tax
somehow.



Which brings up another question: for a Roth IRA, one is able to obtain a
tax-free distribution up to the amount of its contributions way before
retirement (http://en.wikipedia.org/wiki/Roth_IRA#Advantages: "Direct
contributions to a Roth IRA (principal) may be withdrawn tax and penalty
free at any time"). This means that during the life of this Roth IRA
account, you have to keep track of the total amount of (contributions -
distributions taken). I'm not sure how I would go about doing that, I would
probably use a fake commodity, like I do for IRA and RRSP contributions,
e.g. add parallel legs that add ROTH units to a asset account whenever I
make a contribution and debit from these ROTH units if I take a
distribution of principal. Is anyone here doing this? How do you track your
contributions to it?

-- 

--- 
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