hledger/tests/balancesheet/balancesheet.test

225 lines
15 KiB
Plaintext
Raw Normal View History

# 1.
hledger -f - balancesheet
<<<
2016/1/1
assets 1
b
>>>
Balance Sheet
Assets:
1 assets
--------------------
1
Liabilities:
--------------------
0
Total:
--------------------
1
>>>2
>>>= 0
# 2.
hledger -f sample.journal balancesheet -p 'monthly in 2008'
>>>
Balance Sheet
|| 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31
======================++=================================================================================================================================================
Assets ||
----------------------++-------------------------------------------------------------------------------------------------------------------------------------------------
assets:bank:checking || $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 0
assets:bank:saving || 0 0 0 0 0 $1 $1 $1 $1 $1 $1 $1
assets:cash || 0 0 0 0 0 $-2 $-2 $-2 $-2 $-2 $-2 $-2
----------------------++-------------------------------------------------------------------------------------------------------------------------------------------------
|| $1 $1 $1 $1 $1 0 0 0 0 0 0 $-1
======================++=================================================================================================================================================
Liabilities ||
----------------------++-------------------------------------------------------------------------------------------------------------------------------------------------
liabilities:debts || 0 0 0 0 0 0 0 0 0 0 0 $1
----------------------++-------------------------------------------------------------------------------------------------------------------------------------------------
|| 0 0 0 0 0 0 0 0 0 0 0 $1
======================++=================================================================================================================================================
Total || $1 $1 $1 $1 $1 0 0 0 0 0 0 0
>>>=0
# 3.
hledger -f sample.journal balancesheet -p 'monthly in 2008' --tree
>>>
Balance Sheet
|| 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31
==============++=================================================================================================================================================
Assets ||
--------------++-------------------------------------------------------------------------------------------------------------------------------------------------
assets || $1 $1 $1 $1 $1 0 0 0 0 0 0 $-1
bank || $1 $1 $1 $1 $1 $2 $2 $2 $2 $2 $2 $1
checking || $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 0
saving || 0 0 0 0 0 $1 $1 $1 $1 $1 $1 $1
cash || 0 0 0 0 0 $-2 $-2 $-2 $-2 $-2 $-2 $-2
--------------++-------------------------------------------------------------------------------------------------------------------------------------------------
|| $1 $1 $1 $1 $1 0 0 0 0 0 0 $-1
==============++=================================================================================================================================================
Liabilities ||
--------------++-------------------------------------------------------------------------------------------------------------------------------------------------
liabilities || 0 0 0 0 0 0 0 0 0 0 0 $1
debts || 0 0 0 0 0 0 0 0 0 0 0 $1
--------------++-------------------------------------------------------------------------------------------------------------------------------------------------
|| 0 0 0 0 0 0 0 0 0 0 0 $1
==============++=================================================================================================================================================
Total || $1 $1 $1 $1 $1 0 0 0 0 0 0 0
>>>= 0
# 4.
hledger -f sample.journal balancesheet -p 'monthly in 2008' -A
>>>
Balance Sheet
|| 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31 Average
======================++==========================================================================================================================================================
Assets ||
----------------------++----------------------------------------------------------------------------------------------------------------------------------------------------------
assets:bank:checking || $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 0 $1
assets:bank:saving || 0 0 0 0 0 $1 $1 $1 $1 $1 $1 $1 $1
assets:cash || 0 0 0 0 0 $-2 $-2 $-2 $-2 $-2 $-2 $-2 $-1
----------------------++----------------------------------------------------------------------------------------------------------------------------------------------------------
|| $1 $1 $1 $1 $1 0 0 0 0 0 0 $-1 0
======================++==========================================================================================================================================================
Liabilities ||
----------------------++----------------------------------------------------------------------------------------------------------------------------------------------------------
liabilities:debts || 0 0 0 0 0 0 0 0 0 0 0 $1 0
----------------------++----------------------------------------------------------------------------------------------------------------------------------------------------------
|| 0 0 0 0 0 0 0 0 0 0 0 $1 0
======================++==========================================================================================================================================================
Total || $1 $1 $1 $1 $1 0 0 0 0 0 0 0 0
>>>= 0
# 5.
hledger -f sample.journal balancesheet -p 'monthly in 2008' -NT
>>>
Balance Sheet
|| 2008/01/31 2008/02/29 2008/03/31 2008/04/30 2008/05/31 2008/06/30 2008/07/31 2008/08/31 2008/09/30 2008/10/31 2008/11/30 2008/12/31 Total
======================++==========================================================================================================================================================
Assets ||
----------------------++----------------------------------------------------------------------------------------------------------------------------------------------------------
assets:bank:checking || $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 0 $11
assets:bank:saving || 0 0 0 0 0 $1 $1 $1 $1 $1 $1 $1 $7
assets:cash || 0 0 0 0 0 $-2 $-2 $-2 $-2 $-2 $-2 $-2 $-14
----------------------++----------------------------------------------------------------------------------------------------------------------------------------------------------
|| $1 $1 $1 $1 $1 0 0 0 0 0 0 $-1 $4
======================++==========================================================================================================================================================
Liabilities ||
----------------------++----------------------------------------------------------------------------------------------------------------------------------------------------------
liabilities:debts || 0 0 0 0 0 0 0 0 0 0 0 $1 $1
----------------------++----------------------------------------------------------------------------------------------------------------------------------------------------------
|| 0 0 0 0 0 0 0 0 0 0 0 $1 $1
>>>= 0
2017-06-07 17:00:26 +03:00
# 6. Tree output still works, #565
hledger -f- balancesheet
<<<
2017/1/1
(assets:b) 1
>>>
Balance Sheet
Assets:
1 assets
1 b
--------------------
1
Liabilities:
--------------------
0
Total:
--------------------
1
>>>2
>>>=0
2017-06-07 17:02:58 +03:00
# 7. Flat output still works, #552
hledger -f- balancesheet --flat
<<<
2017/1/1
(assets:b) 1
>>>
Balance Sheet
Assets:
1 assets:b
--------------------
1
Liabilities:
--------------------
0
Total:
--------------------
1
>>>2
>>>=0
# 8. An empty section is does not disrupt the overall totals, #588
hledger -f- balancesheet -YTA
<<<
2017/1/1
(assets) $1
>>>
Balance Sheet
|| 2017/12/31 Total Average
=============++===============================
Assets ||
-------------++-------------------------------
assets || $1 $1 $1
-------------++-------------------------------
|| $1 $1 $1
=============++===============================
Liabilities ||
-------------++-------------------------------
-------------++-------------------------------
||
=============++===============================
Total || $1 $1 $1
>>>2
>>>=0
2017-07-25 19:33:43 +03:00
# 9. --pretty-tables uses unicode chars for borders
hledger -f - balancesheet -M --pretty-tables
<<<
2016/1/1
assets 1
b
>>>
Balance Sheet
║ 2016/01/31
═════════════╬═════════════
Assets ║
─────────────╫─────────────
assets ║ 1
─────────────╫─────────────
║ 1
═════════════╬═════════════
Liabilities ║
─────────────╫─────────────
─────────────╫─────────────
═════════════╬═════════════
Total ║ 1
>>>2
>>>= 0