    {-# 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
    balancesheetequitySpec = CompoundBalanceCommandSpec :: CommandDoc
    -> CommandDoc
    -> [CBCSubreportSpec]
    -> BalanceType
    -> CompoundBalanceCommandSpec
    CompoundBalanceCommandSpec {
      cbcdoc :: CommandDoc
    cbcdoc      = $(embedFileRelative "Hledger/Cli/Commands/Balancesheetequity.txt"),
      cbctitle :: CommandDoc
    cbctitle    = "Balance Sheet With Equity",
      cbcqueries :: [CBCSubreportSpec]
    cbcqueries  = [
         CBCSubreportSpec :: CommandDoc
    -> (Journal -> Query) -> NormalSign -> Bool -> CBCSubreportSpec
    CBCSubreportSpec{
          cbcsubreporttitle :: CommandDoc
    cbcsubreporttitle="Assets"
         ,cbcsubreportquery :: Journal -> Query
    cbcsubreportquery=Journal -> Query
    journalAssetAccountQuery
         ,cbcsubreportnormalsign :: NormalSign
    cbcsubreportnormalsign=NormalSign
    NormallyPositive
         ,cbcsubreportincreasestotal :: Bool
    cbcsubreportincreasestotal=Bool
    True
         }
        ,CBCSubreportSpec :: CommandDoc
    -> (Journal -> Query) -> NormalSign -> Bool -> CBCSubreportSpec
    CBCSubreportSpec{
          cbcsubreporttitle :: CommandDoc
    cbcsubreporttitle="Liabilities"
         ,cbcsubreportquery :: Journal -> Query
    cbcsubreportquery=Journal -> Query
    journalLiabilityAccountQuery
         ,cbcsubreportnormalsign :: NormalSign
    cbcsubreportnormalsign=NormalSign
    NormallyNegative
         ,cbcsubreportincreasestotal :: Bool
    cbcsubreportincreasestotal=Bool
    False
         }
        ,CBCSubreportSpec :: CommandDoc
    -> (Journal -> Query) -> NormalSign -> Bool -> CBCSubreportSpec
    CBCSubreportSpec{
          cbcsubreporttitle :: CommandDoc
    cbcsubreporttitle="Equity"
         ,cbcsubreportquery :: Journal -> Query
    cbcsubreportquery=Journal -> Query
    journalEquityAccountQuery
         ,cbcsubreportnormalsign :: NormalSign
    cbcsubreportnormalsign=NormalSign
    NormallyNegative
         ,cbcsubreportincreasestotal :: Bool
    cbcsubreportincreasestotal=Bool
    False
         }
        ],
      cbctype :: BalanceType
    cbctype     = BalanceType
    HistoricalBalance
    }

    balancesheetequitymode :: Mode RawOpts
    balancesheetequitymode :: Mode RawOpts
    balancesheetequitymode = CompoundBalanceCommandSpec -> Mode RawOpts
    compoundBalanceCommandMode CompoundBalanceCommandSpec
    balancesheetequitySpec

    balancesheetequity :: CliOpts -> Journal -> IO ()
    balancesheetequity :: CliOpts -> Journal -> IO ()
    balancesheetequity = CompoundBalanceCommandSpec -> CliOpts -> Journal -> IO ()
    compoundBalanceCommand CompoundBalanceCommandSpec
    balancesheetequitySpec