Safe Haskell | None |
---|---|
Language | Haskell2010 |
Hledger.Reports.ReportOptions
Description
Options common to most hledger reports.
Synopsis
- data ReportOpts = ReportOpts {
- period_ :: Period
- interval_ :: Interval
- statuses_ :: [Status]
- cost_ :: Bool
- depth_ :: Maybe Int
- display_ :: Maybe DisplayExp
- date2_ :: Bool
- empty_ :: Bool
- no_elide_ :: Bool
- real_ :: Bool
- format_ :: Maybe FormatStr
- query_ :: String
- average_ :: Bool
- related_ :: Bool
- balancetype_ :: BalanceType
- accountlistmode_ :: AccountListMode
- drop_ :: Int
- row_total_ :: Bool
- no_total_ :: Bool
- value_ :: Bool
- pretty_tables_ :: Bool
- sort_amount_ :: Bool
- normalbalance_ :: Maybe NormalBalance
- color_ :: Bool
- forecast_ :: Bool
- auto_ :: Bool
- data BalanceType
- data AccountListMode
- type FormatStr = String
- defreportopts :: ReportOpts
- rawOptsToReportOpts :: RawOpts -> IO ReportOpts
- checkReportOpts :: ReportOpts -> ReportOpts
- flat_ :: ReportOpts -> Bool
- tree_ :: ReportOpts -> Bool
- reportOptsToggleStatus :: Status -> ReportOpts -> ReportOpts
- simplifyStatuses :: Ord a => [a] -> [a]
- whichDateFromOpts :: ReportOpts -> WhichDate
- journalSelectingAmountFromOpts :: ReportOpts -> Journal -> Journal
- queryFromOpts :: Day -> ReportOpts -> Query
- queryFromOptsOnly :: Day -> ReportOpts -> Query
- queryOptsFromOpts :: Day -> ReportOpts -> [QueryOpt]
- transactionDateFn :: ReportOpts -> Transaction -> Day
- postingDateFn :: ReportOpts -> Posting -> Day
- reportStartEndDates :: Journal -> ReportOpts -> IO (Maybe (Day, Day))
- reportStartDate :: Journal -> ReportOpts -> IO (Maybe Day)
- reportEndDate :: Journal -> ReportOpts -> IO (Maybe Day)
- specifiedStartEndDates :: ReportOpts -> IO (Maybe Day, Maybe Day)
- specifiedStartDate :: ReportOpts -> IO (Maybe Day)
- specifiedEndDate :: ReportOpts -> IO (Maybe Day)
- tests_Hledger_Reports_ReportOptions :: Test
Documentation
data ReportOpts Source #
Standard options for customising report filtering and output. Most of these correspond to standard hledger command-line options or query arguments, but not all. Some are used only by certain commands, as noted below.
Constructors
ReportOpts | |
Fields
|
Instances
Data ReportOpts Source # | |
Defined in Hledger.Reports.ReportOptions Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ReportOpts -> c ReportOpts # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ReportOpts # toConstr :: ReportOpts -> Constr # dataTypeOf :: ReportOpts -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ReportOpts) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ReportOpts) # gmapT :: (forall b. Data b => b -> b) -> ReportOpts -> ReportOpts # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ReportOpts -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ReportOpts -> r # gmapQ :: (forall d. Data d => d -> u) -> ReportOpts -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ReportOpts -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ReportOpts -> m ReportOpts # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ReportOpts -> m ReportOpts # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ReportOpts -> m ReportOpts # | |
Show ReportOpts Source # | |
Defined in Hledger.Reports.ReportOptions Methods showsPrec :: Int -> ReportOpts -> ShowS # show :: ReportOpts -> String # showList :: [ReportOpts] -> ShowS # | |
Default ReportOpts Source # | |
Defined in Hledger.Reports.ReportOptions Methods def :: ReportOpts # |
data BalanceType Source #
Which "balance" is being shown in a balance report.
Constructors
PeriodChange | The change of balance in each period. |
CumulativeChange | The accumulated change across multiple periods. |
HistoricalBalance | The historical ending balance, including the effect of all postings before the report period. Unless altered by, a query, this is what you would see on a bank statement. |
Instances
Eq BalanceType Source # | |
Defined in Hledger.Reports.ReportOptions | |
Data BalanceType Source # | |
Defined in Hledger.Reports.ReportOptions Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BalanceType -> c BalanceType # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BalanceType # toConstr :: BalanceType -> Constr # dataTypeOf :: BalanceType -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BalanceType) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BalanceType) # gmapT :: (forall b. Data b => b -> b) -> BalanceType -> BalanceType # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BalanceType -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BalanceType -> r # gmapQ :: (forall d. Data d => d -> u) -> BalanceType -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> BalanceType -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BalanceType -> m BalanceType # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BalanceType -> m BalanceType # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BalanceType -> m BalanceType # | |
Show BalanceType Source # | |
Defined in Hledger.Reports.ReportOptions Methods showsPrec :: Int -> BalanceType -> ShowS # show :: BalanceType -> String # showList :: [BalanceType] -> ShowS # | |
Default BalanceType Source # | |
Defined in Hledger.Reports.ReportOptions Methods def :: BalanceType # |
data AccountListMode Source #
Should accounts be displayed: in the command's default style, hierarchically, or as a flat list ?
Instances
checkReportOpts :: ReportOpts -> ReportOpts Source #
Do extra validation of report options, raising an error if there's a problem.
flat_ :: ReportOpts -> Bool Source #
tree_ :: ReportOpts -> Bool Source #
Legacy-compatible convenience aliases for accountlistmode_.
reportOptsToggleStatus :: Status -> ReportOpts -> ReportOpts Source #
Add/remove this status from the status list. Used by hledger-ui.
simplifyStatuses :: Ord a => [a] -> [a] Source #
Reduce a list of statuses to just one of each status, and if all statuses are present return the empty list.
whichDateFromOpts :: ReportOpts -> WhichDate Source #
Report which date we will report on based on --date2.
journalSelectingAmountFromOpts :: ReportOpts -> Journal -> Journal Source #
Convert this journal's postings' amounts to the cost basis amounts if specified by options.
queryFromOpts :: Day -> ReportOpts -> Query Source #
Convert report options and arguments to a query.
queryFromOptsOnly :: Day -> ReportOpts -> Query Source #
Convert report options to a query, ignoring any non-flag command line arguments.
queryOptsFromOpts :: Day -> ReportOpts -> [QueryOpt] Source #
Convert report options and arguments to query options.
transactionDateFn :: ReportOpts -> Transaction -> Day Source #
Select the Transaction date accessor based on --date2.
postingDateFn :: ReportOpts -> Posting -> Day Source #
Select the Posting date accessor based on --date2.
reportStartEndDates :: Journal -> ReportOpts -> IO (Maybe (Day, Day)) Source #
The effective report start/end dates are the dates specified by options or queries, otherwise the earliest/latest transaction or posting date in the journal, otherwise (for an empty journal) nothing. Needs IO to parse smart dates in options/queries.
reportStartDate :: Journal -> ReportOpts -> IO (Maybe Day) Source #
reportEndDate :: Journal -> ReportOpts -> IO (Maybe Day) Source #
specifiedStartEndDates :: ReportOpts -> IO (Maybe Day, Maybe Day) Source #
The specified report start/end dates are the dates specified by options or queries, if any. Needs IO to parse smart dates in options/queries.
specifiedStartDate :: ReportOpts -> IO (Maybe Day) Source #
specifiedEndDate :: ReportOpts -> IO (Maybe Day) Source #