simonmichael / hledger

Robust, fast, intuitive plain text accounting tool with CLI, TUI and web interfaces.
https://hledger.org
GNU General Public License v3.0
3.01k stars 321 forks source link

Horizontal display of income statement / balance sheet #1462

Open josephernest opened 3 years ago

josephernest commented 3 years ago

When using hledger -f FILE is, instead of displaying the output vertically like this:

             || 2021-01-01..2021-01-04 
=============++========================
 Revenues    ||                        
-------------++------------------------
 income:abc  ||                   2000 
-------------++------------------------
             ||                   2000 
=============++========================
 Expenses    ||                        
-------------++------------------------
 expense:def ||                   1000 
-------------++------------------------
             ||                   1000 
=============++========================
 Net:        ||                   1000 

how to have an output like this as an horizontal table:

=============++========================|||===============++========================
  Expenses    ||                        |||   Revenues    ||                        
-------------++------------------------|||---------------++------------------------
  expense:def ||                   1000 |||   income:abc  ||                   2000 
-------------++------------------------|||---------------++------------------------
              ||                   1000 |||               ||                   2000 
===================================================================================
  Net:                                                                         1000 

I have the same question for balance-sheet.

This kind of display is common in European/French accounting:

simonmichael commented 3 years ago

Nice mockup and screenshot @josephernest . I think this is a duplicate of #71.

josephernest commented 3 years ago

Thank you for your answer @simonmichael. Yes it's related (French too here!), but not exactly a duplicate; in my case it would simply be a different layout.

Do you think it is possible to display the balance sheet table 'horizontally' with the current version of hledger (with some arguments)?

simonmichael commented 3 years ago

No, it's not possible with the current version. Well, not without manual or scripted post-processing of the output, to rearrange it.

josephernest commented 3 years ago

Thanks for your answer @simonmichael. By the way, I didn't find "income statement" or "balance sheet" in the original ledger-cli implementation, is it available on it too? Or is it a feature that you added specifically for hledger?

simonmichael commented 3 years ago

It's something I added in hledger, with the goal of making practical accounting more accessible to more people.

simonmichael commented 3 years ago

(Of course you can get similar numbers out of Ledger. But it's a lot harder, when you consider the various scenarios.)

simonmichael commented 3 years ago

@josephernest, I like the idea of supporting the two column layout, but what about multi-period reports ? Eg with -M.

josephernest commented 3 years ago

you're right, it's probably complicated in this case...

simonmichael commented 3 years ago

I suppose it could repeat the two-column table vertically for each period. I'm not sure how usable that would be. Worth a try.