I've added a powerful new feature to Beancount this weekend, as a plugin.
Anyhow, within an hour I had fixed all the errors that were now showing due to the tighter verification. My personal file is now error free and I've got this enabled permanently... I'll leave this extra check as an optional plugin, but I would recommend Beancount users turn it on and tighten their input file with this extra check; you might find some errors in your data entry.
Thanks for adding this. As expected, this reveals a few kinds of errors I don't know how to resolve.1. Basic rounding errors:Invalid price vs. proceeds/gains: (0.03576 USD) vs. ()2011-01-25 * "Transfer of Assets, 3467.90 USD"* Assets:Investments:RothIRA:Vanguard:VTIVX 250.752 VTIVX {18.35 USD} @ 13.83000000000000 USD* Assets:Investments:RothIRA:DodgeCox:DODGX -30.892 DODGX {148.93 USD} @ 112.26000000000000 USDOne such transaction already has a 2-cent Expenses:RoundingError posting to make everything balance. I suppose I could add a couple cents to an Income:RoundingError account too, but I'd much rather that Beancount recognize that 0.001 DODGX is worth 0.14893 USD, so a rounding error of 0.03576 USD can be ignored.
Do you not have this problem regularly?
2. ESPP (Employee Stock Purchase Plan) purchases:Invalid price vs. proceeds/gains: (-3570.24557 USD) vs. (-3213.35 USD)2005-01-05 * "ESPP Purchase"* Assets:Investments:MutualFunds:Fidelity:MSFT 133.667 MSFT {24.04 USD} @ 26.71000000000000 USD* Assets:Investments:MutualFunds:Fidelity:Cash -3213.35 USDIt appears you have some experience with ESPP transactions,
so how do you represent this (and could you please add it to the Cookbook)?
Each share is worth $26.71, but we can buy it for $24.04. It's been many years since I've had to deal with this, but it appears that the discount is taxed as regular income at the time of sale, and the cost basis ends up being the market price. I don't see how to record at purchase time what won't be income until a future sale.
3. Unknown accounts represented as Equity:UnknownSourceOrSink:Invalid price vs. proceeds/gains: (15516.59644 USD) vs. ()2011-01-20 * "Shares Redeemed"* Assets:Investments:MutualFunds:ClipperFund:CFIMX -245.788 CFIMX {84.13 USD} @ 63.13000000000000 USDEquity:UnknownSourceOrSink 15516.60 USDIncome:Investments:MutualFunds:ClipperFund:PnL 5162.40 USDI have some transactions for which I'm missing the corresponding bank statements. I sometimes have a good idea of which account is involved, but I'm not sure. I've been using Equity:UnknownSourceOrSink to represent these so I don't distort my balance sheet. The sellgains plugin specifically looks for Assets accounts. What do you suggest here?
>
> 1. Basic rounding errors:
>
> Invalid price vs. proceeds/gains: (0.03576 USD) vs. ()
> 2011-01-25 * "Transfer of Assets, 3467.90 USD"
> * Assets:Investments:RothIRA:Vanguard:VTIVX 250.752 VTIVX {18.35 USD} @ 13.83000000000000 USD
> * Assets:Investments:RothIRA:DodgeCox:DODGX -30.892 DODGX {148.93 USD} @ 112.26000000000000 USD
>
I fixed a similar transaction by slightly adjusting the @ or @@ until the warning went away. I don't know about your example, but maybe 13.83 or 112.26 USD aren't exact numbers, maybe they had some decimals like 13.831 USD. I often get reports with 2 decimals while transactions use 3.
> One such transaction already has a 2-cent Expenses:RoundingError posting to make everything balance. I suppose I could add a couple
> cents to an Income:RoundingError account too, but I'd much rather that Beancount recognize that 0.001 DODGX is worth 0.14893 USD, so
> a rounding error of 0.03576 USD can be ignored.
Maybe you know it, but…: the way to ignore small amounts is: option "tolerance" "0.001"
But I would say that 0.03576 USD is already too big to go unnoticed. I would use an Expenses:RoundingError account for these cases. Instead of having Expenses:Rounding and Income:Rounding I post everything (+ or -) to the same one.
> that Beancount recognize that 0.001 DODGX is worth 0.14893 USD
Or you could write it explicitly: 0.001 DODGX @ 0.14893 USD
But anyway 0.001 DODGX = 0.11226 USD from the @ you wrote
These are some vague ideas which may or may not help with your transaction. I don't know about the other 2, sorry.
--
Daniel
--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/871tix3h38.wl-n142857%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
On Sat, May 2, 2015 at 6:22 PM, Matthew Harris <mharr...@gmail.com> wrote:Thanks for adding this. As expected, this reveals a few kinds of errors I don't know how to resolve.1. Basic rounding errors:Invalid price vs. proceeds/gains: (0.03576 USD) vs. ()2011-01-25 * "Transfer of Assets, 3467.90 USD"* Assets:Investments:RothIRA:Vanguard:VTIVX 250.752 VTIVX {18.35 USD} @ 13.83000000000000 USD* Assets:Investments:RothIRA:DodgeCox:DODGX -30.892 DODGX {148.93 USD} @ 112.26000000000000 USDOne such transaction already has a 2-cent Expenses:RoundingError posting to make everything balance. I suppose I could add a couple cents to an Income:RoundingError account too, but I'd much rather that Beancount recognize that 0.001 DODGX is worth 0.14893 USD, so a rounding error of 0.03576 USD can be ignored.Matthew,Your bug report is _very_ timely!I've actually been working hard on revamping the mechanism to infer precision over the past weekend and implement the rounding/precision proposal and this example still fails to get handled properly with my new mechanism (though you can set a default of 0.05 USD for all transactions but I assume we don't want that).I like your suggestion of using the smallest digit of the converted cost in order to locally infer the precision for the cost currency... I hadn't thought of that at all, it's a good idea. The way I carried out inference in the new method, this transaction would not have an inferred value for USD's (precision on cost and price numbers are ignored) and would revert to the default tolerance (which you can override).I might be able to just add in inference using the method you propose, that is, infer USD precision from max(0.001 x 18.35, 0.001 x 148.93)/2.Let me see what I can do, I'll be working on this today.
On Sat, May 2, 2015 at 6:22 PM, Matthew Harris <mharr...@gmail.com> wrote:2. ESPP (Employee Stock Purchase Plan) purchases:
Each share is worth $26.71, but we can buy it for $24.04. It's been many years since I've had to deal with this, but it appears that the discount is taxed as regular income at the time of sale, and the cost basis ends up being the market price. I don't see how to record at purchase time what won't be income until a future sale.
Are you sure?What makes you think that about the taxation of the discount?
3. Unknown accounts represented as Equity:UnknownSourceOrSink:Invalid price vs. proceeds/gains: (15516.59644 USD) vs. ()2011-01-20 * "Shares Redeemed"* Assets:Investments:MutualFunds:ClipperFund:CFIMX -245.788 CFIMX {84.13 USD} @ 63.13000000000000 USDEquity:UnknownSourceOrSink 15516.60 USDIncome:Investments:MutualFunds:ClipperFund:PnL 5162.40 USDI have some transactions for which I'm missing the corresponding bank statements. I sometimes have a good idea of which account is involved, but I'm not sure. I've been using Equity:UnknownSourceOrSink to represent these so I don't distort my balance sheet. The sellgains plugin specifically looks for Assets accounts. What do you suggest here?Use an Assets account.
I suppose I can add Equity type to the list of "proceed" account types, I don't think it should hurt anyone.Would have solve the problem?Try it, here, add equity to this list:and let me know if it works; if so, I can probably add it in.
On Sunday, May 3, 2015 at 7:59:16 AM UTC-7, Martin Blais wrote:On Sat, May 2, 2015 at 6:22 PM, Matthew Harris <mharr...@gmail.com> wrote:2. ESPP (Employee Stock Purchase Plan) purchases:Each share is worth $26.71, but we can buy it for $24.04. It's been many years since I've had to deal with this, but it appears that the discount is taxed as regular income at the time of sale, and the cost basis ends up being the market price. I don't see how to record at purchase time what won't be income until a future sale.Are you sure?What makes you think that about the taxation of the discount?The first Google hit for [espp taxation] is this TurboTax help page, which says, "When the company buys the shares for you, you do not owe any taxes. … When you sell the stock, the discount that you received when you bought the stock is generally considered additional compensation to you, so you have to pay taxes on it as regular income." It's been many years since I had an ESPP, so I have no memory of how it was taxed.
But really I have no expectation of being able to use Beancount to get my exact W-2 numbers, especially for multiple jobs ago, where I have missing records, so maybe I should just record the discount as income in the ESPP purchase transaction and move on.
3. Unknown accounts represented as Equity:UnknownSourceOrSink:Invalid price vs. proceeds/gains: (15516.59644 USD) vs. ()2011-01-20 * "Shares Redeemed"* Assets:Investments:MutualFunds:ClipperFund:CFIMX -245.788 CFIMX {84.13 USD} @ 63.13000000000000 USDEquity:UnknownSourceOrSink 15516.60 USDIncome:Investments:MutualFunds:ClipperFund:PnL 5162.40 USDI have some transactions for which I'm missing the corresponding bank statements. I sometimes have a good idea of which account is involved, but I'm not sure. I've been using Equity:UnknownSourceOrSink to represent these so I don't distort my balance sheet. The sellgains plugin specifically looks for Assets accounts. What do you suggest here?Use an Assets account.Is that the right answer here? Then I'd have an Assets:Unknown account with random garbage in it, and Assets:* - Liabilities:* would no longer be representative of net worth.
I suppose I can add Equity type to the list of "proceed" account types, I don't think it should hurt anyone.Would have solve the problem?Try it, here, add equity to this list:and let me know if it works; if so, I can probably add it in.Adding it did work.
This gives me an opportunity to mention my most desired feature in Beancount: the {*} feature for automatically computing average cost. (And a less important but still useful feature: posting dates, so I can still use balance assertions in two accounts even when half of a transaction is delayed.)
I suppose I can add Equity type to the list of "proceed" account types, I don't think it should hurt anyone.Would have solve the problem?Try it, here, add equity to this list:and let me know if it works; if so, I can probably add it in.Adding it did work.Awesome.I'll add it then.
It will actually get deprecated with the new precision mechanism, for which Balance and Pad will infer the precision from the numbers.(Coming soon.)
On Sat, May 2, 2015 at 6:22 PM, Matthew Harris <mharr...@gmail.com> wrote:Thanks for adding this. As expected, this reveals a few kinds of errors I don't know how to resolve.1. Basic rounding errors:Invalid price vs. proceeds/gains: (0.03576 USD) vs. ()2011-01-25 * "Transfer of Assets, 3467.90 USD"* Assets:Investments:RothIRA:Vanguard:VTIVX 250.752 VTIVX {18.35 USD} @ 13.83000000000000 USD* Assets:Investments:RothIRA:DodgeCox:DODGX -30.892 DODGX {148.93 USD} @ 112.26000000000000 USDOne such transaction already has a 2-cent Expenses:RoundingError posting to make everything balance. I suppose I could add a couple cents to an Income:RoundingError account too, but I'd much rather that Beancount recognize that 0.001 DODGX is worth 0.14893 USD, so a rounding error of 0.03576 USD can be ignored.Matthew,Your bug report is _very_ timely!I've actually been working hard on revamping the mechanism to infer precision over the past weekend and implement the rounding/precision proposal and this example still fails to get handled properly with my new mechanism (though you can set a default of 0.05 USD for all transactions but I assume we don't want that).I like your suggestion of using the smallest digit of the converted cost in order to locally infer the precision for the cost currency... I hadn't thought of that at all, it's a good idea. The way I carried out inference in the new method, this transaction would not have an inferred value for USD's (precision on cost and price numbers are ignored) and would revert to the default tolerance (which you can override).
I might be able to just add in inference using the method you propose, that is, infer USD precision from max(0.001 x 18.35, 0.001 x 148.93)/2.Let me see what I can do, I'll be working on this today.