51 lines
1.4 KiB
Haskell
51 lines
1.4 KiB
Haskell
{-# LANGUAGE QuasiQuotes, RecordWildCards #-}
|
|
{-# LANGUAGE TemplateHaskell #-}
|
|
{-|
|
|
|
|
The @balancesheetequity@ command prints a simple balance sheet.
|
|
|
|
-}
|
|
|
|
module Hledger.Cli.Commands.Balancesheetequity (
|
|
balancesheetequitymode
|
|
,balancesheetequity
|
|
) where
|
|
|
|
import System.Console.CmdArgs.Explicit
|
|
|
|
import Hledger
|
|
import Hledger.Cli.CliOptions
|
|
import Hledger.Cli.CompoundBalanceCommand
|
|
|
|
balancesheetequitySpec = CompoundBalanceCommandSpec {
|
|
cbcdoc = $(embedFileRelative "Hledger/Cli/Commands/Balancesheetequity.txt"),
|
|
cbctitle = "Balance Sheet With Equity",
|
|
cbcqueries = [
|
|
CBCSubreportSpec{
|
|
cbcsubreporttitle="Assets"
|
|
,cbcsubreportquery=journalAssetAccountQuery
|
|
,cbcsubreportnormalsign=NormallyPositive
|
|
,cbcsubreportincreasestotal=True
|
|
}
|
|
,CBCSubreportSpec{
|
|
cbcsubreporttitle="Liabilities"
|
|
,cbcsubreportquery=journalLiabilityAccountQuery
|
|
,cbcsubreportnormalsign=NormallyNegative
|
|
,cbcsubreportincreasestotal=False
|
|
}
|
|
,CBCSubreportSpec{
|
|
cbcsubreporttitle="Equity"
|
|
,cbcsubreportquery=journalEquityAccountQuery
|
|
,cbcsubreportnormalsign=NormallyNegative
|
|
,cbcsubreportincreasestotal=False
|
|
}
|
|
],
|
|
cbctype = HistoricalBalance
|
|
}
|
|
|
|
balancesheetequitymode :: Mode RawOpts
|
|
balancesheetequitymode = compoundBalanceCommandMode balancesheetequitySpec
|
|
|
|
balancesheetequity :: CliOpts -> Journal -> IO ()
|
|
balancesheetequity = compoundBalanceCommand balancesheetequitySpec
|