From aa4571b09cc9771697fa67e27203957585897533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roger=20Oriol=20P=C3=A9rez?= Date: Sun, 10 Dec 2023 11:42:13 +0100 Subject: [PATCH] created foundation for ledger --- .gitignore | 1 + commands/balance-sheet | 2 + commands/cash-flow-statement | 2 + commands/check | 2 + commands/income-statement | 2 + commands/serve | 2 + ledger/accounts.beancount | 65 ++++++++ ledger/budget.beancount | 24 +++ ledger/commodities.beancount | 19 +++ ledger/main.beancount | 16 ++ .../__pycache__/amortize_over.cpython-311.pyc | Bin 0 -> 5072 bytes ledger/plugins/amortize_over.py | 143 ++++++++++++++++++ ledger/trading/2024_01.beancount | 6 + ledger/transactions/2024_01.beancount | 15 ++ requirements.txt | 50 ++++++ 15 files changed, 349 insertions(+) create mode 100644 .gitignore create mode 100755 commands/balance-sheet create mode 100755 commands/cash-flow-statement create mode 100755 commands/check create mode 100755 commands/income-statement create mode 100755 commands/serve create mode 100644 ledger/accounts.beancount create mode 100644 ledger/budget.beancount create mode 100644 ledger/commodities.beancount create mode 100644 ledger/main.beancount create mode 100644 ledger/plugins/__pycache__/amortize_over.cpython-311.pyc create mode 100644 ledger/plugins/amortize_over.py create mode 100644 ledger/trading/2024_01.beancount create mode 100644 ledger/transactions/2024_01.beancount create mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eba74f4 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv/ \ No newline at end of file diff --git a/commands/balance-sheet b/commands/balance-sheet new file mode 100755 index 0000000..7410ab3 --- /dev/null +++ b/commands/balance-sheet @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +echo "TO DO" \ No newline at end of file diff --git a/commands/cash-flow-statement b/commands/cash-flow-statement new file mode 100755 index 0000000..7410ab3 --- /dev/null +++ b/commands/cash-flow-statement @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +echo "TO DO" \ No newline at end of file diff --git a/commands/check b/commands/check new file mode 100755 index 0000000..c33c315 --- /dev/null +++ b/commands/check @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +bean-check ledger/main.beancount \ No newline at end of file diff --git a/commands/income-statement b/commands/income-statement new file mode 100755 index 0000000..7410ab3 --- /dev/null +++ b/commands/income-statement @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +echo "TO DO" \ No newline at end of file diff --git a/commands/serve b/commands/serve new file mode 100755 index 0000000..948e915 --- /dev/null +++ b/commands/serve @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +fava ledger/main.beancount -p 8080 \ No newline at end of file diff --git a/ledger/accounts.beancount b/ledger/accounts.beancount new file mode 100644 index 0000000..e9c6d90 --- /dev/null +++ b/ledger/accounts.beancount @@ -0,0 +1,65 @@ +1970-01-01 open Assets:Liquid:Caixabank:Corrent EUR +1970-01-01 open Assets:Liquid:Caixabank:Estalvi EUR +1970-01-01 open Assets:Liquid:R4:EUR EUR +1970-01-01 open Assets:Invest:R4:Vanguard:EMMK VANEMMK +1970-01-01 open Assets:Invest:R4:Amundi:MSCIWRLD AMNDMSCIWRLD +1970-01-01 open Assets:Invest:R4:BNP:DISTECH BNPDISTECH +1970-01-01 open Assets:Invest:R4:Fidelity:GLTECH FIGLTECH +1970-01-01 open Assets:Invest:R4:Amundi:SUSTINC AMNDSUSINC +1970-01-01 open Assets:Invest:R4:PLTR PLTR +1970-01-01 open Assets:Invest:R4:MSFT MSFT +1970-01-01 open Assets:Benefits:Edenred:TicketsRestaurant EUR +1970-01-01 open Assets:Benefits:Edenred:TarjetaTransport EUR +1970-01-01 open Assets:PersonalProperty:VivendaPrincipal EUR +1970-01-01 open Assets:PersonalProperty:Cotxe EUR +1970-01-01 open Assets:PersonalProperty:JoiesArtCollecionables EUR +1970-01-01 open Assets:PersonalProperty:MetallsPreciosos EUR +1970-01-01 open Assets:PersonalProperty:AltresPropietats EUR +1970-01-01 open Assets:Debt:DeutesPerCobrar EUR + +1970-01-01 open Liabilities:Credit:Caixabank:TargetaCredit EUR +1970-01-01 open Liabilities:Factures:FacturesPendents EUR +1970-01-01 open Liabilities:Taxes:IRPF EUR +;1970-01-01 open Liabilities:Hipoteca:VivendaPrincipal EUR + +1970-01-01 open Income:Work:Zurich:Salari EUR +1970-01-01 open Income:Work:Zurich:TicketsRestaurant EUR +1970-01-01 open Income:Work:Zurich:TarjetaTransport EUR +1970-01-01 open Income:Work:Zurich:SeguroMedic EUR +1970-01-01 open Income:Work:Zurich:Gimnas EUR +1970-01-01 open Income:Other:Caixabank:Transferencia EUR +1970-01-01 open Income:Other:Caixabank:Bizum EUR +1970-01-01 open Income:Savings:Caixabank:RentabilitatEstalvis EUR +1970-01-01 open Income:Invest:R4:Dividends EUR +1970-01-01 open Income:Invest:R4:CapitalGains EUR + +1970-01-01 open Expenses:R4:Comissions EUR +1970-01-01 open Expenses:Taxes:IRPF EUR +1970-01-01 open Expenses:Taxes:BeneficisDividends EUR +1970-01-01 open Expenses:Taxes:BeneficisDividendsOrigen EUR +1970-01-01 open Expenses:Taxes:ImpostCirculacio EUR +1970-01-01 open Expenses:Insurance:Cotxe EUR +1970-01-01 open Expenses:Lloguer EUR +1970-01-01 open Expenses:FacturesUtilitats EUR +1970-01-01 open Expenses:Internet EUR +1970-01-01 open Expenses:Gasolina EUR +1970-01-01 open Expenses:MantenimentCotxe EUR +1970-01-01 open Expenses:Roba EUR +1970-01-01 open Expenses:Educació EUR +1970-01-01 open Expenses:Medic EUR +1970-01-01 open Expenses:Vacances EUR +1970-01-01 open Expenses:NintendoOnline EUR +1970-01-01 open Expenses:Perruqueria EUR +1970-01-01 open Expenses:AmazonPrime EUR +1970-01-01 open Expenses:CarnetJove EUR +1970-01-01 open Expenses:Supermercat EUR +1970-01-01 open Expenses:Gimnàs EUR +1970-01-01 open Expenses:Parking EUR +1970-01-01 open Expenses:Mobilitat EUR +1970-01-01 open Expenses:MarcaPersonal EUR +1970-01-01 open Expenses:MenjarFora EUR +1970-01-01 open Expenses:Entreteniment EUR +1970-01-01 open Expenses:Altres EUR + +1970-01-01 open Equity:Opening-Balances EUR +1970-01-01 open Equity:Opening-Balances:USD USD \ No newline at end of file diff --git a/ledger/budget.beancount b/ledger/budget.beancount new file mode 100644 index 0000000..2df760a --- /dev/null +++ b/ledger/budget.beancount @@ -0,0 +1,24 @@ +2024-01-01 custom "budget" Expenses:Lloguer "monthly" 600.00 EUR +2024-01-01 custom "budget" Expenses:FacturesUtilitats "monthly" 80.00 EUR +2024-01-01 custom "budget" Expenses:Internet "monthly" 50.00 EUR +2024-01-01 custom "budget" Expenses:Gasolina "monthly" 50.00 EUR +2024-01-01 custom "budget" Expenses:Roba "monthly" 80.00 EUR +2024-01-01 custom "budget" Expenses:Perruqueria "monthly" 16.00 EUR +2024-01-01 custom "budget" Expenses:Supermercat "monthly" 180.00 EUR +2024-01-01 custom "budget" Expenses:Parking "monthly" 122.09 EUR +2024-01-01 custom "budget" Expenses:Mobilitat "monthly" 125.00 EUR +2024-01-01 custom "budget" Expenses:Entreteniment "monthly" 60.00 EUR +2024-01-01 custom "budget" Expenses:MenjarFora "monthly" 250.00 EUR +2024-01-01 custom "budget" Expenses:Altres "monthly" 150.00 EUR + +2024-01-01 custom "budget" Expenses:MantenimentCotxe "yearly" 180.00 EUR +2024-01-01 custom "budget" Expenses:Educació "yearly" 200.00 EUR +2024-01-01 custom "budget" Expenses:Medic "yearly" 400.00 EUR +2024-01-01 custom "budget" Expenses:Vacances "yearly" 2000.00 EUR +2024-01-01 custom "budget" Expenses:Taxes:ImpostCirculacio "yearly" 55.00 EUR +2024-01-01 custom "budget" Expenses:NintendoOnline "yearly" 35.00 EUR +2024-01-01 custom "budget" Expenses:AmazonPrime "yearly" 50.00 EUR +2024-01-01 custom "budget" Expenses:Insurance:Cotxe "yearly" 520.00 EUR +2024-01-01 custom "budget" Expenses:CarnetJove "yearly" 10.00 EUR +2024-01-01 custom "budget" Expenses:Gimnàs "yearly" 800.00 EUR +2024-01-01 custom "budget" Expenses:MarcaPersonal "yearly" 150.00 EUR diff --git a/ledger/commodities.beancount b/ledger/commodities.beancount new file mode 100644 index 0000000..1036d59 --- /dev/null +++ b/ledger/commodities.beancount @@ -0,0 +1,19 @@ +1970-01-01 commodity EUR + name: "Euro" +1970-01-01 commodity USD + name: "US Dollar" +1970-01-01 commodity VANEMMK + name: "VANGUARD EM MK ST IX INV (EUR)" +1970-01-01 commodity AMNDMSCIWRLD + name: "Amundi Index MSCI World AE (EUR) INC" +2024-01-01 commodity AMNDSUSINC + name: "AMUNDI FUNDS GLOBAL E A2 (EUR) D C / Amundi Fds Glb EQ Sust Inc A2 EUR Qti D" +1970-01-01 commodity BNPDISTECH + name: "BNP Disrupting Technology C (USD) ACC" +1970-01-01 commodity FIGLTECH + name: "FIDELITY GLOBAL TECHNOLOGY A (EUR)" +1970-01-01 commodity PLTR + name: "Palantir Technologies Inc" +1970-01-01 commodity MSFT + name: "MSFT" + price: "USD:google/NASDAQ:MSFT" \ No newline at end of file diff --git a/ledger/main.beancount b/ledger/main.beancount new file mode 100644 index 0000000..869df2e --- /dev/null +++ b/ledger/main.beancount @@ -0,0 +1,16 @@ +* Plugins +option "insert_pythonpath" "True" +plugin "plugins.amortize_over" +plugin "beancount.plugins.implicit_prices" + +* Options +option "title" "Roger Oriol Ledger" +option "operating_currency" "EUR" +option "inferred_tolerance_default" "*:0.001" + +* Imports +include "accounts.beancount" +include "commodities.beancount" +include "budget.beancount" +include "trading/*" +include "transactions/*" \ No newline at end of file diff --git a/ledger/plugins/__pycache__/amortize_over.cpython-311.pyc b/ledger/plugins/__pycache__/amortize_over.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..79aff2462d307e619ed05f29753e1ddeeac519cc GIT binary patch literal 5072 zcmdT|O>7j&6|SEDpB|459>W-7x5qJN44&~CFe?L#oPb$yaCU*+B@U}ed%Cd4p6Q-c z_W-tfHdd5_wX(EUgoLAjEXr|H97pSp ztRv@~a&m&O+^p`(dUD<=FRQz=zMOx`4|UH}z=1F)c_rUN2SShGt(K{v&`$`?iy3L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