hledger icon indicating copy to clipboard operation
hledger copied to clipboard

Yearly balance report is wrong

Open PSLLSP opened this issue 6 months ago • 3 comments
trafficstars

I am not sure if this is a bug or an expected behavior. I am not expert on double-entry accounting. I am just surprised with the report..

$ hledger --version
hledger 1.42.1, linux-x86_64

Simple balance, it is correct:

$ hledger -f demo-bug4.journal bal
                -900  assets:user
                 400  expenses
                 500  liabilities:utility
--------------------
                   0  

I do not like report for yearly balance: Isn't balance of of account liabilities:utility in 2023 still 500 ??

$ hledger -f demo-bug4.journal bal -Y
Balance changes in 2021-01-01..2023-12-31:

                     || 2021  2022  2023 
=====================++==================
 assets:user         || -700  -200     0 
 expenses            ||    0   200   200 
 liabilities:utility ||  700     0  -200 
---------------------++------------------
                     ||    0     0     0 

The report prints "Balance changes"

I would like to see something similar to balance sheet:

$ hledger -f demo-bug4.journal bs -Y
Yearly Balance Sheet 2021-12-31..2023-12-31

                     || 2021-12-31  2022-12-31  2023-12-31 
=====================++====================================
 Assets              ||                                    
---------------------++------------------------------------
 assets:user         ||       -700        -900        -900 
---------------------++------------------------------------
                     ||       -700        -900        -900 
=====================++====================================
 Liabilities         ||                                    
---------------------++------------------------------------
 liabilities:utility ||       -700        -700        -500 
---------------------++------------------------------------
                     ||       -700        -700        -500 
=====================++====================================
 Net:                ||          0        -200        -400 

For balance the report should look like this:

                     || 2021  2022  2023 
=====================++==================
 assets:user         || -700  -900  -900 
 expenses            ||    0   200   400 
 liabilities:utility ||  700   700   500 
---------------------++------------------
                     ||    0     0     0

Demo journal:

$ cat demo-bug4.journal
2021-12-10 payment
   assets:user           -700
   liabilities:utility

2022-01-11 payment for service
   liabilities:utility
   expenses              100

2022-06-12 payment for service
   liabilities:utility
   expenses              100

2022-12-13 payment
   assets:user           -200
   liabilities:utility

2023-01-14 payment for service
   liabilities:utility
   expenses              100

2023-06-15 payment for service
   liabilities:utility
   expenses              100

PSLLSP avatar May 10 '25 21:05 PSLLSP