Hi Sébastien,

Here are two ways to do it. I don’t see how the joint account fits in this
scenario, so I’ve ignored it.

First, the simple way:

2016/01/01 Transfer
  Assets:Bank:Checking                                       $750
  Expenses:Rent                                             -$750

2016/01/01 Rent payment
  Assets:Bank:Checking                                     -$1500
  Expenses:Rent                                             $1500

This is from Bob’s point of view - his expenses are $750 in rent, and he doesn’t
care what Alice’s expense are or what her bank account looks like.

A more complicated way:

2016/01/01 Transfer
  Assets:Bank:Checking                                       $750
  Liabilities:Rent                                          -$750

2016/01/01 Rent payment
  Assets:Bank:Checking                                     -$1500
  Liabilities:Rent                                           $750
  Expenses:Rent                                              $750

This is also from Bob’s p.o.v. He doesn’t care about Alice’s expenses, but he
does care that Alice has lent him $750 for rent and he wants to make sure that
he has paid his debt (though his debt was paid to the landlord). So before the
2nd transaction is used, he will have a negative balance in Liabilities:Rent.

More complicated still:

2016/01/01 Transfer
  Assets:Bank:Bob:Checking                                   $750
  Assets:Bank:Alice:Checking                                -$750
  Expenses:Alice:Rent                                        $750
  Liabilities:Bob:Rent                                      -$750

2016/01/01 Rent payment
  Assets:Bob:Bank:Checking                                 -$1500
  Liabilities:Bob:Rent                                       $750
  Expenses:Bob:Rent                                          $750

In this case, we are tracking Alice & Bob’s expenses and accounts. In the first
transaction, the transfer happens between accounts, Alice has paid her rent, and
Alice has loaned $750 to Bob for her share of the rent. In the second, Bob pays
off the debt to Alice and pays the rent.

That is how I would handle it. I am no accountant, but I have used ledger for
situations like this. :)

If you want to bring automated transactions into this, give it a shot, but they
are not as expressive as regular ledger.

best, Erik

On Tue, 19 Apr 2016 07:52:08 -0700,
Sébastien Gross <[email protected]> wrote:
>
> [1.1  <text/plain; UTF-8 (7bit)>]
> 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
>
> - 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
>
>
> 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.
>
> Seb.
>
> --
>
> ---
> 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.
> [1.2  <text/html; UTF-8 (quoted-printable)>]

-- 

--- 
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.

Reply via email to