hledger-lib-1.26.1: A reusable library providing the core functionality of hledger
Safe HaskellNone
LanguageHaskell2010

Hledger.Read.InputOptions

Description

Various options to use when reading journal files. Similar to CliOptions.inputflags, simplifies the journal-reading functions.

Synopsis

Types and helpers for input options

data InputOpts Source #

Constructors

InputOpts 

Fields

  • mformat_ :: Maybe StorageFormat

    a file/storage format to try, unless overridden by a filename prefix. Nothing means try all.

  • mrules_file_ :: Maybe FilePath

    a conversion rules file to use (when reading CSV)

  • aliases_ :: [String]

    account name aliases to apply

  • anon_ :: Bool

    do light anonymisation/obfuscation of the data

  • new_ :: Bool

    read only new transactions since this file was last read

  • new_save_ :: Bool

    save latest new transactions state for next time

  • pivot_ :: String

    use the given field's value as the account name

  • forecast_ :: Maybe DateSpan

    span in which to generate forecast transactions

  • reportspan_ :: DateSpan

    a dirty hack keeping the query dates in InputOpts. This rightfully lives in ReportSpec, but is duplicated here.

  • auto_ :: Bool

    generate automatic postings when journal is parsed

  • infer_equity_ :: Bool

    generate automatic equity postings from transaction prices

  • balancingopts_ :: BalancingOpts

    options for balancing transactions

  • strict_ :: Bool

    do extra error checking (eg, all posted accounts are declared, no prices are inferred)

  • _ioDay :: Day

    today's date, for use with forecast transactions XXX this duplicates _rsDay, and should eventually be removed when it's not needed anymore.

forecastPeriod :: InputOpts -> Journal -> Maybe DateSpan Source #

Get the Maybe the DateSpan to generate forecast options from. This begins on: - the start date supplied to the `--forecast` argument, if present - otherwise, the later of - the report start date if specified with -b-pdate: - the day after the latest normal (non-periodic) transaction in the journal, if any - otherwise today. It ends on: - the end date supplied to the `--forecast` argument, if present - otherwise the report end date if specified with -e-pdate: - otherwise 180 days (6 months) from today.