Best way to handle stock exchanges

2016-12-15 Thread Alex Johnstone
Hello,

I have purchased an index fund and for some reason that fund has close and 
converted to a different one. What's the best way to handle this conversion?

Currently I have the following:


2014-10-30 * "Fund Purchase"
Assets:Invest:FIAAGY 972.9149 FIAAGY {1.02 GBP}
Assets:Invest:VVUILG 14.1509 VVUILG {140.98 GBP}
Assets:Invest:VVUKEQ 13.0067 VVUKEQ {191.06 GBP}
Assets:Invest:VVDVWE 22.1538 VVDVWE {202.90 GBP}
Expenses:Invest:Fees   29.94 GBP
Assets:Bank

2014-11-01 * "Fund Swap"
Assets:Invest:VVUKEQ -13.0067 VVUKEQ {191.06 GBP}
Assets:Invest:VVFUSI 16.6505 VVFUSI {149.25 GBP}


However, this fails due to the fund swap transaction not balancing. I 
calculated the 149.25 myself to try and make it match. If I leave off the 
lot price it doesn't work as it says the transaction doesn't balance.

Other than adding more decimal places to my calculated lot value is there 
are smarter way to do this?

Thanks,
Alex

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/75c6d402-6e04-4249-9a54-cbdbff2283fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Best way to handle stock exchanges

2016-12-15 Thread Martin Blais
On Thu, Dec 15, 2016 at 1:30 PM, Alex Johnstone  wrote:

> Hello,
>
> I have purchased an index fund and for some reason that fund has close and
> converted to a different one. What's the best way to handle this conversion?
>
> Currently I have the following:
>
>
> 2014-10-30 * "Fund Purchase"
> Assets:Invest:FIAAGY 972.9149 FIAAGY {1.02 GBP}
> Assets:Invest:VVUILG 14.1509 VVUILG {140.98 GBP}
> Assets:Invest:VVUKEQ 13.0067 VVUKEQ {191.06 GBP}
> Assets:Invest:VVDVWE 22.1538 VVDVWE {202.90 GBP}
> Expenses:Invest:Fees   29.94 GBP
> Assets:Bank
>
> 2014-11-01 * "Fund Swap"
> Assets:Invest:VVUKEQ -13.0067 VVUKEQ {191.06 GBP}
> Assets:Invest:VVFUSI 16.6505 VVFUSI {149.25 GBP}
>
>
> However, this fails due to the fund swap transaction not balancing. I
> calculated the 149.25 myself to try and make it match. If I leave off the
> lot price it doesn't work as it says the transaction doesn't balance.
>
> Other than adding more decimal places to my calculated lot value is there
> are smarter way to do this?
>

Your residual is 2.7c, which is why Beancount finds it unacceptably large:



bean-doctor context best-way-to-handle-stock-exchanges.beancount 14
Hash:e7762575b71b638616255705e251b851
Location:
/home/blais/r/q/beancount-data/user/alexjohnstone/best-way-to-handle-stock-exchanges.beancount:12

 Balances before transaction

  Assets:Invest:VVUKEQ13.0067 VVUKEQ {191.06 GBP, 2014-10-30}

  Assets:Invest:VVFUSI


 Transaction

2014-11-01 * "Fund Swap"
  Assets:Invest:VVUKEQ  -13.0067 VVUKEQ {191.06 GBP, 2014-10-30}  ;
-2485.060102 GBP
  Assets:Invest:VVFUSI   16.6505 VVFUSI {149.25 GBP, 2014-11-01}  ;
 2485.087125 GBP


Residual: (0.027023 GBP)
Tolerances: VVFUSI=0.5, VVUKEQ=0.5
Basis: (0.027023 GBP)

 Balances after transaction

  Assets:Invest:VVUKEQ

* Assets:Invest:VVFUSI16.6505 VVFUSI {149.25 GBP, 2014-11-01}



You can account for the rounding error explicitly:

2014-11-01 * "Fund Swap"
Assets:Invest:VVUKEQ-13.0067 VVUKEQ {191.06 GBP}
Assets:Invest:VVFUSI 16.6505 VVFUSI {149.25 GBP}
Equity:Rounding -0.027 GBP

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhO_wrVFCofuz1kJZHCuEwzLhXH_ZpjN2Gne9PAPQBrHtg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Allocating payments to customer accounts - newbie question

2016-12-15 Thread Martin Blais
> I want to use beancount to maintain customers and vendors, and so want to
be able to allocate payments to invoices (and, by extension, use it to
reconcile bank accounts).
> I'm not sure if this has been solved - I couldn't find anything relating
to it on Google.
> In essence, this would mean that each transaction has a record showing
how much of the transaction has been posted and to where.
> For example, a payment of £20 against an invoice of £30 would have a
record on both the invoice transaction and payment transaction showing £20.
The payment is then fully allocated but the invoice is only partly
allocated. This would allow reports to show that £10 was left.
> Perhaps this could be done with tags? Has this been solved previously?

Easy.


; -*- mode: beancount -*-





plugin "beancount.plugins.auto_accounts"

2016-09-01 * "Invoicing client A" ^invoice-0001
  Assets:AccountsReceivable:ClientA 30.00 GBP
  Income:Work:Services

2016-09-20 * "Invoicing client B" ^invoice-0002
  Assets:AccountsReceivable:ClientB 40.00 GBP
  Income:Work:Services

2016-10-01 * "Invoicing client A" ^invoice-0003
  Assets:AccountsReceivable:ClientA 12.00 GBP
  Income:Work:Services

2016-09-20 * "Client A" "Payment for invoice" ^invoice-0001
  Assets:AccountsReceivable:ClientA-20.00 GBP
  Assets:Checking



You can view how much your liability from this client is, over all invoices:

bean-query stalbansrfctreasurer.beancount "select sum(position) where
account = 'Assets:AccountsReceivable:ClientA'"

sum_posit
-
22.00 GBP



Or you can produce this for each of your clients in one go:

bean-query stalbansrfctreasurer.beancount "select leaf(account) as client,
sum(position) as balance where account ~ 'Assets:AccountsReceivable' group
by 1"

client   balance
--- -
ClientB 40.00 GBP
ClientA 22.00 GBP



Finally, if you'd like to isolate that particular invoice, use links or
tags to segregate all the transactions for a particular invoice:

bean-query stalbansrfctreasurer.beancount "select date, description,
position, balance where account ~ 'Assets:AccountsReceivable:ClientA' and
('invoice-0001' in links) "

   date descriptionposition   balance
-- -- -- -
2016-09-01 Invoicing client A  30.00 GBP 30.00 GBP
2016-09-20 Client A | Payment for invoice -20.00 GBP 10.00 GBP



If you invoice payments are always for the total amount owed, you may be
able to write a plugin which automatically pairs them up with tags.
See this plugin for some ideas:
https://bitbucket.org/blais/beancount/src/ac55a614f17e75573832337a30c5e11be9c1d5c1/src/python/beancount/plugins/tag_pending.py?at=upload_using_v4_sheets_api&fileviewer=file-view-default



On Tue, Dec 13, 2016 at 7:42 AM,  wrote:

> Hi
> I want to use beancount to maintain customers and vendors, and so want to
> be able to allocate payments to invoices (and, by extension, use it to
> reconcile bank accounts).
> I'm not sure if this has been solved - I couldn't find anything relating
> to it on Google.
> In essence, this would mean that each transaction has a record showing how
> much of the transaction has been posted and to where.
> For example, a payment of £20 against an invoice of £30 would have a
> record on both the invoice transaction and payment transaction showing £20.
> The payment is then fully allocated but the invoice is only partly
> allocated. This would allow reports to show that £10 was left.
> Perhaps this could be done with tags? Has this been solved previously?
> Thanks
> Paul
>
> --
> 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+unsubscr...@googlegroups.com.
> To post to this group, send email to beancount@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/beancount/27d3787d-1814-4389-b931-0123e211e5c1%40googlegroups.com
> 
> .
> 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 beancount+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhO4Nf3g14HGfDObNUA1KGZZrDTDsDyWTUTDTExGfFWUEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Best way to handle stock exchanges

2016-12-15 Thread Stefano Zacchiroli
On Thu, Dec 15, 2016 at 09:41:28PM -0500, Martin Blais wrote:
> You can account for the rounding error explicitly:
> 
> 2014-11-01 * "Fund Swap"
> Assets:Invest:VVUKEQ-13.0067 VVUKEQ {191.06 GBP}
> Assets:Invest:VVFUSI 16.6505 VVFUSI {149.25 GBP}
> Equity:Rounding -0.027 GBP

this is more a general accounting question than a beancount-specific
one, but is it more common to use Equity:* for rounding errors than
appropriate Income/Expenses subcategories? What bothers me about using
Equity is that then you won't see the "impact" of the rounding error
when you just look at income/expenses over a given period of time (which
I often do). But maybe I'm missing something about why Equity is better
in these cases...

Cheers
-- 
Stefano Zacchiroli . z...@upsilon.cc . upsilon.cc/zack . . o . . . o . o
Computer Science Professor . CTO Software Heritage . . . . . o . . . o o
Former Debian Project Leader . OSI Board Director  . . . o o o . . . o .
« the first rule of tautology club is the first rule of tautology club »

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/20161216072119.5r2gweu6zwnqy7vf%40upsilon.cc.
For more options, visit https://groups.google.com/d/optout.