>>> "UB" == Uwe Brauer <o...@mat.ucm.es> writes:
Tobias, 

Out of curiosity (I am not so acquainted with ledger)

You made the following comment 

,----
| However, you understandably would like to avoid the manual computations
| needed with this process. The key to that is to
|  1. use only a single account for liabilities between user, and use
|     the sign of this account's amount to determine who needs to pay
|     whom, and
|  2. do the counterbalancing implicitly in each transaction.
| 
| However, I feel that in particular (1) is somewhat contrary to the idea
| of double-entry accounting, and by using only a single account for
| directional liabilities you get quite a bit of asymmetry into the
| automated transactions.
`----


So I understand that using the solution below, in particular:


   $account    -1.0

Means that I only use one account which is a bit contrary to the idea of
double-entry accounting?

But the second solution you propose looks complicated to me. 

I wounder that this common situation is so hm difficult to achieve 

Thanks again

#+begin_src ledger   
= expr account =~ /Liabilities:User1$/
   $account    -1.0
   Income:User1    1.0
   Liabilities:User1-from-User2    (-(amount-roundto(0.5*amount, 0)))
   Income:User2    (amount-roundto(0.5*amount, 0))
= expr account =~ /Liabilities:User2$/
   $account    -1.0
   Income:User2    (amount-roundto(0.5*amount, 0))
   Liabilities:User1-from-User2    (roundto(0.5*amount, 0))
2021-12-05=2021-12-07 User1
  expenses:User1:Jacket  80 EUR
  Liabilities:User1
2021-12-05=2021-12-07 User1
  expenses:User1:Pajama  30 EUR
  Liabilities:User1
2021-12-05=2021-12-07 User2
  expenses:User2:Flowers  20 EUR
  Liabilities:User2
2021-12-05=2021-12-07 User2
  expenses:User2:ChristmasTree  40.00 EUR
  Liabilities:User2
#+end_src


> #+RESULTS:

> #+begin_example
>          -195.00 EUR  Income
>          -110.00 EUR    User1
>           -85.00 EUR    User2
>            25.00 EUR  Liabilities:User1-from-User2
>           170.00 EUR  expenses
>           110.00 EUR    User1
>            80.00 EUR      Jacket
>            30.00 EUR      Pajama
>            60.00 EUR    User2
>            40.00 EUR      ChristmasTree
>            20.00 EUR      Flowers
> --------------------
>                    0
> #+end_example

> The advantage is that I can control who spent money on what

> In any case this is very nice thanks

> Uwe  

-- 

--- 
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 ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/874k6jerp7.fsf_-_%40mat.ucm.es.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to