hledger/tests/misc/query-status.test
Mykola Orliuk 015b764d00 Preserve implicit amounts and prices the way user wrote them in output of print command (#471)
* Remember original postings during infer and pivot

This includes such functions like:
- inferFromAssignment
- inferBalancingAmount
- inferBalancingPrices
- pivotPosting

* Use original postings for hledger print

- Introduce "--explicit" option for "print" command which brings back
  old behavior when every inferred number being printed.
- Make "print" by default print original postings without inferred
  amounts. But use effective account name to have effect from aliases.
- Instruct shell tests with an new expected output or to use
  --explicit option when inferred amounts are checked.

Resolves simonmichael/hledger#442
2017-01-13 07:25:44 -08:00

77 lines
1019 B
Plaintext

# filtering by transaction status
# 1. with --cleared, print shows cleared transactions only
hledger -f- print --cleared
<<<
2010/1/1 x
a 1
b
2010/1/2 * x
a 1
b
2010/1/3 *
a 1
b
>>>
2010/01/02 * x
a 1
b
2010/01/03 *
a 1
b
>>>=0
# 2. with --uncleared, shows uncleared transactions only
hledger -f- print --uncleared
<<<
2010/1/1 x
a 1
b
2010/1/2 * x
a 1
b
2010/1/3 *
a 1
b
>>>
2010/01/01 x
a 1
b
>>>=0
# 3. can also have per-posting cleared status
hledger -f- register --cleared
<<<
2012/1/1
a 1
*b 2
* c 4
d
>>>
2012/01/01 b 2 2
c 4 6
>>>= 0
# 4. also works with balance as shown, same as ledger. Hmm.
hledger -f- balance --uncleared
<<<
2012/1/1
a 1
*b 2
d
>>>
1 a
-3 d
--------------------
-2
>>>=0