On Thu, Dec 28, 2017 at 7:11 PM, Joel Shprentz <[email protected]> wrote:

> Thanks, Martin, for your quick response. I experimented with some
> alternative transaction entries.
>
> *Specify the per-share price.*
>
> 2017-12-27 * "Buy retirement fund shares"
>   Assets:Vanguard           4.039 VFIAX {247.59 USD}
>   Assets:Checking           -1000.00 USD
>
> Beancount rejects this, logging:
>
> /home/joel/projects/accounting/vanguard.bean:15:      Transaction does
> not balance: (0.01601 USD)
>
>    2017-12-27 * "Buy retirement fund shares"
>      Assets:Vanguard     4.039 VFIAX {247.59 USD, 2017-12-27}
>      Assets:Checking  -1000.00 USD
>
> Is this the error check you mentioned?
>
> The sellgains.py plugin description mentions rounding, but I am buying
> here. Which plugin should I use?
>

Sellgains.py is unrelated, it is used to add a new assertion on the price
(the @ part).




>
> *Specify the total cost.*
>
> 2017-12-27 * "Buy retirement fund shares"
>   Assets:Vanguard           4.039 VFIAX {# 1000.00 USD}
>   Assets:Checking           -1000.00 USD
>
>
>
> Beancount reports that the basis is 999.9999999999999999999999999 USD
> rather than 1000.00 USD.
>
> Hash:4baf7306f442bd171b65dd8a83e8390f
> Location: /home/joel/projects/accounting/vanguard.bean:15
>
> ------------ Balances before transaction
>
>   Assets:Vanguard
>
>   Assets:Checking                                        1000.00 USD
>
>
> ------------ Transaction
>
> 2017-12-27 * "Buy retirement fund shares"
>   Assets:Vanguard     4.039 VFIAX {247.59 USD, 2017-12-27}  ; 
> 999.9999999999999999999999999 USD
>   Assets:Checking  -1000.00 USD                             ;                 
>      -1000.00 USD
>
>
> Residual: (-0.0000000000000000000000001 USD)
> Tolerances: USD=0.005
> Basis: (999.9999999999999999999999999 USD)
>
> ------------ Balances after transaction
>
> * Assets:Vanguard  4.039 VFIAX {247.5860361475612775439465214 USD, 2017-12-27}
>
>   Assets:Checking
>
> Apparently each lot records a quantity and a cost per share. Beancount
> multiplies those two values to compute the basis when needed (as for the
> trial balance).
>
> If each lot recorded a quantity and the total cost, Beancount could divide
> to compute the cost per share when needed. I wonder if that approach would
> eliminate these tiny discrepancies in the trial balance.
>

Way way back this was considered but rejected for the following reasons:
- your broker does not keep track of costs this way, and the right way -
throughout the entire design - is to replicate what the institutions do, so
rounding should occur here at the cost basis leve
- splitting lots would introduce another source of rounding
- it would be more complicated to implemented


Sorry I can't get into this at depth right now I have other urgent
priorities (tummy time and changing diapers)


>
>
>
> On Thursday, December 28, 2017 at 12:36:34 PM UTC-5, Martin Blais wrote:
>>
>> Short answer: there's no "customary"
>> If you want a precise amount, put it i n
>> 4.039 VFIAX {247.59 USD}
>>
>> If you need to get rid of rounding error check in the plugins directory
>> there's a plugin for that
>>
>>
>>
>> On Thu, Dec 28, 2017 at 7:39 AM, Joel Shprentz <[email protected]> wrote:
>>
>>> Beancount cloned with hg at 2017-12-27 22:14 EST
>>> Python 3.5.3 running on Ubuntu 14.04
>>>
>>> In the following bean file, I purchase $1,000.00 of a Vanguard fund.
>>> Vanguard reports shares to three decimal places.
>>>
>>> option "operating_currency" "USD"
>>> option "booking_algorithm" "FULL"
>>>
>>> 2017-12-01 commodity USD
>>> 2017-12-01 commodity VFIAX
>>>
>>> 2017-12-01 open Assets:Checking
>>> 2017-12-01 open Equity:Opening-Balances
>>> 2017-12-01 open Assets:Vanguard     VFIAX "FIFO"
>>>
>>> 2017-12-01 * "Opening balance"
>>>   Assets:Checking           1000.00 USD
>>>   Equity:Opening-Balances
>>>
>>> 2017-12-27 * "Buy retirement fund shares"
>>>   Assets:Vanguard           4.039 VFIAX {}
>>>   Assets:Checking           -1000.00 USD
>>>
>>> Using bean-web, in the trail balance report for all transactions, the
>>> USD column totals -0.00 and the total balance is
>>> -0.0000000000000000000000001 USD. Other reports appear correct.
>>>
>>> The share purchase transaction details show a basis of
>>> 999.9999999999999999999999999 USD instead of 1000.00 USD. *How can I
>>> configure Beancount to round the basis to the customary two decimal places
>>> for USD?*
>>>
>>> Hash:4baf7306f442bd171b65dd8a83e8390f
>>> Location: /home/joel/projects/accounting/vanguard.bean:15
>>>
>>> ------------ Balances before transaction
>>>
>>>   Assets:Vanguard
>>>
>>>   Assets:Checking                                        1000.00 USD
>>>
>>>
>>> ------------ Transaction
>>>
>>> 2017-12-27 * "Buy retirement fund shares"
>>>   Assets:Vanguard     4.039 VFIAX {247.59 USD, 2017-12-27}  ; 
>>> 999.9999999999999999999999999 USD
>>>   Assets:Checking  -1000.00 USD                             ;               
>>>        -1000.00 USD
>>>
>>>
>>> Residual: (-0.0000000000000000000000001 USD)
>>> Tolerances: USD=0.005
>>> Basis: (999.9999999999999999999999999 USD)
>>>
>>> ------------ Balances after transaction
>>>
>>> * Assets:Vanguard  4.039 VFIAX {247.5860361475612775439465214 USD, 
>>> 2017-12-27}
>>>
>>>   Assets:Checking
>>>
>>> --
>>> 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 [email protected].
>>> To post to this group, send email to [email protected].
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/beancount/9b46d869-2e31-4466-951a-7b910f34f977%40googlegroups.com
>>> <https://groups.google.com/d/msgid/beancount/9b46d869-2e31-4466-951a-7b910f34f977%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/beancount/5491604b-3a67-4938-ab0d-5eef477f85c2%40googlegroups.com
> <https://groups.google.com/d/msgid/beancount/5491604b-3a67-4938-ab0d-5eef477f85c2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhNLROrq3puWPHAB83L%2BcDTXwiOvD4SudS-z3FXRAmCnJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to