Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allocate and payments #1

Open
pfrancois opened this issue Mar 4, 2021 · 4 comments
Open

allocate and payments #1

pfrancois opened this issue Mar 4, 2021 · 4 comments

Comments

@pfrancois
Copy link

you doc is clear except in one point: what happen when one person pay to the other in order to clear the difference.

following this example:

option "booking_method" "FIFO"
option "operating_currency" "EUR"
option "inferred_tolerance_default" "EUR:0.01"
option "inferred_tolerance_default" "*:0.0001"
option "documents" "../history_import"
2000-01-02 custom "fava-option" "language" "en"

plugin "beancount_allocate.allocate" "{}"
2001-01-01 open Assets:Banque:SG-Visa                           EUR
2001-01-01 open Assets:Parents:SG-Parents                           EUR
2001-01-01 open Expenses:Loisirs:Fetes
2001-01-01 open Equity:Earnings:Current
2001-01-01 open Expenses:Ajustements

2020-05-28 * "Les caves allies" "" #allocate-food_for_m-66p
  Assets:Banque:SG-Visa   -200.00 EUR
  Expenses:Loisirs:Fetes

2020-05-28 * "Les caves allies" "" #allocate-food_for_f-33p
  Assets:Parents:SG-Parents   -100.00 EUR
  Expenses:Loisirs:Fetes

2020-05-29 * "remboursement" "parents a fils cote fils"
  Assets:Banque:SG-Visa   100.00 EUR
  Expenses:Ajustements
2020-05-29 * "remboursement" "parents a fils cote parents"
  Assets:Parents:SG-Parents   -100.00 EUR
  Expenses:Ajustements

i have two remarks:

  1. in order that teh plugin work you should write plugin "beancount_allocate.allocate" "{}" and not plugin "allocate" "{}"
  2. what should i write in order to clear the difference beetween parents and son ?
@Akuukis
Copy link
Owner

Akuukis commented Mar 6, 2021

Point one fixed, thanks.

I'm confused what exactly is going on. Can you please elaborate? Here's my best 2 guesses:

And before anything, here are some assumptions of the starting situation. That will help us to see what happens later.

2020-05-01 balance Assets:Banque:SG-Visa      1500 EUR
2020-05-01 balance Assets:Parents:SG-Parents  1500 EUR
2020-05-01 balance Equity:Earnings:Current    -2000 EUR
2020-05-01 balance Equity:Son                  -500 EUR
2020-05-01 balance Equity:Parents              -500 EUR

Scenario No. 1

First, 200 EUR was spent for the common trip from son's bank account, and 100 EUR was spent for the common trip from parent's bank account. Because this is the common ledger, instead of son's personal ledger or parent's personal ledger, common expenses is the default and so allocate tag is not needed.

2020-05-28 * "Les caves allies" ""
  Assets:Banque:SG-Visa   -200.00 EUR
  Assets:Parents:SG-Parents   -100.00 EUR
  Expenses:Loisirs:Fetes

2020-05-29 balance Assets:Banque:SG-Visa      1300 EUR
2020-05-29 balance Assets:Parents:SG-Parents  1400 EUR
2020-05-29 balance Equity:Earnings:Current    -1700 EUR ; down from 2000
2020-05-29 balance Equity:Son                  -500 EUR
2020-05-29 balance Equity:Parents              -500 EUR

Second, 100 EUR was moved from parents bank account to son's bank account. Why not, but I have no clue what's the reason.

2020-05-29 * "remboursement" ""
  Assets:Banque:SG-Visa    100.00 EUR
  Assets:Parents:SG-Parents   -100.00 EUR

2020-05-30 balance Assets:Banque:SG-Visa      1400 EUR
2020-05-30 balance Assets:Parents:SG-Parents  1300 EUR
2020-05-30 balance Equity:Earnings:Current    -1700 EUR
2020-05-30 balance Equity:Son                  -500 EUR
2020-05-30 balance Equity:Parents              -500 EUR

Scenario No. 2

First, 200 EUR was spent for son's personal hobbies from son's bank account, and 100 EUR was spent for the parent's personal hobbies from parent's bank account. Because this is the common ledger, instead of son's personal ledger or parent's personal ledger, common expenses is the default and so we need to use allocate tag.

2020-05-28 * "Les caves allies" "" #allocate-Son
  Assets:Banque:SG-Visa   -200.00 EUR
  Expenses:Loisirs:Fetes

2020-05-28 * "Les caves allies" "" #allocate-Parents
  Assets:Parents:SG-Parents   -100.00 EUR
  Expenses:Loisirs:Fetes

2020-05-29 balance Assets:Banque:SG-Visa      1300 EUR
2020-05-29 balance Assets:Parents:SG-Parents  1400 EUR
2020-05-29 balance Equity:Earnings:Current    -2000 EUR
2020-05-29 balance Equity:Son                  -300 EUR ; down from 500
2020-05-29 balance Equity:Parents              -400 EUR ; down from 500

Second, 100 EUR was moved from parents bank account to son's bank account. Why not, but I have no clue what's the reason.

2020-05-29 * "remboursement" ""
  Assets:Banque:SG-Visa    100.00 EUR
  Assets:Parents:SG-Parents   -100.00 EUR

2020-05-30 balance Assets:Banque:SG-Visa      1400 EUR
2020-05-30 balance Assets:Parents:SG-Parents  1300 EUR
2020-05-30 balance Equity:Earnings:Current    -2000 EUR
2020-05-30 balance Equity:Son                  -300 EUR
2020-05-30 balance Equity:Parents              -400 EUR

EDIT: Fixed equity balances to be negative

@pfrancois
Copy link
Author

pfrancois commented Mar 7, 2021

ok first i think that the balance at the beginning are wrong. the balance in equity could not began positive. it will mean that your net asset will be negative. quite complex for the beginning and it is the opposite of the assets accounts. equity accounts are like incomes accounts. (if it is positive, it's means that the accounting system are in debt.

currently we don't share anything. this will bring some problems. yes basically, i don't want to share anything except specific things but i want a common reporting on the expenses we shared.
to be clear, i have accounts and my parents have their accounts. we don't share anything usually. but currently, as i live with my parents, we need to shares some expenses. my parents wants to know how much each of us spend on food, and if it is increase too much, the party who spend the less will reimburse the other party.

so maybe i don't use the right plugin ... as we have two ledger (in the same file) , maybe we should use the share plugin.
but after thinking a second time, i don't think so because the problem is to know the full expenses of both. and allocate is better in this case. the two problem is after "sharing", we don't know how we paid for it without. and as the debt is not taken in the expense (obviously), if the debtor don't pay, the debt that should become a expense stay in the limbo ...

sorry for the misunderstanding...

so i found the solution that work:
no need of initialisation ...

  1. son spend 200 eur but 2/3 are owned by the parents:
2020-05-28 * "spent by son" "" #allocate-Parents-66.66p
  Assets:Visa-Son   -200.00 EUR
  Expenses:Restaurant
  1. parents spend 100 eur but 1/3 is owned by the parents:
2020-05-28 * "spent by parents" "" #allocate-Son-66.66p
  Assets:Visa-Parents   -100.00 EUR
  Expenses:Restaurant

after these two operations:
Son own 33.33 EUR of the parents expenses
Parents own 133.33 EUR of the Son expenses

  1. so they discuss and decide that parents will pay 100 eur to settle the case ( difference between the two holdings).
    in order to write it in beancount we need three operations.
2020-06-29 * "payment" #allocate-Parents-100p
  Assets:Visa-Son                              100 EUR
  Expenses:Ajustements 

2020-06-29 * "payment"
  Assets:Visa-Parents                              -100 EUR
  Expenses:Ajustements 

2020-06-29 * "clear" 
  Equity:Parents                                -33.33 EUR
  Equity:Son                             -33.33 EUR
  Equity:Earnings:Current

like this everything works well.

@Akuukis
Copy link
Owner

Akuukis commented Mar 9, 2021

Oops, you're right - edited Equity balances to be negative. Hey, but your "#allocate-Son-66.66p" and "Son own 33.33 EUR of the parents expenses" is a impossible combination, what did you mean there?

Thanks, now I finally understand your case! Hmm, that's interesting to not share anything but use the same beancount file. I see the benefit of transparency and reporting together. Yes, you need allocate plugin, not share plugin. Here's my suggestion how to do it best:

First, make sure that Equity:Earnings:Current always equal zero. If you share nothing, then there's no shared equity either. That means that every transaction must have either #allocate-Son or #allocate-Parents or combination of two that sums up.

Second, simplify clearing as described below.

2020-05-01 balance Assets:Banque:SG-Visa-Son       500 EUR
2020-05-01 balance Assets:Parents:SG-Visa-Parents  500 EUR
2020-05-01 balance Equity:Earnings:Current           0 EUR
2020-05-01 balance Equity:Son                     -500 EUR
2020-05-01 balance Equity:Parents                 -500 EUR

2020-05-25 * "spent by son" "" #allocate-Son-33.34p #allocate-Parents-66.66p
  Assets:Visa-Son   -200.00 EUR
  Expenses:Restaurant

2020-05-26 * "spent by parents" "" #allocate-Son-33.34p #allocate-Parents-66.66p
  Assets:Visa-Parents   -100.00 EUR
  Expenses:Restaurant

2020-05-27 balance Assets:Banque:SG-Visa-Son       300 EUR
2020-05-27 balance Assets:Parents:SG-Visa-Parents  400 EUR
2020-05-27 balance Equity:Earnings:Current           0 EUR
2020-05-27 balance Equity:Son                     -400 EUR
2020-05-27 balance Equity:Parents                 -300 EUR

; "Oh, Son's equity doesn't match his bank balance. We need to clear the difference":
2020-05-28 * "clear" ""
  Assets:Visa-Son        100.00 EUR
  Assets:Visa-Parents   -100.00 EUR

2020-05-29 balance Assets:Banque:SG-Visa-Son       400 EUR
2020-05-29 balance Assets:Parents:SG-Visa-Parents  300 EUR
2020-05-29 balance Equity:Earnings:Current           0 EUR
2020-05-29 balance Equity:Son                     -400 EUR
2020-05-29 balance Equity:Parents                 -300 EUR

P.S. To easily mass-tag all transactions, you can use pushtag & poptag. Here's a example:

; This is file "shared.bean"
pushtag #allocate-Son-33.34p
pushtag #allocate-Parents-66.66p

2020-05-25 * "spent by son" ""
  Assets:Visa-Son   -200.00 EUR
  Expenses:Restaurant

2020-05-26 * "spent by parents" ""
  Assets:Visa-Parents   -100.00 EUR
  Expenses:Restaurant

poptag #allocate-Son-33.34p
poptag #allocate-Parents-66.66p

@pfrancois
Copy link
Author

in fact, i don't like so much pushtag and pop tag. it is because only some expenses are shared and i import them automatically.
but to come back to core of the thing:
the only i need is to track the amount of "debt" of parents ans son . the rest of equity is not useful to track for me.

#allocate-Son-33.34p is the share of debt of son to the parents
#allocate-Parents-66.66p is the share of debt parents to the parents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants