hledger/hledger/test/timedot.test

93 lines
2.7 KiB
Plaintext

# * timedot format
<
# sample.timedot
# This is a comment line
; Also a comment line
* Org headings before the first date are also comment lines
2023-01-01 transaction description
biz:research ....
inc:client1 .... ..
2023-01-01 different transaction, same day ; with a comment and transaction-tag:
; more transaction comment lines ? currently ignored
fos:haskell .... ; a posting comment and posting-tag:
; more posting comment lines ? currently ignored
per:admin ....
2023-01-02
a ; no quantity means zero
b aabbaca ; letter "dots" are tagged with t:LETTER
** 2023-01-02 ; dates are allowed to be org headings
# ** 1. The above timedot is converted to these transactions.
$ hledger -ftimedot:- print
2023-01-01 * transaction description
(biz:research) 1.00
(inc:client1) 1.50
2023-01-01 * different transaction, same day ; with a comment and transaction-tag:
(fos:haskell) 1.00 ; a posting comment and posting-tag:
(per:admin) 1.00
2023-01-02 *
(a) 0.00 ; no quantity means zero
(b) 1.00 ; letter "dots" are tagged with t:LETTER, t:a
(b) 0.50 ; letter "dots" are tagged with t:LETTER, t:b
(b) 0.25 ; letter "dots" are tagged with t:LETTER, t:c
2023-01-02 * ; dates are allowed to be org headings
>=
# ** 2. And this register.
$ hledger -ftimedot:- reg -w80
2023-01-01 transaction descr.. (biz:research) 1.00 1.00
(inc:client1) 1.50 2.50
2023-01-01 different transac.. (fos:haskell) 1.00 3.50
(per:admin) 1.00 4.50
2023-01-02 (a) 0 4.50
(b) 1.00 5.50
(b) 0.50 6.00
(b) 0.25 6.25
# ** 3. Tags are recognised. Account aliases are applied.
$ hledger -ftimedot:- reg -w80 tag:posting-tag --alias fos:haskell=λ
2023-01-01 different transac.. (λ) 1.00 1.00
# ** 4. Each of these formats is parsed as exactly 0.25.
<
2023-01-01
a .
b 0.25
c .25
d 0,25
e ,25
f 15m
g 0.25h
$ hledger -ftimedot:- print
2023-01-01 *
(a) 0.25
(b) 0.25
(c) 0.25
(d) 0.25
(e) 0.25
(f) 0.25
(g) 0.25
>=
# ** 5. Lines can be commented by a leading # or ;, indented or not.
<
2024-01-01
;a
;b
#c
#d
e
$ hledger -ftimedot:- accounts
e