2017-03-20 16:58:27 +03:00
|
|
|
# 1. Simple statement works
|
2016-08-13 17:47:43 +03:00
|
|
|
hledger -f - incomestatement
|
|
|
|
<<<
|
|
|
|
2016/1/1
|
|
|
|
income 1
|
|
|
|
b
|
|
|
|
>>>
|
2018-01-21 06:35:42 +03:00
|
|
|
Income Statement 2016/01/01
|
2016-08-13 17:47:43 +03:00
|
|
|
|
2018-01-23 21:47:47 +03:00
|
|
|
|| 2016/01/01
|
|
|
|
==========++============
|
|
|
|
Revenues ||
|
|
|
|
----------++------------
|
|
|
|
income || -1
|
|
|
|
----------++------------
|
|
|
|
|| -1
|
|
|
|
==========++============
|
|
|
|
Expenses ||
|
|
|
|
----------++------------
|
|
|
|
----------++------------
|
|
|
|
||
|
|
|
|
==========++============
|
|
|
|
Net: || -1
|
2016-08-13 17:47:43 +03:00
|
|
|
>>>2
|
|
|
|
>>>= 0
|
2017-03-20 16:58:27 +03:00
|
|
|
|
|
|
|
# 2. Period reporting works for a specific year
|
|
|
|
hledger -f - incomestatement -b 2016 -e 2017
|
|
|
|
<<<
|
|
|
|
2015/10/10 Client A | Invoice #1
|
|
|
|
assets:receivables $10,000.00
|
|
|
|
revenue:clients:A -$10,000.00
|
|
|
|
|
|
|
|
2015/11/02 Deposit | Invoice #1
|
|
|
|
assets:checking $10,000.00
|
|
|
|
assets:receivables -$10,000.00
|
|
|
|
|
|
|
|
2016/02/01 Client B | Invoice #2
|
|
|
|
assets:receivables $10.00
|
|
|
|
revenue:clients:B -$10.00
|
|
|
|
|
|
|
|
2016/02/15 ACME | Hosting Costs
|
|
|
|
expense:hosting $50.00
|
|
|
|
assets:checking -$50.00
|
|
|
|
|
|
|
|
2016/03/01 Deposit | Invoice #2
|
|
|
|
assets:checking $10.00
|
|
|
|
assets:receivables -$10.00
|
|
|
|
>>>
|
2018-01-21 06:35:42 +03:00
|
|
|
Income Statement 2016
|
2017-03-20 16:58:27 +03:00
|
|
|
|
2018-01-23 21:47:47 +03:00
|
|
|
|| 2016
|
|
|
|
===================++=========
|
|
|
|
Revenues ||
|
|
|
|
-------------------++---------
|
|
|
|
revenue:clients:B || $10.00
|
|
|
|
-------------------++---------
|
|
|
|
|| $10.00
|
|
|
|
===================++=========
|
|
|
|
Expenses ||
|
|
|
|
-------------------++---------
|
|
|
|
expense:hosting || $50.00
|
|
|
|
-------------------++---------
|
|
|
|
|| $50.00
|
|
|
|
===================++=========
|
|
|
|
Net: || $-40.00
|
2017-03-20 16:58:27 +03:00
|
|
|
>>>2
|
|
|
|
>>>= 0
|
|
|
|
|
|
|
|
# 3. Period reporting works for two years
|
|
|
|
hledger -f - incomestatement -b 2015 -e 2017
|
|
|
|
<<<
|
|
|
|
2015/10/10 Client A | Invoice #1
|
|
|
|
assets:receivables $10,000.00
|
|
|
|
revenue:clients:A -$10,000.00
|
|
|
|
|
|
|
|
2015/11/02 Deposit | Invoice #1
|
|
|
|
assets:checking $10,000.00
|
|
|
|
assets:receivables -$10,000.00
|
|
|
|
|
|
|
|
2016/02/01 Client B | Invoice #2
|
|
|
|
assets:receivables $10.00
|
|
|
|
revenue:clients:B -$10.00
|
|
|
|
|
|
|
|
2016/02/15 ACME | Hosting Costs
|
|
|
|
expense:hosting $50.00
|
|
|
|
assets:checking -$50.00
|
|
|
|
|
|
|
|
2016/03/01 Deposit | Invoice #2
|
|
|
|
assets:checking $10.00
|
|
|
|
assets:receivables -$10.00
|
|
|
|
>>>
|
2018-01-21 06:35:42 +03:00
|
|
|
Income Statement 2015/01/01-2016/12/31
|
2017-03-20 16:58:27 +03:00
|
|
|
|
2018-01-23 21:47:47 +03:00
|
|
|
|| 2015/01/01-2016/12/31
|
|
|
|
===================++=======================
|
|
|
|
Revenues ||
|
|
|
|
-------------------++-----------------------
|
|
|
|
revenue:clients:A || $10,000.00
|
|
|
|
revenue:clients:B || $10.00
|
|
|
|
-------------------++-----------------------
|
|
|
|
|| $10,010.00
|
|
|
|
===================++=======================
|
|
|
|
Expenses ||
|
|
|
|
-------------------++-----------------------
|
|
|
|
expense:hosting || $50.00
|
|
|
|
-------------------++-----------------------
|
|
|
|
|| $50.00
|
|
|
|
===================++=======================
|
|
|
|
Net: || $9,960.00
|
2017-03-20 16:58:27 +03:00
|
|
|
>>>2
|
|
|
|
>>>= 0
|
|
|
|
|
|
|
|
# 4. Period reporting works for one month
|
|
|
|
hledger -f - incomestatement -b 2015/10 -e 2015/11
|
|
|
|
<<<
|
|
|
|
2015/10/10 Client A | Invoice #1
|
|
|
|
assets:receivables $10,000.00
|
|
|
|
revenue:clients:A -$10,000.00
|
|
|
|
|
|
|
|
2015/11/02 Deposit | Invoice #1
|
|
|
|
assets:checking $10,000.00
|
|
|
|
assets:receivables -$10,000.00
|
|
|
|
|
|
|
|
2016/02/01 Client B | Invoice #2
|
|
|
|
assets:receivables $10.00
|
|
|
|
revenue:clients:B -$10.00
|
|
|
|
|
|
|
|
2016/02/15 ACME | Hosting Costs
|
|
|
|
expense:hosting $50.00
|
|
|
|
assets:checking -$50.00
|
|
|
|
|
|
|
|
2016/03/01 Deposit | Invoice #2
|
|
|
|
assets:checking $10.00
|
|
|
|
assets:receivables -$10.00
|
|
|
|
>>>
|
2018-01-21 06:35:42 +03:00
|
|
|
Income Statement 2015/10
|
2017-03-20 16:58:27 +03:00
|
|
|
|
2018-03-29 16:54:36 +03:00
|
|
|
|| Oct
|
2018-01-23 21:47:47 +03:00
|
|
|
===================++============
|
|
|
|
Revenues ||
|
|
|
|
-------------------++------------
|
|
|
|
revenue:clients:A || $10,000.00
|
|
|
|
-------------------++------------
|
|
|
|
|| $10,000.00
|
|
|
|
===================++============
|
|
|
|
Expenses ||
|
|
|
|
-------------------++------------
|
|
|
|
-------------------++------------
|
|
|
|
||
|
|
|
|
===================++============
|
|
|
|
Net: || $10,000.00
|
2017-03-20 16:58:27 +03:00
|
|
|
>>>2
|
|
|
|
>>>= 0
|
|
|
|
|
|
|
|
# 5. Period reporting works for one month in another year
|
|
|
|
hledger -f - incomestatement -b 2016/10 -e 2016/11
|
|
|
|
<<<
|
|
|
|
2015/10/10 Client A | Invoice #1
|
|
|
|
assets:receivables $10,000.00
|
|
|
|
revenue:clients:A -$10,000.00
|
|
|
|
|
|
|
|
2015/11/02 Deposit | Invoice #1
|
|
|
|
assets:checking $10,000.00
|
|
|
|
assets:receivables -$10,000.00
|
|
|
|
|
|
|
|
2016/02/01 Client B | Invoice #2
|
|
|
|
assets:receivables $10.00
|
|
|
|
revenue:clients:B -$10.00
|
|
|
|
|
|
|
|
2016/02/15 ACME | Hosting Costs
|
|
|
|
expense:hosting $50.00
|
|
|
|
assets:checking -$50.00
|
|
|
|
|
|
|
|
2016/03/01 Deposit | Invoice #2
|
|
|
|
assets:checking $10.00
|
|
|
|
assets:receivables -$10.00
|
|
|
|
>>>
|
2018-01-21 06:35:42 +03:00
|
|
|
Income Statement 2016/10
|
2017-03-20 16:58:27 +03:00
|
|
|
|
2018-03-29 16:54:36 +03:00
|
|
|
|| Oct
|
|
|
|
==========++=====
|
|
|
|
Revenues ||
|
|
|
|
----------++-----
|
|
|
|
----------++-----
|
|
|
|
|| 0
|
|
|
|
==========++=====
|
|
|
|
Expenses ||
|
|
|
|
----------++-----
|
|
|
|
----------++-----
|
|
|
|
|| 0
|
|
|
|
==========++=====
|
|
|
|
Net: || 0
|
2017-03-20 16:58:27 +03:00
|
|
|
>>>2
|
|
|
|
>>>= 0
|
2017-03-31 01:13:07 +03:00
|
|
|
|
|
|
|
# 6. Multicolumn test
|
2018-01-16 04:58:14 +03:00
|
|
|
# old (arithmetic sign):
|
|
|
|
# Income Statement
|
|
|
|
#
|
|
|
|
# || 2008/01 2008/02 2008/03 2008/04 2008/05 2008/06 2008/07 2008/08 2008/09 2008/10 2008/11 2008/12 Total Average
|
|
|
|
# ===================++==============================================================================================================================
|
|
|
|
# Revenues ||
|
|
|
|
# -------------------++------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# income:gifts || 0 0 0 0 0 $-1 0 0 0 0 0 0 $-1 0
|
|
|
|
# income:salary || $-1 0 0 0 0 0 0 0 0 0 0 0 $-1 0
|
|
|
|
# -------------------++------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# || $-1 0 0 0 0 $-1 0 0 0 0 0 0 $-2 0
|
|
|
|
# ===================++==============================================================================================================================
|
|
|
|
# Expenses ||
|
|
|
|
# -------------------++------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# expenses:food || 0 0 0 0 0 $1 0 0 0 0 0 0 $1 0
|
|
|
|
# expenses:supplies || 0 0 0 0 0 $1 0 0 0 0 0 0 $1 0
|
|
|
|
# -------------------++------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# || 0 0 0 0 0 $2 0 0 0 0 0 0 $2 0
|
|
|
|
# ===================++==============================================================================================================================
|
|
|
|
# Total || $-1 0 0 0 0 $1 0 0 0 0 0 0 0 0
|
|
|
|
#
|
2017-03-31 01:13:07 +03:00
|
|
|
hledger -f sample.journal incomestatement -p 'monthly in 2008' -AT
|
|
|
|
>>>
|
2018-01-21 06:35:42 +03:00
|
|
|
Income Statement 2008
|
2017-03-31 01:13:07 +03:00
|
|
|
|
2018-03-29 16:54:36 +03:00
|
|
|
|| Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Total Average
|
|
|
|
===================++==============================================================================
|
|
|
|
Revenues ||
|
|
|
|
-------------------++------------------------------------------------------------------------------
|
|
|
|
income:gifts || 0 0 0 0 0 $1 0 0 0 0 0 0 $1 0
|
|
|
|
income:salary || $1 0 0 0 0 0 0 0 0 0 0 0 $1 0
|
|
|
|
-------------------++------------------------------------------------------------------------------
|
|
|
|
|| $1 0 0 0 0 $1 0 0 0 0 0 0 $2 0
|
|
|
|
===================++==============================================================================
|
|
|
|
Expenses ||
|
|
|
|
-------------------++------------------------------------------------------------------------------
|
|
|
|
expenses:food || 0 0 0 0 0 $1 0 0 0 0 0 0 $1 0
|
|
|
|
expenses:supplies || 0 0 0 0 0 $1 0 0 0 0 0 0 $1 0
|
|
|
|
-------------------++------------------------------------------------------------------------------
|
|
|
|
|| 0 0 0 0 0 $2 0 0 0 0 0 0 $2 0
|
|
|
|
===================++==============================================================================
|
|
|
|
Net: || $1 0 0 0 0 $-1 0 0 0 0 0 0 0 0
|
2017-03-31 01:13:07 +03:00
|
|
|
>>>= 0
|
|
|
|
|
2018-01-16 04:58:14 +03:00
|
|
|
# 7. Multicolumn test (historical)
|
|
|
|
# old (arithmetic sign):
|
|
|
|
# Income Statement (Historical Ending Balances)
|
|
|
|
#
|
|
|
|
# || 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
|
|
|
|
# ===================++================================================================================================================================================
|
|
|
|
# Revenues ||
|
|
|
|
# -------------------++------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# income:gifts || 0 0 0 0 0 $-1 $-1 $-1 $-1 $-1 $-1 $-1
|
|
|
|
# income:salary || $-1 $-1 $-1 $-1 $-1 $-1 $-1 $-1 $-1 $-1 $-1 $-1
|
|
|
|
# -------------------++------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# || $-1 $-1 $-1 $-1 $-1 $-2 $-2 $-2 $-2 $-2 $-2 $-2
|
|
|
|
# ===================++================================================================================================================================================
|
|
|
|
# Expenses ||
|
|
|
|
# -------------------++------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# expenses:food || 0 0 0 0 0 $1 $1 $1 $1 $1 $1 $1
|
|
|
|
# expenses:supplies || 0 0 0 0 0 $1 $1 $1 $1 $1 $1 $1
|
|
|
|
# -------------------++------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
# || 0 0 0 0 0 $2 $2 $2 $2 $2 $2 $2
|
|
|
|
# ===================++================================================================================================================================================
|
|
|
|
# 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 incomestatement -p 'monthly in 2008' --historical
|
|
|
|
>>>
|
2019-08-14 21:27:57 +03:00
|
|
|
Income Statement 2008/01/31,,2008/12/31 (Historical Ending Balances)
|
2017-03-31 01:13:07 +03:00
|
|
|
|
2017-07-27 18:52:49 +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
|
|
|
|
===================++================================================================================================================================================
|
|
|
|
Revenues ||
|
|
|
|
-------------------++------------------------------------------------------------------------------------------------------------------------------------------------
|
2018-01-16 04:58:14 +03:00
|
|
|
income:gifts || 0 0 0 0 0 $1 $1 $1 $1 $1 $1 $1
|
|
|
|
income:salary || $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1 $1
|
2017-07-27 18:52:49 +03:00
|
|
|
-------------------++------------------------------------------------------------------------------------------------------------------------------------------------
|
2018-01-16 04:58:14 +03:00
|
|
|
|| $1 $1 $1 $1 $1 $2 $2 $2 $2 $2 $2 $2
|
2017-07-27 18:52:49 +03:00
|
|
|
===================++================================================================================================================================================
|
|
|
|
Expenses ||
|
|
|
|
-------------------++------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
expenses:food || 0 0 0 0 0 $1 $1 $1 $1 $1 $1 $1
|
|
|
|
expenses:supplies || 0 0 0 0 0 $1 $1 $1 $1 $1 $1 $1
|
|
|
|
-------------------++------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|| 0 0 0 0 0 $2 $2 $2 $2 $2 $2 $2
|
|
|
|
===================++================================================================================================================================================
|
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
|
2019-11-11 23:06:58 +03:00
|
|
|
|
|
|
|
# 8. Percentage test
|
|
|
|
hledger -f sample.journal incomestatement -p 'quarterly 2008' -T --average -%
|
|
|
|
>>>
|
|
|
|
Income Statement 2008
|
|
|
|
|
|
|
|
|| 2008q1 2008q2 2008q3 2008q4 Total Average
|
|
|
|
===================++====================================================
|
|
|
|
Revenues ||
|
|
|
|
-------------------++----------------------------------------------------
|
|
|
|
income:gifts || 0 100.0 % 0 0 50.0 % 50.0 %
|
|
|
|
income:salary || 100.0 % 0 0 0 50.0 % 50.0 %
|
|
|
|
-------------------++----------------------------------------------------
|
|
|
|
|| 100.0 % 100.0 % 0 0 100.0 % 100.0 %
|
|
|
|
===================++====================================================
|
|
|
|
Expenses ||
|
|
|
|
-------------------++----------------------------------------------------
|
|
|
|
expenses:food || 0 50.0 % 0 0 50.0 % 50.0 %
|
|
|
|
expenses:supplies || 0 50.0 % 0 0 50.0 % 50.0 %
|
|
|
|
-------------------++----------------------------------------------------
|
|
|
|
|| 0 100.0 % 0 0 100.0 % 100.0 %
|
|
|
|
>>>= 0
|
|
|
|
|