How to mimic hledger's balancesheet report with Ledger

Cc from https://www.reddit.com/r/plaintextaccounting/comments/1jad4hy/ledgercli_help/

You could mimic this hledger report:

$ hledger bs
Balance Sheet 2025-01-04

                         || 2025-01-04 
=========================++============
 Assets                  ||            
-------------------------++------------
 assets:bank:checking    ||    950 USD 
 assets:cash             ||    100 USD 
-------------------------++------------
                         ||   1050 USD 
=========================++============
 Liabilities             ||            
-------------------------++------------
 liabilities:credit card ||    400 USD 
-------------------------++------------
                         ||    400 USD 
=========================++============
 Net:                    ||    650 USD 

like this (without totals):

$ echo Assets:; ledger bal --flat --no-total assets; echo Liabilities; ledger bal --flat --no-total --invert liabilities
Assets:
             950 USD  assets:bank:checking
             100 USD  assets:cash
Liabilities
             400 USD  liabilities:credit card

or like this (reading with the usual PTA goggles: a negative number is a normal liability balance):

$ ledger bal --flat assets liabilities
             950 USD  assets:bank:checking
             100 USD  assets:cash
            -400 USD  liabilities:credit card
--------------------
             650 USD

Now this is the reason I adopted hledger as my second PTA tool. I just couldn't get the --format string to give the reports the way HLedger does. I tried to contribute this change to Ledger, but I'm neither a C++-main to grok where the change needs to be made, nor a Haskell-main to grok where the beauty is being generated. I think it doesn't hurt to use both, if you're not doing anything tool-specific in your journal. When I'm doing financial accounting, I tend to lean towards HLedger. When I'm doing managerial accounting, I tend to lean towards ledger. Both have their strengths TBH. But this reports thing… I don't think Ledger cares about the UX of its reporting as much as HLedger does. Recently, I've started embracing Beancount because when presenting the reports of my financial accounting to management, it's better to show a graph with colours than text on the commandline.

I'd encourage anyone getting into PTA today not to be partisan on the tooling, and embrace any mixture that gets the job done

3 Likes