Hi

I tried out your example


#+begin_src ledger   
= expr account =~ /Liabilities:[a-zA-z0-9]*$/ and aux_date >= [2020/05]
  $account    -1.0
  $account:from User1    (roundto(0.5*amount, 2))
  $account:from User2    (amount-roundto(0.5*amount, 2))
2021-12-03=2021-12-05 Amazon
  Expenses:Presents    2000 JPY
  Liabilities:User1
2021-12-05=2021-12-07 eBay
  Expenses:Presents    3000 JPY
  Liabilities:User2
#+end_src

#+RESULTS:
#+begin_example
            5000 JPY  Expenses:Presents
           -5000 JPY  Liabilities
           -2000 JPY    User1
           -1000 JPY      from User1
           -1000 JPY      from User2
           -3000 JPY    User2
           -1500 JPY      from User1
           -1500 JPY      from User2
--------------------
                   0
#+end_example


I rather don't know how to interpret the result, I hoped I would
automatically know who has to pay whom, what amount. But it seems that
further investigation is necessary, as you seem to indicate
by saying

,----
| and then you can look at the minimum of "User1:from User2" and
| "User2:from User1" and compute the reimbursement account.
`----

In my approach I had also to calculate the money to be transferred from
one user to the other.

Now what puzzles me is

#+begin_src ledger   
= expr account =~ /Liabilities:[a-zA-z0-9]*$/ and aux_date >= [2020/05]
   $account    -1.0
   $account:from User1    (roundto(0.5*amount, 0))
   $account:from User2    (amount-roundto(0.5*amount, 0))
2021-12-05=2021-12-07 User1
  expenses:Jacket  80
  Liabilities:User1
2021-12-05=2021-12-07 User1
  expenses:Pajama  30
  Liabilities:User1
2021-12-05=2021-12-07 User2
  expenses:Flowers  20
  Liabilities:User2
2021-12-05=2021-12-07 User2
  expenses:ChristmasTree  40.00
  Liabilities:User2
#+end_src



Here, ledger does not do anything. 




-- 

--- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/87bl0wiuvz.fsf%40mat.ucm.es.

Reply via email to