hledger/hledger/test/journal/directive-account.test
Stephen Morgan df4949ad1a imp!: journal: Remove deprecated account type code syntax from account
directives.

Previously, you declare an account type with the following format:
account assets  A
This has been deprecated since 1.13, and should now be declared with one
of:
account assets  ; type:A
account assets  ; type:asset
2022-01-28 12:38:38 -10:00

65 lines
1.5 KiB
Plaintext

# account names
# 1. "apply account" and "alias" affect "account" directives.
<
apply account c
alias c:a=b
account a
$ hledger -f - accounts
b
# 2. account directives can declare account type.
# Here "asset" is a liability, despite the name. So are its subaccounts.
# "b" is a liability. "b:bb" is an asset.
<
; a liability
account asset ; type:L
; an asset
account b:bb ; type:A
; a liability
account b ; type:L
2018/1/1
(asset:a) 1
(b) 2
(b:bb) 3
$ hledger -f - bs -N --flat
Balance Sheet 2018-01-01
|| 2018-01-01
=============++============
Assets ||
-------------++------------
b:bb || 3
=============++============
Liabilities ||
-------------++------------
asset:a || -1
b || -2
# 3. Tree mode. A little weird, b appears twice.
# It must be shown above bb, but since not an asset, its balance is excluded there.
# It is shown again in the liabilities section, this time with balance.
$ hledger -f - bs -N
Balance Sheet 2018-01-01
|| 2018-01-01
=============++============
Assets ||
-------------++------------
b:bb || 3
=============++============
Liabilities ||
-------------++------------
asset:a || -1
b || -2
# TODO
# a trailing : should give a clear error
# 2009/1/1
# a: 1
# $ hledger -f - print
# >2 /accountname seems ill-formed: a:/
# >= 1