2018-01-16 04:58:14 +03:00
|
|
|
# 1. trivial balance sheet
|
2016-08-13 17:47:43 +03:00
|
|
|
hledger -f - balancesheet
|
|
|
|
<<<
|
|
|
|
2016/1/1
|
|
|
|
assets 1
|
|
|
|
b
|
|
|
|
>>>
|
2020-01-06 19:37:14 +03:00
|
|
|
Balance Sheet 2016-01-01
|
2016-08-13 17:47:43 +03:00
|
|
|
|
2019-12-30 08:19:50 +03:00
|
|
|
|| 2016-01-01
|
2018-01-23 21:47:47 +03:00
|
|
|
=============++============
|
|
|
|
Assets ||
|
|
|
|
-------------++------------
|
|
|
|
assets || 1
|
|
|
|
-------------++------------
|
|
|
|
|| 1
|
|
|
|
=============++============
|
|
|
|
Liabilities ||
|
|
|
|
-------------++------------
|
|
|
|
-------------++------------
|
|
|
|
||
|
|
|
|
=============++============
|
|
|
|
Net: || 1
|
2016-08-13 17:47:43 +03:00
|
|
|
>>>2
|
|
|
|
>>>= 0
|
2017-03-31 01:13:07 +03:00
|
|
|
|
2018-01-16 04:58:14 +03:00
|
|
|
# 2. monthly balance sheet, normal positive sign
|
|
|
|
# old (arithmetic sign):
|
|
|
|
#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
|
|
|
|
#
|
2017-03-31 01:13:07 +03:00
|
|
|
hledger -f sample.journal balancesheet -p 'monthly in 2008'
|
|
|
|
>>>
|
2020-06-05 04:30:55 +03:00
|
|
|
Balance Sheet 2008-01-31..2008-12-31
|
2017-03-31 01:13:07 +03:00
|
|
|
|
2019-12-30 08:19:50 +03:00
|
|
|
|| 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
|
2017-07-27 18:52:49 +03:00
|
|
|
======================++================================================================================================================================================
|
|
|
|
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 ||
|
|
|
|
----------------------++------------------------------------------------------------------------------------------------------------------------------------------------
|
2018-01-16 04:58:14 +03:00
|
|
|
liabilities:debts || 0 0 0 0 0 0 0 0 0 0 0 $-1
|
2017-07-27 18:52:49 +03:00
|
|
|
----------------------++------------------------------------------------------------------------------------------------------------------------------------------------
|
2018-01-16 04:58:14 +03:00
|
|
|
|| 0 0 0 0 0 0 0 0 0 0 0 $-1
|
2017-07-27 18:52:49 +03:00
|
|
|
======================++================================================================================================================================================
|
2018-01-16 04:58:14 +03:00
|
|
|
Net: || $1 $1 $1 $1 $1 0 0 0 0 0 0 0
|
2017-03-31 01:13:07 +03:00
|
|
|
>>>=0
|
|
|
|
|
2018-01-16 04:58:14 +03:00
|
|
|
# 3. monthly balance sheet in tree mode
|
|
|
|
# old (arithmetic sign):
|
|
|
|
# || 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
|
|
|
|
#
|
2017-03-31 01:13:07 +03:00
|
|
|
hledger -f sample.journal balancesheet -p 'monthly in 2008' --tree
|
|
|
|
>>>
|
2020-06-05 04:30:55 +03:00
|
|
|
Balance Sheet 2008-01-31..2008-12-31
|
2017-03-31 01:13:07 +03:00
|
|
|
|
2020-06-24 05:58:18 +03:00
|
|
|
|| 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: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
|
|
|
|
===================++================================================================================================================================================
|
|
|
|
Net: || $1 $1 $1 $1 $1 0 0 0 0 0 0 0
|
2017-03-31 01:13:07 +03:00
|
|
|
>>>= 0
|
|
|
|
|
2019-05-11 21:55:04 +03:00
|
|
|
# 4. monthly balancesheet with average column and without overall totals row.
|
|
|
|
# Total column is requested but not shown because balancesheet is in historical mode
|
|
|
|
# by default (shows ending balances).
|
2018-01-16 04:58:14 +03:00
|
|
|
hledger -f sample.journal balancesheet -p 'monthly in 2008' -NAT
|
2017-03-31 01:13:07 +03:00
|
|
|
>>>
|
2020-06-05 04:30:55 +03:00
|
|
|
Balance Sheet 2008-01-31..2008-12-31
|
2017-03-31 01:13:07 +03:00
|
|
|
|
2019-12-30 08:19:50 +03:00
|
|
|
|| 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
|
2019-05-11 21:55:04 +03:00
|
|
|
======================++=========================================================================================================================================================
|
|
|
|
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
|
|
|
|
======================++=========================================================================================================================================================
|
|
|
|
Liabilities ||
|
|
|
|
----------------------++---------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
liabilities:debts || 0 0 0 0 0 0 0 0 0 0 0 $-1 0
|
2017-03-31 01:13:07 +03:00
|
|
|
>>>= 0
|
|
|
|
|
2018-01-16 04:58:14 +03:00
|
|
|
# 5. Tree output still works, #565
|
2017-06-07 17:00:26 +03:00
|
|
|
hledger -f- balancesheet
|
|
|
|
<<<
|
|
|
|
2017/1/1
|
|
|
|
(assets:b) 1
|
|
|
|
>>>
|
2020-01-06 19:37:14 +03:00
|
|
|
Balance Sheet 2017-01-01
|
2017-06-07 17:00:26 +03:00
|
|
|
|
2019-12-30 08:19:50 +03:00
|
|
|
|| 2017-01-01
|
2018-01-23 21:47:47 +03:00
|
|
|
=============++============
|
|
|
|
Assets ||
|
|
|
|
-------------++------------
|
2020-06-24 05:58:18 +03:00
|
|
|
assets:b || 1
|
2018-01-23 21:47:47 +03:00
|
|
|
-------------++------------
|
|
|
|
|| 1
|
|
|
|
=============++============
|
|
|
|
Liabilities ||
|
|
|
|
-------------++------------
|
|
|
|
-------------++------------
|
|
|
|
||
|
|
|
|
=============++============
|
|
|
|
Net: || 1
|
2017-06-07 17:00:26 +03:00
|
|
|
>>>2
|
|
|
|
>>>=0
|
|
|
|
|
2018-01-16 04:58:14 +03:00
|
|
|
# 6. Flat output still works, #552
|
2017-06-07 17:02:58 +03:00
|
|
|
hledger -f- balancesheet --flat
|
|
|
|
<<<
|
|
|
|
2017/1/1
|
|
|
|
(assets:b) 1
|
|
|
|
>>>
|
2020-01-06 19:37:14 +03:00
|
|
|
Balance Sheet 2017-01-01
|
2017-06-07 17:02:58 +03:00
|
|
|
|
2019-12-30 08:19:50 +03:00
|
|
|
|| 2017-01-01
|
2018-01-23 21:47:47 +03:00
|
|
|
=============++============
|
|
|
|
Assets ||
|
|
|
|
-------------++------------
|
|
|
|
assets:b || 1
|
|
|
|
-------------++------------
|
|
|
|
|| 1
|
|
|
|
=============++============
|
|
|
|
Liabilities ||
|
|
|
|
-------------++------------
|
|
|
|
-------------++------------
|
|
|
|
||
|
|
|
|
=============++============
|
|
|
|
Net: || 1
|
2017-06-07 17:02:58 +03:00
|
|
|
>>>2
|
|
|
|
>>>=0
|
|
|
|
|
2018-09-28 02:51:23 +03:00
|
|
|
# 7. An empty section does not disrupt the overall totals, #588
|
2019-05-11 21:55:04 +03:00
|
|
|
hledger -f- balancesheet -YA
|
2017-07-25 19:17:54 +03:00
|
|
|
<<<
|
|
|
|
2017/1/1
|
|
|
|
(assets) $1
|
|
|
|
>>>
|
2020-01-06 19:37:14 +03:00
|
|
|
Balance Sheet 2017-12-31
|
2017-07-25 19:17:54 +03:00
|
|
|
|
2019-12-30 08:19:50 +03:00
|
|
|
|| 2017-12-31 Average
|
2019-05-11 21:55:04 +03:00
|
|
|
=============++=====================
|
|
|
|
Assets ||
|
|
|
|
-------------++---------------------
|
|
|
|
assets || $1 $1
|
|
|
|
-------------++---------------------
|
|
|
|
|| $1 $1
|
|
|
|
=============++=====================
|
|
|
|
Liabilities ||
|
|
|
|
-------------++---------------------
|
|
|
|
-------------++---------------------
|
|
|
|
||
|
|
|
|
=============++=====================
|
|
|
|
Net: || $1 $1
|
2017-07-25 19:17:54 +03:00
|
|
|
>>>2
|
|
|
|
>>>=0
|
2017-07-25 19:33:43 +03:00
|
|
|
|
2019-08-14 21:27:57 +03:00
|
|
|
# 8. --pretty-tables uses unicode chars for borders
|
2017-07-25 19:33:43 +03:00
|
|
|
hledger -f - balancesheet -M --pretty-tables
|
|
|
|
<<<
|
|
|
|
2016/1/1
|
|
|
|
assets 1
|
|
|
|
b
|
|
|
|
>>>
|
2020-01-06 19:37:14 +03:00
|
|
|
Balance Sheet 2016-01-31
|
2017-07-25 19:33:43 +03:00
|
|
|
|
2019-12-30 08:19:50 +03:00
|
|
|
║ 2016-01-31
|
2017-07-27 18:52:49 +03:00
|
|
|
═════════════╬════════════
|
|
|
|
Assets ║
|
|
|
|
─────────────╫────────────
|
|
|
|
assets ║ 1
|
|
|
|
─────────────╫────────────
|
|
|
|
║ 1
|
|
|
|
═════════════╬════════════
|
|
|
|
Liabilities ║
|
|
|
|
─────────────╫────────────
|
|
|
|
─────────────╫────────────
|
|
|
|
║
|
|
|
|
═════════════╬════════════
|
2018-01-16 04:58:14 +03:00
|
|
|
Net: ║ 1
|
2017-07-25 19:33:43 +03:00
|
|
|
>>>2
|
|
|
|
>>>= 0
|
2018-10-18 00:45:23 +03:00
|
|
|
|
2019-08-14 21:27:57 +03:00
|
|
|
# 9. Check that accounts brought to zero by subaccount balances
|
2018-10-18 00:45:23 +03:00
|
|
|
# are not erased from balancesheet
|
|
|
|
hledger -f - balancesheet
|
|
|
|
<<<
|
|
|
|
2018-10-01
|
|
|
|
income:whatever
|
|
|
|
assets:bank $100
|
|
|
|
assets:bank:subaccount $10
|
|
|
|
assets:bank:this subaccount should disappear $10
|
|
|
|
|
|
|
|
2018-10-02
|
|
|
|
assets:bank:this subaccount should disappear -$10
|
|
|
|
assets:bank
|
|
|
|
|
|
|
|
2018-10-03
|
|
|
|
assets:this account should not disappear:subaccount -$10
|
|
|
|
assets:this account should not disappear
|
|
|
|
>>>
|
2020-01-06 19:37:14 +03:00
|
|
|
Balance Sheet 2018-10-03
|
2018-10-18 00:45:23 +03:00
|
|
|
|
2019-12-30 08:19:50 +03:00
|
|
|
|| 2018-10-03
|
2018-10-18 00:45:23 +03:00
|
|
|
=====================================++============
|
|
|
|
Assets ||
|
|
|
|
-------------------------------------++------------
|
|
|
|
assets || $120
|
|
|
|
bank || $120
|
|
|
|
subaccount || $10
|
|
|
|
this account should not disappear || 0
|
|
|
|
subaccount || $-10
|
|
|
|
-------------------------------------++------------
|
|
|
|
|| $120
|
|
|
|
=====================================++============
|
|
|
|
Liabilities ||
|
|
|
|
-------------------------------------++------------
|
|
|
|
-------------------------------------++------------
|
|
|
|
||
|
|
|
|
=====================================++============
|
|
|
|
Net: || $120
|
|
|
|
>>>2
|
|
|
|
>>>= 0
|