2010-04-14 05:09:45 +04:00
|
|
|
# 1. virtual posting shouldn't affect balance
|
2012-10-21 22:23:23 +04:00
|
|
|
hledgerdev -f- print
|
2009-06-27 15:02:28 +04:00
|
|
|
<<<
|
|
|
|
2009/1/1 x
|
|
|
|
(virtual) 100
|
|
|
|
a 1
|
|
|
|
b
|
2011-03-12 23:55:49 +03:00
|
|
|
>>>=0
|
2010-04-14 20:59:02 +04:00
|
|
|
#
|
2010-04-14 05:09:45 +04:00
|
|
|
# 2. balanced virtual postings should be required to balance (themselves)
|
2012-10-21 22:23:23 +04:00
|
|
|
hledgerdev -f- print
|
2010-04-14 05:09:45 +04:00
|
|
|
<<<
|
|
|
|
2010/1/1 x
|
2010-04-14 20:59:02 +04:00
|
|
|
[balanced virtual] 10
|
2010-04-14 05:09:45 +04:00
|
|
|
a 1
|
|
|
|
b
|
|
|
|
>>>= !0
|
2010-04-14 20:59:02 +04:00
|
|
|
#
|
|
|
|
# 3. balanced virtual postings should be required to balance (themselves)
|
2012-10-21 22:23:23 +04:00
|
|
|
hledgerdev -f- print
|
2010-04-14 05:09:45 +04:00
|
|
|
<<<
|
|
|
|
2010/1/1 x
|
2010-04-14 20:59:02 +04:00
|
|
|
[balanced virtual] 10
|
|
|
|
[balanced virtual] -10
|
2010-04-14 05:09:45 +04:00
|
|
|
a 1
|
|
|
|
b
|
2011-03-12 23:55:49 +03:00
|
|
|
>>>=0
|
2010-04-14 20:59:02 +04:00
|
|
|
#
|
|
|
|
# 4. a virtual posting with implicit amount should be handled correctly
|
2012-10-21 22:23:23 +04:00
|
|
|
hledgerdev -f- print
|
2010-04-14 05:09:45 +04:00
|
|
|
<<<
|
|
|
|
2010/1/1 x
|
2010-04-14 20:59:02 +04:00
|
|
|
[a] 10
|
|
|
|
[b]
|
2011-03-12 23:55:49 +03:00
|
|
|
>>>=0
|
2010-04-14 20:59:02 +04:00
|
|
|
#
|
|
|
|
# 5. real and balanced virtual postings are balanced separately, and multiple blank virtuals are ok
|
2012-10-21 22:23:23 +04:00
|
|
|
hledgerdev -f- balance
|
2010-04-14 20:59:02 +04:00
|
|
|
<<<
|
|
|
|
2010/1/1 x
|
|
|
|
a 1
|
|
|
|
b
|
|
|
|
[e] 10
|
|
|
|
[f]
|
|
|
|
(c)
|
|
|
|
(d)
|
|
|
|
>>>
|
|
|
|
1 a
|
|
|
|
-1 b
|
|
|
|
10 e
|
|
|
|
-10 f
|
2010-05-25 00:57:40 +04:00
|
|
|
--------------------
|
|
|
|
0
|
2011-03-12 23:55:49 +03:00
|
|
|
>>>=0
|