On Tue, Apr 19, 2016 at 10:52 AM, Sébastien Gross <[email protected]> wrote:
> Hi there, > > This might be an ultra-classic use-case of ledger here I am facing. > > Let's plot the scene: > > > - They have their own bank account (Alice and Bob) and a Join account > It's "joint", not "join". > > - Alice and Bob rent a flat ($1500/mo), which for some reasons is paid > by Bob from his own account (not for the Join one). > > - Every month Alice wires half the rent ($750) to Bob's checking account > - Every month wire the rent to the owner > So it sounds like Bob & Alice aren't making use of that joint account. - Alice wires money from her account to Bob's. - Bob pays the rent from his checking account. Where does the joint account come into play? > > > For clean readability I always use the following scheme: > (Assets|Income|Expenses|Liabilities|Equity):(Alice|Bob|Join):Account > > > I assume the following opening balances: > > 2016/01/01 * Opening balance > Assets:Bob:Bank:Checking $12345 > Equity:Bob:Bank:Checking > > 2016/01/01 * Opening balance > Assets:Join:Bank:Checking $123 > Equity:Join:Bank:Checking > > > This can be written as follow: > > > 2016/01/01 Alice > Assets:Bob:Bank:Checking $750 > Income:Bob:Alice:Rent > > 2016/01/01 Owner > Assets:Bob:Bank:Checking > Expenses:Bob:Rent $1500 > > The balance is then: > > $ ./test.ledger bal > $11718 Assets > $11595 Bob:Bank:Checking > $123 Join:Bank:Checking > $-12468 Equity > $-12345 Bob:Bank:Checking > $-123 Join:Bank:Checking > $1500 Expenses:Bob:Rent > $-750 Income:Bob:Alice:Rent > -------------------- > 0 > > This is good and works fine but hides a few things: > > a) Who pays the rent > b) If Alice made a mistake in the wire there is no way to check it > c) An extra income is shown for Bob which should disappear after bob > paid the rent > > I thus add a few automatic rules such as: > > =/^Expenses:Bob:Rent$/ > $account -1 > Expenses:Join:Alice:Rent 0.5 > Expenses:Join:Bob:Rent 0.5 > ; > Income:Bob:Alice:Rent 0.5 > Income:Join:Alice:Rent -0.5 > > > The goal here is to split Bob's rent expense into 2 Expenses for the > Join accounting and transfers the Bob's income to the Join account. > > Now the result is better: > > $ ./test.ledger bal > $11718 Assets > $11595 Bob:Bank:Checking > $123 Join:Bank:Checking > $-12468 Equity > $-12345 Bob:Bank:Checking > $-123 Join:Bank:Checking > $1500 Expenses:Join > $750 Alice:Rent > $750 Bob:Rent > $-750 Income:Join:Alice:Rent > -------------------- > 0 > > We can see who paid what (From Expenses:Join): > > $ ./test.ledger bal '/^(expenses):join/' > $1500 Expenses:Join > $750 Alice:Rent > $750 Bob:Rent > -------------------- > $1500 > > and Bob does not have the extra income: > > $ ./test.ledger bal '/^(expenses|income):bob/' -E > 0 Expenses:Bob:Rent > 0 Income:Bob:Alice:Rent > -------------------- > 0 > > > But the Join seems to be false then: > > $ ./test.ledger bal '/^(expenses|income):join/' -E > $1500 Expenses:Join > $750 Alice:Rent > $750 Bob:Rent > $-750 Income:Join:Alice:Rent > -------------------- > $750 > > If I understand correctly this means that the Join has more expenses > than income which is logical since there is no Income:Join:Bob:Rent. > > Is it correct to add this line to the automatic rule? > (Income:Join:John:Rent) -0.5 > If I do so, The balance is not 0 unless I query with "-R" switch. > > Thus is there a way to display wanted information without using a > virtual transaction? Or from where should I take the amount to balance > "Income:Join:John:Rent"? > > > extra question: Is there a way to use regexp backrefs to write something > like: > > =/^Expenses:Bob:(Rent)$/ > $account -1 > Expenses:Join:Alice:$1 0.5 > Expenses:Join:Bob:$1 0.5 > Income:Bob:Alice:$1 0.5 > Income:Join:Alice:$1 -0.5 > (Income:Join:John:$1) -0.5 > > > Thanks in advance. > > This seems misguided to me. Bob should not track the full contents of the joint account on his balance sheet, nor should he be tracking Alice's. Bob's balance sheet should reflect Bobs' ownership, so only his portion of the joint account. If the balance sheet & ledger is for "the union of Bob and Alice" then that might work, but I'm reading that it's not what you're trying to do. Let's look at better ways of doing what you are trying to do. (1) The simplest solution involves Bob just keeping track of the money owed by Alice for rent and other expenses. At any time, Alice can make transfers to account for this running balance. I'd keep it as an uncategorized Liabilities account, e.g., "Liabilities:Alice". It can be applied to any type of shared expense. It's the money Alice owes Bob. Print out a journal to explain Alice its current balance. ;; -*- mode: beancount -*- ;; This is the simpler solution, one which involves a running account for your roommate. plugin "beancount.plugins.auto_accounts" ;; A running account for all of the shared expenses Alice needs to chip in for. 2000/01/01 open Liabilities:Alice 2016/01/01 * "Opening balance" Assets:Bank:Checking 12345 USD Equity:Opening-Balances ;; Shared expenses Alice's part to her running balance. 2016/01/01 * "Paying the rent" Assets:Bank:Checking -1500 USD Expenses:Rent 750 USD Liabilities:Alice 750 USD 2016/01/01 * "Paying electricity" Assets:Bank:Checking -45.34 USD Expenses:Electricity 45.34/2 USD Liabilities:Alice 45.34/2 USD 2016/01/01 * "Alice sends some money towards her running balance" Assets:Bank:Checking 1000 USD Liabilities:Alice (2) A solution which involves a joint account means two ledger files: one to track Bob's personal balance sheet, and one to track the joint account. Someone uses the joint account to pay for the rent and updates that file, and Bob replicates his side of the transactions in his personal file. ;; -*- mode: beancount -*- ;; This is a solution which makes use of the Joint account in order to pay ;; shares expenses, and here we represent Bob's side only. plugin "beancount.plugins.auto_accounts" ;; Personal account of Bob. 2000/01/01 open Assets:Bank:Personal ;; Bob's portion of the joint account. 2000/01/01 open Assets:Bank:Joint 2016/01/01 * "Opening balance" Assets:Bank:Checking 12345 USD Equity:OpeningBalances ;; You'll need to transfer money to that joint account. 2016/01/01 * "Transferring money to the joint account" Assets:Bank:Checking -2000 USD Assets:Bank:Joint ;; Then, expenses have to replicate Bob's portion of what happens to his stash ;; in the Joint account. 2016/01/01 * "Paying the rent" Assets:Bank:Joint Expenses:Rent 750 USD 2016/01/01 * "Paying electricity" Assets:Bank:Joint Expenses:Electricity 45.34/2 USD I'm not providing the detail in the joint file here, but it should be obvious. (3) You could also combine both of these methods if you'd like to pay the rent from Bob's account and get repayment by making a transfer between Bob and Alice in their joint account. -- --- You received this message because you are subscribed to the Google Groups "Ledger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
