Skip to content

Instantly share code, notes, and snippets.

@1ma
Created September 18, 2024 19:50
Show Gist options
  • Save 1ma/41a405d55eb7a58eca263ec49496f841 to your computer and use it in GitHub Desktop.
Save 1ma/41a405d55eb7a58eca263ec49496f841 to your computer and use it in GitHub Desktop.
Exemple de traspàs a Beancount
option "title" "Experiments traspassant fons d'inversió"
option "operating_currency" "EUR"
option "booking_method" "FIFO"
plugin "beancount.plugins.implicit_prices"
2020-01-01 open Assets:Efectiu EUR
2020-01-01 open Assets:BrokerX:FonsABC ABC.FI
2022-01-01 open Assets:BrokerY:FonsDEF DEF.FI
; Al primer any comprem 100 participacions del fons ABC que valen 10€
2020-01-01 * "Compra de 100 participacions del fons ABC"
Assets:BrokerX:FonsABC 100 ABC.FI {10.00 EUR} @ 10.00 EUR
Assets:Efectiu
2020-02-02 balance Assets:BrokerX:FonsABC 100 ABC.FI
; L'any següent la participació val 15€ i en comprem 50 més
2021-01-01 * "Compra de 50 participacions del fons ABC"
Assets:BrokerX:FonsABC 50 ABC.FI {15.00 EUR} @ 15.00 EUR
Assets:Efectiu
2021-01-02 balance Assets:BrokerX:FonsABC 150 ABC.FI
; Passa 1 any més i el FonsABC val 20€ per participació
; Volem traspassar 125 participacions al fons DEF que val 50€
2022-01-01 * "Traspàs de 125 participacions ABC a DEF"
Assets:BrokerY:FonsDEF 40 DEF.FI {25.00 EUR, 2020-01-01} @ 50.00 EUR
Assets:BrokerY:FonsDEF 10 DEF.FI {37.50 EUR, 2021-01-01} @ 50.00 EUR
Assets:BrokerX:FonsABC -100 ABC.FI {10.00 EUR} @ 20.00 EUR
Assets:BrokerX:FonsABC -25 ABC.FI {15.00 EUR} @ 20.00 EUR
2022-01-02 balance Assets:BrokerX:FonsABC 25 ABC.FI
2022-01-02 balance Assets:BrokerY:FonsDEF 50 DEF.FI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment