Hi,

I want to use balance resets (to automatically compute the correct amount at that particular point in time) with an account that is filled only by automatic transactions and run into trouble. While `ledger bal` shows that this account has a non-zero balance, adding a transaction that sets it to zero using a different account fails with: "Only one posting with null amount allowed per transaction".

Below I'll show an example.

First, the following works fine:

----
2015-02-01 Rent
Expenses:Rent    500 ABC
Liabilities:A

2015-03-01 Payback
Liabilities:A    = 0 ABC
Income:Fees from A
---

Checking the balance with `-e "mar 2015"` shows -500 ABC for "Liabilities:A"; without the --end parameter the "Liabilities:A" disappears and "Income:Fees from A" has -500 ABC.

Now I add the automatic transaction on top that distributes A's liabilitites evenly to A and B (first without the "Payback"):

----
= expr account =~ /Liabilities:A/
$account    -0.5
Liabilities:B    0.5

2015-02-01 Rent
Expenses:Rent    500 ABC
Liabilities:A
----

As expected, the balance is distributed correctly when checking the balance:

$ ledger -f good+automatic.ledger bal
           500 ABC Expenses:Rent
          -500 ABC Liabilities
          -250 ABC A
          -250 ABC B
--------------------
                 0

Now I want to add a transaction that balances B's -250 ABC liabilities:

----
2015-03-01 Payback
Liabilities:B    = 0 ABC
Income:Fees from B
----

However, adding this makes ledger return with an error:
"Error: Only one posting with null amount allowed per transaction"

It seems as if the "Liabilities:B" account is not filled yet when the transaction amount is computed. In fact, if I change this last transaction from B to A, then I get the same output as for the very first version, where the automatic transaction was not present.

I don't know if this is a bug in ledger or just a mistake in my understanding of evaluation order. I would be happy if anyone could shed some light on this issue.

Thanks
Tobias




--

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