hledger-lib-1.19.1: A reusable library providing the core functionality of hledger

Safe Haskell | None
Language | Haskell2010

Hledger.Data.Types

Contents

- Orphan instances

Description

Most data types are defined here to avoid import cycles. Here is an overview of the hledger data model:

    Journal                  -- a journal is read from one or more data files. It contains..
     [Transaction]           -- journal transactions (aka entries), which have date, cleared status, code, description and..
      [Posting]              -- multiple account postings, which have account name and amount
     [MarketPrice]           -- historical market prices for commodities

    Ledger                   -- a ledger is derived from a journal, by applying a filter specification and doing some further processing. It contains..
     Journal                 -- a filtered copy of the original journal, containing only the transactions and postings we are interested in
     [Account]               -- all accounts, in tree order beginning with a "root" account", with their balances and sub/parent accounts

For more detailed documentation on each type, see the corresponding modules.

Synopsis

- data SmartDate
  - = SmartAssumeStart Year (Maybe (Month, Maybe MonthDay))
  - | SmartFromReference (Maybe Month) MonthDay
  - | SmartMonth Month
  - | SmartRelative SmartSequence SmartInterval
- data SmartSequence
  - = Last
  - | This
  - | Next
- data SmartInterval
  - = Day
  - | Week
  - | Month
  - | Quarter
  - | Year
- data WhichDate
  - = PrimaryDate
  - | SecondaryDate
- data DateSpan = DateSpan (Maybe Day) (Maybe Day)
- type Year = Integer
- type Month = Int
- type Quarter = Int
- type YearWeek = Int
- type MonthWeek = Int
- type YearDay = Int
- type MonthDay = Int
- type WeekDay = Int
- data Period
  - = DayPeriod Day
  - | WeekPeriod Day
  - | MonthPeriod Year Month
  - | QuarterPeriod Year Quarter
  - | YearPeriod Year
  - | PeriodBetween Day Day
  - | PeriodFrom Day
  - | PeriodTo Day
  - | PeriodAll
- data Interval
  - = NoInterval
  - | Days Int
  - | Weeks Int
  - | Months Int
  - | Quarters Int
  - | Years Int
  - | DayOfMonth Int
  - | WeekdayOfMonth Int Int
  - | DayOfWeek Int
  - | DayOfYear Int Int
- type AccountName = Text
- data AccountType
  - = Asset
  - | Liability
  - | Equity
  - | Revenue
  - | Expense
  - | Cash
- data AccountAlias
  - = BasicAlias AccountName AccountName
  - | RegexAlias Regexp Replacement
- data Side
  - = L
  - | R
- type Quantity = Decimal
- data AmountPrice
  - = UnitPrice Amount
  - | TotalPrice Amount
- data AmountStyle = AmountStyle {
  - ascommodityside :: Side
  - ascommodityspaced :: Bool
  - asprecision :: !AmountPrecision
  - asdecimalpoint :: Maybe Char
  - asdigitgroups :: Maybe DigitGroupStyle
  }
- data AmountPrecision
  - = Precision !Word8
  - | NaturalPrecision
- data DigitGroupStyle = DigitGroups Char [Word8]
- type CommoditySymbol = Text
- data Commodity = Commodity {
  - csymbol :: CommoditySymbol
  - cformat :: Maybe AmountStyle
  }
- data Amount = Amount {
  - acommodity :: CommoditySymbol
  - aquantity :: Quantity
  - aismultiplier :: Bool
  - astyle :: AmountStyle
  - aprice :: Maybe AmountPrice
  }
- newtype MixedAmount = Mixed [Amount]
- data PostingType
  - = RegularPosting
  - | VirtualPosting
  - | BalancedVirtualPosting
- type TagName = Text
- type TagValue = Text
- type Tag = (TagName, TagValue)
- type DateTag = (TagName, Day)
- data Status
  - = Unmarked
  - | Pending
  - | Cleared
- data BalanceAssertion = BalanceAssertion {
  - baamount :: Amount
  - batotal :: Bool
  - bainclusive :: Bool
  - baposition :: GenericSourcePos
  }
- data Posting = Posting {
  - pdate :: Maybe Day
  - pdate2 :: Maybe Day
  - pstatus :: Status
  - paccount :: AccountName
  - pamount :: MixedAmount
  - pcomment :: Text
  - ptype :: PostingType
  - ptags :: [Tag]
  - pbalanceassertion :: Maybe BalanceAssertion
  - ptransaction :: Maybe Transaction
  - poriginal :: Maybe Posting
  }
- data GenericSourcePos
  - = GenericSourcePos FilePath Int Int
  - | JournalSourcePos FilePath (Int, Int)
- data Transaction = Transaction {
  - tindex :: Integer
  - tprecedingcomment :: Text
  - tsourcepos :: GenericSourcePos
  - tdate :: Day
  - tdate2 :: Maybe Day
  - tstatus :: Status
  - tcode :: Text
  - tdescription :: Text
  - tcomment :: Text
  - ttags :: [Tag]
  - tpostings :: [Posting]
  }
- data TransactionModifier = TransactionModifier {
  - tmquerytxt :: Text
  - tmpostingrules :: [TMPostingRule]
  }
- nulltransactionmodifier :: TransactionModifier
- type TMPostingRule = Posting
- data PeriodicTransaction = PeriodicTransaction {
  - ptperiodexpr :: Text
  - ptinterval :: Interval
  - ptspan :: DateSpan
  - ptstatus :: Status
  - ptcode :: Text
  - ptdescription :: Text
  - ptcomment :: Text
  - pttags :: [Tag]
  - ptpostings :: [Posting]
  }
- nullperiodictransaction :: PeriodicTransaction
- data TimeclockCode
  - = SetBalance
  - | SetRequiredHours
  - | In
  - | Out
  - | FinalOut
- data TimeclockEntry = TimeclockEntry {
  - tlsourcepos :: GenericSourcePos
  - tlcode :: TimeclockCode
  - tldatetime :: LocalTime
  - tlaccount :: AccountName
  - tldescription :: Text
  }
- data PriceDirective = PriceDirective {
  - pddate :: Day
  - pdcommodity :: CommoditySymbol
  - pdamount :: Amount
  }
- data MarketPrice = MarketPrice {
  - mpdate :: Day
  - mpfrom :: CommoditySymbol
  - mpto :: CommoditySymbol
  - mprate :: Quantity
  }
- data Journal = Journal {
  - jparsedefaultyear :: Maybe Year
  - jparsedefaultcommodity :: Maybe (CommoditySymbol, AmountStyle)
  - jparseparentaccounts :: [AccountName]
  - jparsealiases :: [AccountAlias]
  - jparsetimeclockentries :: [TimeclockEntry]
  - jincludefilestack :: [FilePath]
  - jdeclaredaccounts :: [(AccountName, AccountDeclarationInfo)]
  - jdeclaredaccounttypes :: Map AccountType [AccountName]
  - jcommodities :: Map CommoditySymbol Commodity
  - jinferredcommodities :: Map CommoditySymbol AmountStyle
  - jpricedirectives :: [PriceDirective]
  - jinferredmarketprices :: [MarketPrice]
  - jtxnmodifiers :: [TransactionModifier]
  - jperiodictxns :: [PeriodicTransaction]
  - jtxns :: [Transaction]
  - jfinalcommentlines :: Text
  - jfiles :: [(FilePath, Text)]
  - jlastreadtime :: ClockTime
  }
- type ParsedJournal = Journal
- type StorageFormat = String
- data AccountDeclarationInfo = AccountDeclarationInfo {
  - adicomment :: Text
  - aditags :: [Tag]
  - adideclarationorder :: Int
  }
- nullaccountdeclarationinfo :: AccountDeclarationInfo
- data Account = Account {
  - aname :: AccountName
  - adeclarationinfo :: Maybe AccountDeclarationInfo
  - asubs :: [Account]
  - aparent :: Maybe Account
  - aboring :: Bool
  - anumpostings :: Int
  - aebalance :: MixedAmount
  - aibalance :: MixedAmount
  }
- data NormalSign
  - = NormallyPositive
  - | NormallyNegative
- data Ledger = Ledger {
  - ljournal :: Journal
  - laccounts :: [Account]
  }

# Documentation

data SmartDate Source #

A possibly incomplete year-month-day date provided by the user, to be interpreted as either a date or a date span depending on context. Missing parts "on the left" will be filled from the provided reference date, e.g. if the year and month are missing, the reference date's year and month are used. Missing parts "on the right" are assumed, when interpreting as a date, to be 1, (e.g. if the year and month are present but the day is missing, it means first day of that month); or when interpreting as a date span, to be a wildcard (so it would mean all days of that month). See the `smartdate` parser for more examples.

Or, one of the standard periods and an offset relative to the reference date: (last|this|next) (day|week|month|quarter|year), where "this" means the period containing the reference date.

Constructors

SmartAssumeStart Year (Maybe (Month, Maybe MonthDay)) |
SmartFromReference (Maybe Month) MonthDay |
SmartMonth Month |
SmartRelative SmartSequence SmartInterval |

#### Instances

Instances details

Show SmartDate Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> SmartDate -> ShowS Source # show :: SmartDate -> String Source # showList :: [SmartDate] -> ShowS Source #

data SmartSequence Source #

Constructors

Last |
This |
Next |

#### Instances

Instances details

Show SmartSequence Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> SmartSequence -> ShowS Source # show :: SmartSequence -> String Source # showList :: [SmartSequence] -> ShowS Source #

data SmartInterval Source #

Constructors

Day |
Week |
Month |
Quarter |
Year |

#### Instances

Instances details

Show SmartInterval Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> SmartInterval -> ShowS Source # show :: SmartInterval -> String Source # showList :: [SmartInterval] -> ShowS Source #

data WhichDate Source #

Constructors

PrimaryDate |
SecondaryDate |

#### Instances

Instances details

Eq WhichDate Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: WhichDate -> WhichDate -> Bool Source # (/=) :: WhichDate -> WhichDate -> Bool Source #
Show WhichDate Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> WhichDate -> ShowS Source # show :: WhichDate -> String Source # showList :: [WhichDate] -> ShowS Source #

data DateSpan Source #

Constructors

DateSpan (Maybe Day) (Maybe Day) |

#### Instances

Instances details

Eq DateSpan Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: DateSpan -> DateSpan -> Bool Source # (/=) :: DateSpan -> DateSpan -> Bool Source #
Ord DateSpan Source # |
Instance details Defined in Hledger.Data.Types Methods compare :: DateSpan -> DateSpan -> Ordering Source # (<) :: DateSpan -> DateSpan -> Bool Source # (<=) :: DateSpan -> DateSpan -> Bool Source # (>) :: DateSpan -> DateSpan -> Bool Source # (>=) :: DateSpan -> DateSpan -> Bool Source # max :: DateSpan -> DateSpan -> DateSpan Source # min :: DateSpan -> DateSpan -> DateSpan Source #
Show DateSpan Source # |
Instance details Defined in Hledger.Data.Dates Methods showsPrec :: Int -> DateSpan -> ShowS Source # show :: DateSpan -> String Source # showList :: [DateSpan] -> ShowS Source #
Generic DateSpan Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep DateSpan :: Type -> Type Source # Methods from :: DateSpan -> Rep DateSpan x Source # to :: Rep DateSpan x -> DateSpan Source #
ToJSON DateSpan Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: DateSpan -> Value Source # toEncoding :: DateSpan -> Encoding Source # toJSONList :: [DateSpan] -> Value Source # toEncodingList :: [DateSpan] -> Encoding Source #
Default DateSpan Source # |
Instance details Defined in Hledger.Data.Types Methods def :: DateSpan #
type Rep DateSpan Source # |

Instance details

Defined in Hledger.Data.Types

type Rep DateSpan = D1 ('MetaData "DateSpan" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "DateSpan" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Day)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Day))))

type Year = Integer Source #

type Month = Int Source #

type Quarter = Int Source #

type YearWeek = Int Source #

type MonthWeek = Int Source #

type YearDay = Int Source #

type MonthDay = Int Source #

type WeekDay = Int Source #

data Period Source #

Constructors

DayPeriod Day |
WeekPeriod Day |
MonthPeriod Year Month |
QuarterPeriod Year Quarter |
YearPeriod Year |
PeriodBetween Day Day |
PeriodFrom Day |
PeriodTo Day |
PeriodAll |

#### Instances

Instances details

Eq Period Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Period -> Period -> Bool Source # (/=) :: Period -> Period -> Bool Source #
Ord Period Source # |
Instance details Defined in Hledger.Data.Types Methods compare :: Period -> Period -> Ordering Source # (<) :: Period -> Period -> Bool Source # (<=) :: Period -> Period -> Bool Source # (>) :: Period -> Period -> Bool Source # (>=) :: Period -> Period -> Bool Source # max :: Period -> Period -> Period Source # min :: Period -> Period -> Period Source #
Show Period Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Period -> ShowS Source # show :: Period -> String Source # showList :: [Period] -> ShowS Source #
Generic Period Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Period :: Type -> Type Source # Methods from :: Period -> Rep Period x Source # to :: Rep Period x -> Period Source #
Default Period Source # |
Instance details Defined in Hledger.Data.Types Methods def :: Period #
type Rep Period Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Period = D1 ('MetaData "Period" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (((C1 ('MetaCons "DayPeriod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day)) :+: C1 ('MetaCons "WeekPeriod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day))) :+: (C1 ('MetaCons "MonthPeriod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Year) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Month)) :+: C1 ('MetaCons "QuarterPeriod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Year) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Quarter)))) :+: ((C1 ('MetaCons "YearPeriod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Year)) :+: C1 ('MetaCons "PeriodBetween" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day))) :+: (C1 ('MetaCons "PeriodFrom" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day)) :+: (C1 ('MetaCons "PeriodTo" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day)) :+: C1 ('MetaCons "PeriodAll" 'PrefixI 'False) (U1 :: Type -> Type)))))

data Interval Source #

Constructors

NoInterval |
Days Int |
Weeks Int |
Months Int |
Quarters Int |
Years Int |
DayOfMonth Int |
WeekdayOfMonth Int Int |
DayOfWeek Int |
DayOfYear Int Int |

#### Instances

Instances details

Eq Interval Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Interval -> Interval -> Bool Source # (/=) :: Interval -> Interval -> Bool Source #
Ord Interval Source # |
Instance details Defined in Hledger.Data.Types Methods compare :: Interval -> Interval -> Ordering Source # (<) :: Interval -> Interval -> Bool Source # (<=) :: Interval -> Interval -> Bool Source # (>) :: Interval -> Interval -> Bool Source # (>=) :: Interval -> Interval -> Bool Source # max :: Interval -> Interval -> Interval Source # min :: Interval -> Interval -> Interval Source #
Show Interval Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Interval -> ShowS Source # show :: Interval -> String Source # showList :: [Interval] -> ShowS Source #
Generic Interval Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Interval :: Type -> Type Source # Methods from :: Interval -> Rep Interval x Source # to :: Rep Interval x -> Interval Source #
ToJSON Interval Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Interval -> Value Source # toEncoding :: Interval -> Encoding Source # toJSONList :: [Interval] -> Value Source # toEncodingList :: [Interval] -> Encoding Source #
Default Interval Source # |
Instance details Defined in Hledger.Data.Types Methods def :: Interval #
type Rep Interval Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Interval = D1 ('MetaData "Interval" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (((C1 ('MetaCons "NoInterval" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Days" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :+: (C1 ('MetaCons "Weeks" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: (C1 ('MetaCons "Months" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "Quarters" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))) :+: ((C1 ('MetaCons "Years" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "DayOfMonth" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :+: (C1 ('MetaCons "WeekdayOfMonth" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: (C1 ('MetaCons "DayOfWeek" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "DayOfYear" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))))

type AccountName = Text Source #

data AccountType Source #

Constructors

Asset |
Liability |
Equity |
Revenue |
Expense |
Cash | a subtype of Asset - liquid assets to show in cashflow report

#### Instances

Instances details

Eq AccountType Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: AccountType -> AccountType -> Bool Source # (/=) :: AccountType -> AccountType -> Bool Source #
Ord AccountType Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AccountType -> AccountType -> Ordering Source #

(<) :: AccountType -> AccountType -> Bool Source #

(<=) :: AccountType -> AccountType -> Bool Source #

(>) :: AccountType -> AccountType -> Bool Source #

(>=) :: AccountType -> AccountType -> Bool Source #

max :: AccountType -> AccountType -> AccountType Source #

min :: AccountType -> AccountType -> AccountType Source #

Show AccountType Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AccountType -> ShowS Source # show :: AccountType -> String Source # showList :: [AccountType] -> ShowS Source #
Generic AccountType Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep AccountType :: Type -> Type Source # Methods from :: AccountType -> Rep AccountType x Source # to :: Rep AccountType x -> AccountType Source #
ToJSON AccountType Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: AccountType -> Value Source # toEncoding :: AccountType -> Encoding Source # toJSONList :: [AccountType] -> Value Source # toEncodingList :: [AccountType] -> Encoding Source #
ToJSONKey AccountType Source # |
Instance details Defined in Hledger.Data.Json Methods toJSONKey :: ToJSONKeyFunction AccountType Source # toJSONKeyList :: ToJSONKeyFunction [AccountType] Source #
type Rep AccountType Source # |

Instance details

Defined in Hledger.Data.Types

type Rep AccountType = D1 ('MetaData "AccountType" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) ((C1 ('MetaCons "Asset" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Liability" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Equity" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Revenue" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Expense" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Cash" 'PrefixI 'False) (U1 :: Type -> Type))))

data AccountAlias Source #

Constructors

BasicAlias AccountName AccountName |
RegexAlias Regexp Replacement |

#### Instances

Instances details

Eq AccountAlias Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: AccountAlias -> AccountAlias -> Bool Source # (/=) :: AccountAlias -> AccountAlias -> Bool Source #
Ord AccountAlias Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AccountAlias -> AccountAlias -> Ordering Source #

(<) :: AccountAlias -> AccountAlias -> Bool Source #

(<=) :: AccountAlias -> AccountAlias -> Bool Source #

(>) :: AccountAlias -> AccountAlias -> Bool Source #

(>=) :: AccountAlias -> AccountAlias -> Bool Source #

max :: AccountAlias -> AccountAlias -> AccountAlias Source #

min :: AccountAlias -> AccountAlias -> AccountAlias Source #

Read AccountAlias Source # |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS AccountAlias Source # readList :: ReadS [AccountAlias] Source # readPrec :: ReadPrec AccountAlias Source # readListPrec :: ReadPrec [AccountAlias] Source #
Show AccountAlias Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AccountAlias -> ShowS Source # show :: AccountAlias -> String Source # showList :: [AccountAlias] -> ShowS Source #
Generic AccountAlias Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep AccountAlias :: Type -> Type Source # Methods from :: AccountAlias -> Rep AccountAlias x Source # to :: Rep AccountAlias x -> AccountAlias Source #
ToJSON AccountAlias Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: AccountAlias -> Value Source # toEncoding :: AccountAlias -> Encoding Source # toJSONList :: [AccountAlias] -> Value Source # toEncodingList :: [AccountAlias] -> Encoding Source #
type Rep AccountAlias Source # |

Instance details

Defined in Hledger.Data.Types

type Rep AccountAlias = D1 ('MetaData "AccountAlias" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "BasicAlias" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AccountName) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AccountName)) :+: C1 ('MetaCons "RegexAlias" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Regexp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Replacement)))

data Side Source #

Constructors

L |
R |

#### Instances

Instances details

Eq Side Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Side -> Side -> Bool Source # (/=) :: Side -> Side -> Bool Source #
Ord Side Source # |
Instance details Defined in Hledger.Data.Types Methods compare :: Side -> Side -> Ordering Source # (<) :: Side -> Side -> Bool Source # (<=) :: Side -> Side -> Bool Source # (>) :: Side -> Side -> Bool Source # (>=) :: Side -> Side -> Bool Source # max :: Side -> Side -> Side Source # min :: Side -> Side -> Side Source #
Read Side Source # |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS Side Source # readList :: ReadS [Side] Source # readPrec :: ReadPrec Side Source # readListPrec :: ReadPrec [Side] Source #
Show Side Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Side -> ShowS Source # show :: Side -> String Source # showList :: [Side] -> ShowS Source #
Generic Side Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Side :: Type -> Type Source # Methods from :: Side -> Rep Side x Source # to :: Rep Side x -> Side Source #
ToJSON Side Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Side -> Value Source # toEncoding :: Side -> Encoding Source # toJSONList :: [Side] -> Value Source # toEncodingList :: [Side] -> Encoding Source #
FromJSON Side Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser Side Source # parseJSONList :: Value -> Parser [Side] Source #
type Rep Side Source # |
Instance details Defined in Hledger.Data.Types type Rep Side = D1 ('MetaData "Side" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "L" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "R" 'PrefixI 'False) (U1 :: Type -> Type))

type Quantity = Decimal Source #

The basic numeric type used in amounts.

data AmountPrice Source #

An amount's per-unit or total cost/selling price in another commodity, as recorded in the journal entry eg with `or` @. Docs call this "transaction price". The amount is always positive.

Constructors

UnitPrice Amount |
TotalPrice Amount |

#### Instances

Instances details

Eq AmountPrice Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: AmountPrice -> AmountPrice -> Bool Source # (/=) :: AmountPrice -> AmountPrice -> Bool Source #
Ord AmountPrice Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AmountPrice -> AmountPrice -> Ordering Source #

(<) :: AmountPrice -> AmountPrice -> Bool Source #

(<=) :: AmountPrice -> AmountPrice -> Bool Source #

(>) :: AmountPrice -> AmountPrice -> Bool Source #

(>=) :: AmountPrice -> AmountPrice -> Bool Source #

max :: AmountPrice -> AmountPrice -> AmountPrice Source #

min :: AmountPrice -> AmountPrice -> AmountPrice Source #

Show AmountPrice Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AmountPrice -> ShowS Source # show :: AmountPrice -> String Source # showList :: [AmountPrice] -> ShowS Source #
Generic AmountPrice Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep AmountPrice :: Type -> Type Source # Methods from :: AmountPrice -> Rep AmountPrice x Source # to :: Rep AmountPrice x -> AmountPrice Source #
ToJSON AmountPrice Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: AmountPrice -> Value Source # toEncoding :: AmountPrice -> Encoding Source # toJSONList :: [AmountPrice] -> Value Source # toEncodingList :: [AmountPrice] -> Encoding Source #
FromJSON AmountPrice Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser AmountPrice Source # parseJSONList :: Value -> Parser [AmountPrice] Source #
type Rep AmountPrice Source # |

Instance details

Defined in Hledger.Data.Types

type Rep AmountPrice = D1 ('MetaData "AmountPrice" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "UnitPrice" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Amount)) :+: C1 ('MetaCons "TotalPrice" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Amount)))

data AmountStyle Source #

Display style for an amount.

Constructors

AmountStyle |

Fields

- ascommodityside :: Side

  does the symbol appear on the left or the right ?

- ascommodityspaced :: Bool

  space between symbol and quantity ?

- asprecision :: !AmountPrecision

  number of digits displayed after the decimal point

- asdecimalpoint :: Maybe Char

  character used as decimal point: period or comma. Nothing means "unspecified, use default"

- asdigitgroups :: Maybe DigitGroupStyle

  style for displaying digit groups, if any

#### Instances

Instances details

Eq AmountStyle Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: AmountStyle -> AmountStyle -> Bool Source # (/=) :: AmountStyle -> AmountStyle -> Bool Source #
Ord AmountStyle Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AmountStyle -> AmountStyle -> Ordering Source #

(<) :: AmountStyle -> AmountStyle -> Bool Source #

(<=) :: AmountStyle -> AmountStyle -> Bool Source #

(>) :: AmountStyle -> AmountStyle -> Bool Source #

(>=) :: AmountStyle -> AmountStyle -> Bool Source #

max :: AmountStyle -> AmountStyle -> AmountStyle Source #

min :: AmountStyle -> AmountStyle -> AmountStyle Source #

Read AmountStyle Source # |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS AmountStyle Source # readList :: ReadS [AmountStyle] Source # readPrec :: ReadPrec AmountStyle Source # readListPrec :: ReadPrec [AmountStyle] Source #
Show AmountStyle Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AmountStyle -> ShowS Source # show :: AmountStyle -> String Source # showList :: [AmountStyle] -> ShowS Source #
Generic AmountStyle Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep AmountStyle :: Type -> Type Source # Methods from :: AmountStyle -> Rep AmountStyle x Source # to :: Rep AmountStyle x -> AmountStyle Source #
ToJSON AmountStyle Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: AmountStyle -> Value Source # toEncoding :: AmountStyle -> Encoding Source # toJSONList :: [AmountStyle] -> Value Source # toEncodingList :: [AmountStyle] -> Encoding Source #
FromJSON AmountStyle Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser AmountStyle Source # parseJSONList :: Value -> Parser [AmountStyle] Source #
type Rep AmountStyle Source # |

Instance details

Defined in Hledger.Data.Types

type Rep AmountStyle = D1 ('MetaData "AmountStyle" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "AmountStyle" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ascommodityside") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Side) :*: S1 ('MetaSel ('Just "ascommodityspaced") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "asprecision") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AmountPrecision) :*: (S1 ('MetaSel ('Just "asdecimalpoint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Char)) :*: S1 ('MetaSel ('Just "asdigitgroups") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe DigitGroupStyle))))))

data AmountPrecision Source #

Constructors

Precision !Word8 |
NaturalPrecision |

#### Instances

Instances details

Eq AmountPrecision Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: AmountPrecision -> AmountPrecision -> Bool Source # (/=) :: AmountPrecision -> AmountPrecision -> Bool Source #
Ord AmountPrecision Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: AmountPrecision -> AmountPrecision -> Ordering Source #

(<) :: AmountPrecision -> AmountPrecision -> Bool Source #

(<=) :: AmountPrecision -> AmountPrecision -> Bool Source #

(>) :: AmountPrecision -> AmountPrecision -> Bool Source #

(>=) :: AmountPrecision -> AmountPrecision -> Bool Source #

max :: AmountPrecision -> AmountPrecision -> AmountPrecision Source #

min :: AmountPrecision -> AmountPrecision -> AmountPrecision Source #

Read AmountPrecision Source # |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS AmountPrecision Source # readList :: ReadS [AmountPrecision] Source # readPrec :: ReadPrec AmountPrecision Source # readListPrec :: ReadPrec [AmountPrecision] Source #
Show AmountPrecision Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AmountPrecision -> ShowS Source # show :: AmountPrecision -> String Source # showList :: [AmountPrecision] -> ShowS Source #
Generic AmountPrecision Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep AmountPrecision :: Type -> Type Source # Methods from :: AmountPrecision -> Rep AmountPrecision x Source # to :: Rep AmountPrecision x -> AmountPrecision Source #
ToJSON AmountPrecision Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: AmountPrecision -> Value Source # toEncoding :: AmountPrecision -> Encoding Source # toJSONList :: [AmountPrecision] -> Value Source # toEncodingList :: [AmountPrecision] -> Encoding Source #
FromJSON AmountPrecision Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser AmountPrecision Source # parseJSONList :: Value -> Parser [AmountPrecision] Source #
type Rep AmountPrecision Source # |

Instance details

Defined in Hledger.Data.Types

type Rep AmountPrecision = D1 ('MetaData "AmountPrecision" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "Precision" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word8)) :+: C1 ('MetaCons "NaturalPrecision" 'PrefixI 'False) (U1 :: Type -> Type))

data DigitGroupStyle Source #

A style for displaying digit groups in the integer part of a floating point number. It consists of the character used to separate groups (comma or period, whichever is not used as decimal point), and the size of each group, starting with the one nearest the decimal point. The last group size is assumed to repeat. Eg, comma between thousands is DigitGroups ',' [3].

Constructors

DigitGroups Char [Word8] |

#### Instances

Instances details

Eq DigitGroupStyle Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source # (/=) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #
Ord DigitGroupStyle Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: DigitGroupStyle -> DigitGroupStyle -> Ordering Source #

(<) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #

(<=) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #

(>) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #

(>=) :: DigitGroupStyle -> DigitGroupStyle -> Bool Source #

max :: DigitGroupStyle -> DigitGroupStyle -> DigitGroupStyle Source #

min :: DigitGroupStyle -> DigitGroupStyle -> DigitGroupStyle Source #

Read DigitGroupStyle Source # |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS DigitGroupStyle Source # readList :: ReadS [DigitGroupStyle] Source # readPrec :: ReadPrec DigitGroupStyle Source # readListPrec :: ReadPrec [DigitGroupStyle] Source #
Show DigitGroupStyle Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> DigitGroupStyle -> ShowS Source # show :: DigitGroupStyle -> String Source # showList :: [DigitGroupStyle] -> ShowS Source #
Generic DigitGroupStyle Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep DigitGroupStyle :: Type -> Type Source # Methods from :: DigitGroupStyle -> Rep DigitGroupStyle x Source # to :: Rep DigitGroupStyle x -> DigitGroupStyle Source #
ToJSON DigitGroupStyle Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: DigitGroupStyle -> Value Source # toEncoding :: DigitGroupStyle -> Encoding Source # toJSONList :: [DigitGroupStyle] -> Value Source # toEncodingList :: [DigitGroupStyle] -> Encoding Source #
FromJSON DigitGroupStyle Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser DigitGroupStyle Source # parseJSONList :: Value -> Parser [DigitGroupStyle] Source #
type Rep DigitGroupStyle Source # |

Instance details

Defined in Hledger.Data.Types

type Rep DigitGroupStyle = D1 ('MetaData "DigitGroupStyle" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "DigitGroups" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Char) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Word8])))

type CommoditySymbol = Text Source #

data Commodity Source #

Constructors

Commodity |

Fields

- csymbol :: CommoditySymbol
- cformat :: Maybe AmountStyle

#### Instances

Instances details

Eq Commodity Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Commodity -> Commodity -> Bool Source # (/=) :: Commodity -> Commodity -> Bool Source #
Show Commodity Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Commodity -> ShowS Source # show :: Commodity -> String Source # showList :: [Commodity] -> ShowS Source #
Generic Commodity Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Commodity :: Type -> Type Source # Methods from :: Commodity -> Rep Commodity x Source # to :: Rep Commodity x -> Commodity Source #
ToJSON Commodity Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Commodity -> Value Source # toEncoding :: Commodity -> Encoding Source # toJSONList :: [Commodity] -> Value Source # toEncodingList :: [Commodity] -> Encoding Source #
type Rep Commodity Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Commodity = D1 ('MetaData "Commodity" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "Commodity" 'PrefixI 'True) (S1 ('MetaSel ('Just "csymbol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Just "cformat") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe AmountStyle))))

data Amount Source #

Constructors

Amount |

Fields

- acommodity :: CommoditySymbol
- aquantity :: Quantity
- aismultiplier :: Bool

  kludge: a flag marking this amount and posting as a multiplier in a TMPostingRule. In a regular Posting, should always be false.

- astyle :: AmountStyle
- aprice :: Maybe AmountPrice

  the (fixed, transaction-specific) price for this amount, if any

#### Instances

Instances details

Eq Amount Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Amount -> Amount -> Bool Source # (/=) :: Amount -> Amount -> Bool Source #
Num Amount Source # |
Instance details Defined in Hledger.Data.Amount Methods (+) :: Amount -> Amount -> Amount Source # (-) :: Amount -> Amount -> Amount Source # (*) :: Amount -> Amount -> Amount Source # negate :: Amount -> Amount Source # abs :: Amount -> Amount Source # signum :: Amount -> Amount Source # fromInteger :: Integer -> Amount Source #
Ord Amount Source # |
Instance details Defined in Hledger.Data.Types Methods compare :: Amount -> Amount -> Ordering Source # (<) :: Amount -> Amount -> Bool Source # (<=) :: Amount -> Amount -> Bool Source # (>) :: Amount -> Amount -> Bool Source # (>=) :: Amount -> Amount -> Bool Source # max :: Amount -> Amount -> Amount Source # min :: Amount -> Amount -> Amount Source #
Show Amount Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Amount -> ShowS Source # show :: Amount -> String Source # showList :: [Amount] -> ShowS Source #
Generic Amount Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Amount :: Type -> Type Source # Methods from :: Amount -> Rep Amount x Source # to :: Rep Amount x -> Amount Source #
ToJSON Amount Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Amount -> Value Source # toEncoding :: Amount -> Encoding Source # toJSONList :: [Amount] -> Value Source # toEncodingList :: [Amount] -> Encoding Source #
FromJSON Amount Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser Amount Source # parseJSONList :: Value -> Parser [Amount] Source #
type Rep Amount Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Amount = D1 ('MetaData "Amount" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "Amount" 'PrefixI 'True) ((S1 ('MetaSel ('Just "acommodity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Just "aquantity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Quantity)) :*: (S1 ('MetaSel ('Just "aismultiplier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "astyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AmountStyle) :*: S1 ('MetaSel ('Just "aprice") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe AmountPrice))))))

newtype MixedAmount Source #

Constructors

Mixed [Amount] |

#### Instances

Instances details

Eq MixedAmount Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: MixedAmount -> MixedAmount -> Bool Source # (/=) :: MixedAmount -> MixedAmount -> Bool Source #
Num MixedAmount Source # |

Instance details

Defined in Hledger.Data.Amount

Methods

(+) :: MixedAmount -> MixedAmount -> MixedAmount Source #

(-) :: MixedAmount -> MixedAmount -> MixedAmount Source #

(*) :: MixedAmount -> MixedAmount -> MixedAmount Source #

negate :: MixedAmount -> MixedAmount Source #

abs :: MixedAmount -> MixedAmount Source #

signum :: MixedAmount -> MixedAmount Source #

fromInteger :: Integer -> MixedAmount Source #

Ord MixedAmount Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: MixedAmount -> MixedAmount -> Ordering Source #

(<) :: MixedAmount -> MixedAmount -> Bool Source #

(<=) :: MixedAmount -> MixedAmount -> Bool Source #

(>) :: MixedAmount -> MixedAmount -> Bool Source #

(>=) :: MixedAmount -> MixedAmount -> Bool Source #

max :: MixedAmount -> MixedAmount -> MixedAmount Source #

min :: MixedAmount -> MixedAmount -> MixedAmount Source #

Show MixedAmount Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> MixedAmount -> ShowS Source # show :: MixedAmount -> String Source # showList :: [MixedAmount] -> ShowS Source #
Generic MixedAmount Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep MixedAmount :: Type -> Type Source # Methods from :: MixedAmount -> Rep MixedAmount x Source # to :: Rep MixedAmount x -> MixedAmount Source #
ToJSON MixedAmount Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: MixedAmount -> Value Source # toEncoding :: MixedAmount -> Encoding Source # toJSONList :: [MixedAmount] -> Value Source # toEncodingList :: [MixedAmount] -> Encoding Source #
FromJSON MixedAmount Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser MixedAmount Source # parseJSONList :: Value -> Parser [MixedAmount] Source #
type Rep MixedAmount Source # |
Instance details Defined in Hledger.Data.Types type Rep MixedAmount = D1 ('MetaData "MixedAmount" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'True) (C1 ('MetaCons "Mixed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Amount])))

data PostingType Source #

Constructors

RegularPosting |
VirtualPosting |
BalancedVirtualPosting |

#### Instances

Instances details

Eq PostingType Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: PostingType -> PostingType -> Bool Source # (/=) :: PostingType -> PostingType -> Bool Source #
Show PostingType Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> PostingType -> ShowS Source # show :: PostingType -> String Source # showList :: [PostingType] -> ShowS Source #
Generic PostingType Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep PostingType :: Type -> Type Source # Methods from :: PostingType -> Rep PostingType x Source # to :: Rep PostingType x -> PostingType Source #
ToJSON PostingType Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: PostingType -> Value Source # toEncoding :: PostingType -> Encoding Source # toJSONList :: [PostingType] -> Value Source # toEncodingList :: [PostingType] -> Encoding Source #
FromJSON PostingType Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser PostingType Source # parseJSONList :: Value -> Parser [PostingType] Source #
type Rep PostingType Source # |
Instance details Defined in Hledger.Data.Types type Rep PostingType = D1 ('MetaData "PostingType" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "RegularPosting" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "VirtualPosting" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BalancedVirtualPosting" 'PrefixI 'False) (U1 :: Type -> Type)))

type TagName = Text Source #

type TagValue = Text Source #

type Tag Source #

Arguments

= (TagName, TagValue) | A tag name and (possibly empty) value.

type DateTag = (TagName, Day) Source #

data Status Source #

The status of a transaction or posting, recorded with a status mark (nothing, !, or *). What these mean is ultimately user defined.

Constructors

Unmarked |
Pending |
Cleared |

#### Instances

Instances details

Bounded Status Source # |
Instance details Defined in Hledger.Data.Types Methods minBound :: Status Source # maxBound :: Status Source #
Enum Status Source # |

Instance details

Defined in Hledger.Data.Types

Methods

succ :: Status -> Status Source #

pred :: Status -> Status Source #

toEnum :: Int -> Status Source #

fromEnum :: Status -> Int Source #

enumFrom :: Status -> [Status] Source #

enumFromThen :: Status -> Status -> [Status] Source #

enumFromTo :: Status -> Status -> [Status] Source #

enumFromThenTo :: Status -> Status -> Status -> [Status] Source #

Eq Status Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Status -> Status -> Bool Source # (/=) :: Status -> Status -> Bool Source #
Ord Status Source # |
Instance details Defined in Hledger.Data.Types Methods compare :: Status -> Status -> Ordering Source # (<) :: Status -> Status -> Bool Source # (<=) :: Status -> Status -> Bool Source # (>) :: Status -> Status -> Bool Source # (>=) :: Status -> Status -> Bool Source # max :: Status -> Status -> Status Source # min :: Status -> Status -> Status Source #
Show Status Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Status -> ShowS Source # show :: Status -> String Source # showList :: [Status] -> ShowS Source #
Generic Status Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Status :: Type -> Type Source # Methods from :: Status -> Rep Status x Source # to :: Rep Status x -> Status Source #
ToJSON Status Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Status -> Value Source # toEncoding :: Status -> Encoding Source # toJSONList :: [Status] -> Value Source # toEncodingList :: [Status] -> Encoding Source #
FromJSON Status Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser Status Source # parseJSONList :: Value -> Parser [Status] Source #
type Rep Status Source # |
Instance details Defined in Hledger.Data.Types type Rep Status = D1 ('MetaData "Status" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "Unmarked" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Pending" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Cleared" 'PrefixI 'False) (U1 :: Type -> Type)))

data BalanceAssertion Source #

A balance assertion is a declaration about an account's expected balance at a certain point (posting date and parse order). They provide additional error checking and readability to a journal file.

The `BalanceAssertion` type is also used to represent balance assignments, which instruct hledger what an account's balance should become at a certain point.

Different kinds of balance assertions are discussed eg on #290. Variables include:

- which postings are to be summed (realvirtual; unmarkedpendingcleared; this accountthis account including subs)
- which commodities within the balance are to be checked
- whether to do a partial or a total check (disallowing other commodities)

I suspect we want:

1. partial, subaccount-exclusive, Ledger-compatible assertions. Because they're what we've always had, and removing them would break some journals unnecessarily. Implemented with = syntax.
2. total assertions. Because otherwise assertions are a bit leaky. Implemented with == syntax.
3. subaccount-inclusive assertions. Because that's something folks need. Not implemented.
4. flexible assertions allowing custom criteria (perhaps arbitrary queries). Because power users have diverse needs and want to try out different schemes (assert cleared balances, assert balance from real or virtual postings, etc.). Not implemented.
5. multicommodity assertions, asserting the balance of multiple commodities at once. Not implemented, requires #934.

Constructors

BalanceAssertion |

Fields

- baamount :: Amount

  the expected balance in a particular commodity

- batotal :: Bool

  disallow additional non-asserted commodities ?

- bainclusive :: Bool

  include subaccounts when calculating the actual balance ?

- baposition :: GenericSourcePos

  the assertion's file position, for error reporting

#### Instances

Instances details

Eq BalanceAssertion Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: BalanceAssertion -> BalanceAssertion -> Bool Source # (/=) :: BalanceAssertion -> BalanceAssertion -> Bool Source #
Show BalanceAssertion Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> BalanceAssertion -> ShowS Source # show :: BalanceAssertion -> String Source # showList :: [BalanceAssertion] -> ShowS Source #
Generic BalanceAssertion Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep BalanceAssertion :: Type -> Type Source # Methods from :: BalanceAssertion -> Rep BalanceAssertion x Source # to :: Rep BalanceAssertion x -> BalanceAssertion Source #
ToJSON BalanceAssertion Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: BalanceAssertion -> Value Source # toEncoding :: BalanceAssertion -> Encoding Source # toJSONList :: [BalanceAssertion] -> Value Source # toEncodingList :: [BalanceAssertion] -> Encoding Source #
FromJSON BalanceAssertion Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser BalanceAssertion Source # parseJSONList :: Value -> Parser [BalanceAssertion] Source #
type Rep BalanceAssertion Source # |

Instance details

Defined in Hledger.Data.Types

type Rep BalanceAssertion = D1 ('MetaData "BalanceAssertion" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "BalanceAssertion" 'PrefixI 'True) ((S1 ('MetaSel ('Just "baamount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Amount) :*: S1 ('MetaSel ('Just "batotal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "bainclusive") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "baposition") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GenericSourcePos))))

data Posting Source #

Constructors

Posting |

Fields

- pdate :: Maybe Day

  this posting's date, if different from the transaction's

- pdate2 :: Maybe Day

  this posting's secondary date, if different from the transaction's

- pstatus :: Status
- paccount :: AccountName
- pamount :: MixedAmount
- pcomment :: Text

  this posting's comment lines, as a single non-indented multi-line string

- ptype :: PostingType
- ptags :: [Tag]

  tag names and values, extracted from the comment

- pbalanceassertion :: Maybe BalanceAssertion

  an expected balance in the account after this posting, in a single commodity, excluding subaccounts.

- ptransaction :: Maybe Transaction

  this posting's parent transaction (co-recursive types). Tying this knot gets tedious, Maybe makes it easier/optional.

- poriginal :: Maybe Posting

  When this posting has been transformed in some way (eg its amount or price was inferred, or the account name was changed by a pivot or budget report), this references the original untransformed posting (which will have Nothing in this field).

#### Instances

Instances details

Eq Posting Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Posting -> Posting -> Bool Source # (/=) :: Posting -> Posting -> Bool Source #
Show Posting Source # | Posting's show instance elides the parent transaction so as not to recurse forever.
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Posting -> ShowS Source # show :: Posting -> String Source # showList :: [Posting] -> ShowS Source #
Generic Posting Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Posting :: Type -> Type Source # Methods from :: Posting -> Rep Posting x Source # to :: Rep Posting x -> Posting Source #
ToJSON Posting Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Posting -> Value Source # toEncoding :: Posting -> Encoding Source # toJSONList :: [Posting] -> Value Source # toEncodingList :: [Posting] -> Encoding Source #
FromJSON Posting Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser Posting Source # parseJSONList :: Value -> Parser [Posting] Source #
type Rep Posting Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Posting = D1 ('MetaData "Posting" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "Posting" 'PrefixI 'True) (((S1 ('MetaSel ('Just "pdate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Day)) :*: S1 ('MetaSel ('Just "pdate2") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Day))) :*: (S1 ('MetaSel ('Just "pstatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Status) :*: (S1 ('MetaSel ('Just "paccount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AccountName) :*: S1 ('MetaSel ('Just "pamount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MixedAmount)))) :*: ((S1 ('MetaSel ('Just "pcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "ptype") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PostingType) :*: S1 ('MetaSel ('Just "ptags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Tag]))) :*: (S1 ('MetaSel ('Just "pbalanceassertion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe BalanceAssertion)) :*: (S1 ('MetaSel ('Just "ptransaction") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Transaction)) :*: S1 ('MetaSel ('Just "poriginal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Posting)))))))

data GenericSourcePos Source #

The position of parse errors (eg), like parsec's SourcePos but generic.

Constructors

GenericSourcePos FilePath Int Int | file path, 1-based line number and 1-based column number.
JournalSourcePos FilePath (Int, Int) | file path, inclusive range of 1-based line numbers (first, last).

#### Instances

Instances details

Eq GenericSourcePos Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: GenericSourcePos -> GenericSourcePos -> Bool Source # (/=) :: GenericSourcePos -> GenericSourcePos -> Bool Source #
Ord GenericSourcePos Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: GenericSourcePos -> GenericSourcePos -> Ordering Source #

(<) :: GenericSourcePos -> GenericSourcePos -> Bool Source #

(<=) :: GenericSourcePos -> GenericSourcePos -> Bool Source #

(>) :: GenericSourcePos -> GenericSourcePos -> Bool Source #

(>=) :: GenericSourcePos -> GenericSourcePos -> Bool Source #

max :: GenericSourcePos -> GenericSourcePos -> GenericSourcePos Source #

min :: GenericSourcePos -> GenericSourcePos -> GenericSourcePos Source #

Read GenericSourcePos Source # |
Instance details Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS GenericSourcePos Source # readList :: ReadS [GenericSourcePos] Source # readPrec :: ReadPrec GenericSourcePos Source # readListPrec :: ReadPrec [GenericSourcePos] Source #
Show GenericSourcePos Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> GenericSourcePos -> ShowS Source # show :: GenericSourcePos -> String Source # showList :: [GenericSourcePos] -> ShowS Source #
Generic GenericSourcePos Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep GenericSourcePos :: Type -> Type Source # Methods from :: GenericSourcePos -> Rep GenericSourcePos x Source # to :: Rep GenericSourcePos x -> GenericSourcePos Source #
ToJSON GenericSourcePos Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: GenericSourcePos -> Value Source # toEncoding :: GenericSourcePos -> Encoding Source # toJSONList :: [GenericSourcePos] -> Value Source # toEncodingList :: [GenericSourcePos] -> Encoding Source #
FromJSON GenericSourcePos Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser GenericSourcePos Source # parseJSONList :: Value -> Parser [GenericSourcePos] Source #
type Rep GenericSourcePos Source # |

Instance details

Defined in Hledger.Data.Types

type Rep GenericSourcePos = D1 ('MetaData "GenericSourcePos" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "GenericSourcePos" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :+: C1 ('MetaCons "JournalSourcePos" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Int, Int))))

data Transaction Source #

Constructors

Transaction |

Fields

- tindex :: Integer

  this transaction's 1-based position in the transaction stream, or 0 when not available

- tprecedingcomment :: Text

  any comment lines immediately preceding this transaction

- tsourcepos :: GenericSourcePos

  the file position where the date starts

- tdate :: Day
- tdate2 :: Maybe Day
- tstatus :: Status
- tcode :: Text
- tdescription :: Text
- tcomment :: Text

  this transaction's comment lines, as a single non-indented multi-line string

- ttags :: [Tag]

  tag names and values, extracted from the comment

- tpostings :: [Posting]

  this transaction's postings

#### Instances

Instances details

Eq Transaction Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Transaction -> Transaction -> Bool Source # (/=) :: Transaction -> Transaction -> Bool Source #
Show Transaction Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> Transaction -> ShowS Source # show :: Transaction -> String Source # showList :: [Transaction] -> ShowS Source #
Generic Transaction Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Transaction :: Type -> Type Source # Methods from :: Transaction -> Rep Transaction x Source # to :: Rep Transaction x -> Transaction Source #
ToJSON Transaction Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Transaction -> Value Source # toEncoding :: Transaction -> Encoding Source # toJSONList :: [Transaction] -> Value Source # toEncodingList :: [Transaction] -> Encoding Source #
FromJSON Transaction Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser Transaction Source # parseJSONList :: Value -> Parser [Transaction] Source #
type Rep Transaction Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Transaction = D1 ('MetaData "Transaction" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "Transaction" 'PrefixI 'True) (((S1 ('MetaSel ('Just "tindex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: S1 ('MetaSel ('Just "tprecedingcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "tsourcepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GenericSourcePos) :*: (S1 ('MetaSel ('Just "tdate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day) :*: S1 ('MetaSel ('Just "tdate2") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Day))))) :*: ((S1 ('MetaSel ('Just "tstatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Status) :*: (S1 ('MetaSel ('Just "tcode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "tdescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :*: (S1 ('MetaSel ('Just "tcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "ttags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Tag]) :*: S1 ('MetaSel ('Just "tpostings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Posting]))))))

data TransactionModifier Source #

A transaction modifier rule. This has a query which matches postings in the journal, and a list of transformations to apply to those postings or their transactions. Currently there is one kind of transformation: the TMPostingRule, which adds a posting ("auto posting") to the transaction, optionally setting its amount to the matched posting's amount multiplied by a constant.

Constructors

TransactionModifier |

Fields

- tmquerytxt :: Text
- tmpostingrules :: [TMPostingRule]

#### Instances

Instances details

Eq TransactionModifier Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: TransactionModifier -> TransactionModifier -> Bool Source # (/=) :: TransactionModifier -> TransactionModifier -> Bool Source #
Show TransactionModifier Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> TransactionModifier -> ShowS Source # show :: TransactionModifier -> String Source # showList :: [TransactionModifier] -> ShowS Source #
Generic TransactionModifier Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep TransactionModifier :: Type -> Type Source # Methods from :: TransactionModifier -> Rep TransactionModifier x Source # to :: Rep TransactionModifier x -> TransactionModifier Source #
ToJSON TransactionModifier Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: TransactionModifier -> Value Source # toEncoding :: TransactionModifier -> Encoding Source # toJSONList :: [TransactionModifier] -> Value Source # toEncodingList :: [TransactionModifier] -> Encoding Source #
type Rep TransactionModifier Source # |

Instance details

Defined in Hledger.Data.Types

type Rep TransactionModifier = D1 ('MetaData "TransactionModifier" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "TransactionModifier" 'PrefixI 'True) (S1 ('MetaSel ('Just "tmquerytxt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "tmpostingrules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TMPostingRule])))

nulltransactionmodifier :: TransactionModifier Source #

type TMPostingRule = Posting Source #

A transaction modifier transformation, which adds an extra posting to the matched posting's transaction. Can be like a regular posting, or the amount can have the aismultiplier flag set, indicating that it's a multiplier for the matched posting's amount.

data PeriodicTransaction Source #

A periodic transaction rule, describing a transaction that recurs.

Constructors

PeriodicTransaction |

Fields

- ptperiodexpr :: Text

  the period expression as written

- ptinterval :: Interval

  the interval at which this transaction recurs

- ptspan :: DateSpan

  the (possibly unbounded) period during which this transaction recurs. Contains a whole number of intervals.

- ptstatus :: Status

  some of Transaction's fields

- ptcode :: Text
- ptdescription :: Text
- ptcomment :: Text
- pttags :: [Tag]
- ptpostings :: [Posting]

#### Instances

Instances details

Eq PeriodicTransaction Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: PeriodicTransaction -> PeriodicTransaction -> Bool Source # (/=) :: PeriodicTransaction -> PeriodicTransaction -> Bool Source #
Show PeriodicTransaction Source # |
Instance details Defined in Hledger.Data.PeriodicTransaction Methods showsPrec :: Int -> PeriodicTransaction -> ShowS Source # show :: PeriodicTransaction -> String Source # showList :: [PeriodicTransaction] -> ShowS Source #
Generic PeriodicTransaction Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep PeriodicTransaction :: Type -> Type Source # Methods from :: PeriodicTransaction -> Rep PeriodicTransaction x Source # to :: Rep PeriodicTransaction x -> PeriodicTransaction Source #
ToJSON PeriodicTransaction Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: PeriodicTransaction -> Value Source # toEncoding :: PeriodicTransaction -> Encoding Source # toJSONList :: [PeriodicTransaction] -> Value Source # toEncodingList :: [PeriodicTransaction] -> Encoding Source #
type Rep PeriodicTransaction Source # |

Instance details

Defined in Hledger.Data.Types

type Rep PeriodicTransaction = D1 ('MetaData "PeriodicTransaction" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "PeriodicTransaction" 'PrefixI 'True) (((S1 ('MetaSel ('Just "ptperiodexpr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "ptinterval") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Interval)) :*: (S1 ('MetaSel ('Just "ptspan") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DateSpan) :*: S1 ('MetaSel ('Just "ptstatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Status))) :*: ((S1 ('MetaSel ('Just "ptcode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "ptdescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "ptcomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "pttags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Tag]) :*: S1 ('MetaSel ('Just "ptpostings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Posting]))))))

nullperiodictransaction :: PeriodicTransaction Source #

data TimeclockCode Source #

Constructors

SetBalance |
SetRequiredHours |
In |
Out |
FinalOut |

#### Instances

Instances details

Eq TimeclockCode Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: TimeclockCode -> TimeclockCode -> Bool Source # (/=) :: TimeclockCode -> TimeclockCode -> Bool Source #
Ord TimeclockCode Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: TimeclockCode -> TimeclockCode -> Ordering Source #

(<) :: TimeclockCode -> TimeclockCode -> Bool Source #

(<=) :: TimeclockCode -> TimeclockCode -> Bool Source #

(>) :: TimeclockCode -> TimeclockCode -> Bool Source #

(>=) :: TimeclockCode -> TimeclockCode -> Bool Source #

max :: TimeclockCode -> TimeclockCode -> TimeclockCode Source #

min :: TimeclockCode -> TimeclockCode -> TimeclockCode Source #

Read TimeclockCode Source # |
Instance details Defined in Hledger.Data.Timeclock Methods readsPrec :: Int -> ReadS TimeclockCode Source # readList :: ReadS [TimeclockCode] Source # readPrec :: ReadPrec TimeclockCode Source # readListPrec :: ReadPrec [TimeclockCode] Source #
Show TimeclockCode Source # |
Instance details Defined in Hledger.Data.Timeclock Methods showsPrec :: Int -> TimeclockCode -> ShowS Source # show :: TimeclockCode -> String Source # showList :: [TimeclockCode] -> ShowS Source #
Generic TimeclockCode Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep TimeclockCode :: Type -> Type Source # Methods from :: TimeclockCode -> Rep TimeclockCode x Source # to :: Rep TimeclockCode x -> TimeclockCode Source #
ToJSON TimeclockCode Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: TimeclockCode -> Value Source # toEncoding :: TimeclockCode -> Encoding Source # toJSONList :: [TimeclockCode] -> Value Source # toEncodingList :: [TimeclockCode] -> Encoding Source #
type Rep TimeclockCode Source # |

Instance details

Defined in Hledger.Data.Types

type Rep TimeclockCode = D1 ('MetaData "TimeclockCode" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) ((C1 ('MetaCons "SetBalance" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SetRequiredHours" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "In" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Out" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "FinalOut" 'PrefixI 'False) (U1 :: Type -> Type))))

data TimeclockEntry Source #

Constructors

TimeclockEntry |

Fields

- tlsourcepos :: GenericSourcePos
- tlcode :: TimeclockCode
- tldatetime :: LocalTime
- tlaccount :: AccountName
- tldescription :: Text

#### Instances

Instances details

Eq TimeclockEntry Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: TimeclockEntry -> TimeclockEntry -> Bool Source # (/=) :: TimeclockEntry -> TimeclockEntry -> Bool Source #
Ord TimeclockEntry Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: TimeclockEntry -> TimeclockEntry -> Ordering Source #

(<) :: TimeclockEntry -> TimeclockEntry -> Bool Source #

(<=) :: TimeclockEntry -> TimeclockEntry -> Bool Source #

(>) :: TimeclockEntry -> TimeclockEntry -> Bool Source #

(>=) :: TimeclockEntry -> TimeclockEntry -> Bool Source #

max :: TimeclockEntry -> TimeclockEntry -> TimeclockEntry Source #

min :: TimeclockEntry -> TimeclockEntry -> TimeclockEntry Source #

Show TimeclockEntry Source # |
Instance details Defined in Hledger.Data.Timeclock Methods showsPrec :: Int -> TimeclockEntry -> ShowS Source # show :: TimeclockEntry -> String Source # showList :: [TimeclockEntry] -> ShowS Source #
Generic TimeclockEntry Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep TimeclockEntry :: Type -> Type Source # Methods from :: TimeclockEntry -> Rep TimeclockEntry x Source # to :: Rep TimeclockEntry x -> TimeclockEntry Source #
ToJSON TimeclockEntry Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: TimeclockEntry -> Value Source # toEncoding :: TimeclockEntry -> Encoding Source # toJSONList :: [TimeclockEntry] -> Value Source # toEncodingList :: [TimeclockEntry] -> Encoding Source #
type Rep TimeclockEntry Source # |

Instance details

Defined in Hledger.Data.Types

type Rep TimeclockEntry = D1 ('MetaData "TimeclockEntry" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "TimeclockEntry" 'PrefixI 'True) ((S1 ('MetaSel ('Just "tlsourcepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GenericSourcePos) :*: S1 ('MetaSel ('Just "tlcode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TimeclockCode)) :*: (S1 ('MetaSel ('Just "tldatetime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LocalTime) :*: (S1 ('MetaSel ('Just "tlaccount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AccountName) :*: S1 ('MetaSel ('Just "tldescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))))

data PriceDirective Source #

A market price declaration made by the journal format's P directive. It declares two things: a historical exchange rate between two commodities, and an amount display style for the second commodity.

Constructors

PriceDirective |

Fields

- pddate :: Day
- pdcommodity :: CommoditySymbol
- pdamount :: Amount

#### Instances

Instances details

Eq PriceDirective Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: PriceDirective -> PriceDirective -> Bool Source # (/=) :: PriceDirective -> PriceDirective -> Bool Source #
Ord PriceDirective Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: PriceDirective -> PriceDirective -> Ordering Source #

(<) :: PriceDirective -> PriceDirective -> Bool Source #

(<=) :: PriceDirective -> PriceDirective -> Bool Source #

(>) :: PriceDirective -> PriceDirective -> Bool Source #

(>=) :: PriceDirective -> PriceDirective -> Bool Source #

max :: PriceDirective -> PriceDirective -> PriceDirective Source #

min :: PriceDirective -> PriceDirective -> PriceDirective Source #

Show PriceDirective Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> PriceDirective -> ShowS Source # show :: PriceDirective -> String Source # showList :: [PriceDirective] -> ShowS Source #
Generic PriceDirective Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep PriceDirective :: Type -> Type Source # Methods from :: PriceDirective -> Rep PriceDirective x Source # to :: Rep PriceDirective x -> PriceDirective Source #
ToJSON PriceDirective Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: PriceDirective -> Value Source # toEncoding :: PriceDirective -> Encoding Source # toJSONList :: [PriceDirective] -> Value Source # toEncodingList :: [PriceDirective] -> Encoding Source #
type Rep PriceDirective Source # |

Instance details

Defined in Hledger.Data.Types

type Rep PriceDirective = D1 ('MetaData "PriceDirective" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "PriceDirective" 'PrefixI 'True) (S1 ('MetaSel ('Just "pddate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day) :*: (S1 ('MetaSel ('Just "pdcommodity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Just "pdamount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Amount))))

data MarketPrice Source #

A historical market price (exchange rate) from one commodity to another. A more concise form of a PriceDirective, without the amount display info.

Constructors

MarketPrice |

Fields

- mpdate :: Day

  Date on which this price becomes effective.

- mpfrom :: CommoditySymbol

  The commodity being converted from.

- mpto :: CommoditySymbol

  The commodity being converted to.

- mprate :: Quantity

  One unit of the "from" commodity is worth this quantity of the "to" commodity.

#### Instances

Instances details

Eq MarketPrice Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: MarketPrice -> MarketPrice -> Bool Source # (/=) :: MarketPrice -> MarketPrice -> Bool Source #
Ord MarketPrice Source # |

Instance details

Defined in Hledger.Data.Types

Methods

compare :: MarketPrice -> MarketPrice -> Ordering Source #

(<) :: MarketPrice -> MarketPrice -> Bool Source #

(<=) :: MarketPrice -> MarketPrice -> Bool Source #

(>) :: MarketPrice -> MarketPrice -> Bool Source #

(>=) :: MarketPrice -> MarketPrice -> Bool Source #

max :: MarketPrice -> MarketPrice -> MarketPrice Source #

min :: MarketPrice -> MarketPrice -> MarketPrice Source #

Show MarketPrice Source # |
Instance details Defined in Hledger.Data.Amount Methods showsPrec :: Int -> MarketPrice -> ShowS Source # show :: MarketPrice -> String Source # showList :: [MarketPrice] -> ShowS Source #
Generic MarketPrice Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep MarketPrice :: Type -> Type Source # Methods from :: MarketPrice -> Rep MarketPrice x Source # to :: Rep MarketPrice x -> MarketPrice Source #
ToJSON MarketPrice Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: MarketPrice -> Value Source # toEncoding :: MarketPrice -> Encoding Source # toJSONList :: [MarketPrice] -> Value Source # toEncodingList :: [MarketPrice] -> Encoding Source #
FromJSON MarketPrice Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser MarketPrice Source # parseJSONList :: Value -> Parser [MarketPrice] Source #
type Rep MarketPrice Source # |

Instance details

Defined in Hledger.Data.Types

type Rep MarketPrice = D1 ('MetaData "MarketPrice" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "MarketPrice" 'PrefixI 'True) ((S1 ('MetaSel ('Just "mpdate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Day) :*: S1 ('MetaSel ('Just "mpfrom") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommoditySymbol)) :*: (S1 ('MetaSel ('Just "mpto") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Just "mprate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Quantity))))

data Journal Source #

A Journal, containing transactions and various other things. The basic data model for hledger.

This is used during parsing (as the type alias ParsedJournal), and then finalised/validated for use as a Journal. Some extra parsing-related fields are included for convenience, at least for now. In a ParsedJournal these are updated as parsing proceeds, in a Journal they represent the final state at end of parsing (used eg by the add command).

Constructors

Journal |

Fields

- jparsedefaultyear :: Maybe Year

  the current default year, specified by the most recent Y directive (or current date)

- jparsedefaultcommodity :: Maybe (CommoditySymbol, AmountStyle)

  the current default commodity and its format, specified by the most recent D directive

- jparseparentaccounts :: [AccountName]

  the current stack of parent account names, specified by apply account directives

- jparsealiases :: [AccountAlias]

  the current account name aliases in effect, specified by alias directives (& options ?) ,jparsetransactioncount :: Integer -- ^ the current count of transactions parsed so far (only journal format txns, currently)

- jparsetimeclockentries :: [TimeclockEntry]

  timeclock sessions which have not been clocked out

- jincludefilestack :: [FilePath]
- jdeclaredaccounts :: [(AccountName, AccountDeclarationInfo)]

  Accounts declared by account directives, in parse order (after journal finalisation)

- jdeclaredaccounttypes :: Map AccountType [AccountName]

  Accounts whose type has been declared in account directives (usually 5 top-level accounts)

- jcommodities :: Map CommoditySymbol Commodity

  commodities and formats declared by commodity directives

- jinferredcommodities :: Map CommoditySymbol AmountStyle

  commodities and formats inferred from journal amounts TODO misnamed, should be eg jusedstyles

- jpricedirectives :: [PriceDirective]

  Declarations of market prices by P directives, in parse order (after journal finalisation)

- jinferredmarketprices :: [MarketPrice]

  Market prices implied by transactions, in parse order (after journal finalisation)

- jtxnmodifiers :: [TransactionModifier]
- jperiodictxns :: [PeriodicTransaction]
- jtxns :: [Transaction]
- jfinalcommentlines :: Text

  any final trailing comments in the (main) journal file

- jfiles :: [(FilePath, Text)]

  the file path and raw text of the main and any included journal files. The main file is first, followed by any included files in the order encountered.

- jlastreadtime :: ClockTime

  when this journal was last read from its file(s)

#### Instances

Instances details

Eq Journal Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: Journal -> Journal -> Bool Source # (/=) :: Journal -> Journal -> Bool Source #
Show Journal Source # |
Instance details Defined in Hledger.Data.Journal Methods showsPrec :: Int -> Journal -> ShowS Source # show :: Journal -> String Source # showList :: [Journal] -> ShowS Source #
Generic Journal Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Journal :: Type -> Type Source # Methods from :: Journal -> Rep Journal x Source # to :: Rep Journal x -> Journal Source #
Semigroup Journal Source # |
Instance details Defined in Hledger.Data.Journal Methods (<>) :: Journal -> Journal -> Journal Source # sconcat :: NonEmpty Journal -> Journal Source # stimes :: Integral b => b -> Journal -> Journal Source #
ToJSON Journal Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Journal -> Value Source # toEncoding :: Journal -> Encoding Source # toJSONList :: [Journal] -> Value Source # toEncodingList :: [Journal] -> Encoding Source #
Default Journal Source # |
Instance details Defined in Hledger.Data.Journal Methods def :: Journal #
type Rep Journal Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Journal = D1 ('MetaData "Journal" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "Journal" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "jparsedefaultyear") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Year)) :*: S1 ('MetaSel ('Just "jparsedefaultcommodity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (CommoditySymbol, AmountStyle)))) :*: (S1 ('MetaSel ('Just "jparseparentaccounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [AccountName]) :*: S1 ('MetaSel ('Just "jparsealiases") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [AccountAlias]))) :*: ((S1 ('MetaSel ('Just "jparsetimeclockentries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TimeclockEntry]) :*: S1 ('MetaSel ('Just "jincludefilestack") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FilePath])) :*: (S1 ('MetaSel ('Just "jdeclaredaccounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(AccountName, AccountDeclarationInfo)]) :*: (S1 ('MetaSel ('Just "jdeclaredaccounttypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map AccountType [AccountName])) :*: S1 ('MetaSel ('Just "jcommodities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map CommoditySymbol Commodity)))))) :*: (((S1 ('MetaSel ('Just "jinferredcommodities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map CommoditySymbol AmountStyle)) :*: S1 ('MetaSel ('Just "jpricedirectives") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PriceDirective])) :*: (S1 ('MetaSel ('Just "jinferredmarketprices") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [MarketPrice]) :*: S1 ('MetaSel ('Just "jtxnmodifiers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TransactionModifier]))) :*: ((S1 ('MetaSel ('Just "jperiodictxns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [PeriodicTransaction]) :*: S1 ('MetaSel ('Just "jtxns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Transaction])) :*: (S1 ('MetaSel ('Just "jfinalcommentlines") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "jfiles") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(FilePath, Text)]) :*: S1 ('MetaSel ('Just "jlastreadtime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ClockTime)))))))

type ParsedJournal = Journal Source #

A journal in the process of being parsed, not yet finalised. The data is partial, and list fields are in reverse order.

type StorageFormat = String Source #

The id of a data format understood by hledger, eg `journal` or `csv`. The --output-format option selects one of these for output.

data AccountDeclarationInfo Source #

Extra information about an account that can be derived from its account directive (and the other account directives).

Constructors

AccountDeclarationInfo |

Fields

- adicomment :: Text

  any comment lines following an account directive for this account

- aditags :: [Tag]

  tags extracted from the account comment, if any

- adideclarationorder :: Int

  the order in which this account was declared, relative to other account declarations, during parsing (1..)

#### Instances

Instances details

Eq AccountDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: AccountDeclarationInfo -> AccountDeclarationInfo -> Bool Source # (/=) :: AccountDeclarationInfo -> AccountDeclarationInfo -> Bool Source #
Show AccountDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> AccountDeclarationInfo -> ShowS Source # show :: AccountDeclarationInfo -> String Source # showList :: [AccountDeclarationInfo] -> ShowS Source #
Generic AccountDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep AccountDeclarationInfo :: Type -> Type Source # Methods from :: AccountDeclarationInfo -> Rep AccountDeclarationInfo x Source # to :: Rep AccountDeclarationInfo x -> AccountDeclarationInfo Source #
ToJSON AccountDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: AccountDeclarationInfo -> Value Source # toEncoding :: AccountDeclarationInfo -> Encoding Source # toJSONList :: [AccountDeclarationInfo] -> Value Source # toEncodingList :: [AccountDeclarationInfo] -> Encoding Source #
FromJSON AccountDeclarationInfo Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser AccountDeclarationInfo Source # parseJSONList :: Value -> Parser [AccountDeclarationInfo] Source #
type Rep AccountDeclarationInfo Source # |

Instance details

Defined in Hledger.Data.Types

type Rep AccountDeclarationInfo = D1 ('MetaData "AccountDeclarationInfo" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "AccountDeclarationInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "adicomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "aditags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Tag]) :*: S1 ('MetaSel ('Just "adideclarationorder") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))))

nullaccountdeclarationinfo :: AccountDeclarationInfo Source #

data Account Source #

An account, with its balances, parent/subaccount relationships, etc. Only the name is required; the other fields are added when needed.

Constructors

Account |

Fields

- aname :: AccountName

  this account's full name

- adeclarationinfo :: Maybe AccountDeclarationInfo

  optional extra info from account directives relationships in the tree

- asubs :: [Account]

  this account's sub-accounts

- aparent :: Maybe Account

  parent account

- aboring :: Bool

  used in the accounts report to label elidable parents balance information

- anumpostings :: Int

  the number of postings to this account

- aebalance :: MixedAmount

  this account's balance, excluding subaccounts

- aibalance :: MixedAmount

  this account's balance, including subaccounts

#### Instances

Instances details

Eq Account Source # |
Instance details Defined in Hledger.Data.Account Methods (==) :: Account -> Account -> Bool Source # (/=) :: Account -> Account -> Bool Source #
Show Account Source # |
Instance details Defined in Hledger.Data.Account Methods showsPrec :: Int -> Account -> ShowS Source # show :: Account -> String Source # showList :: [Account] -> ShowS Source #
Generic Account Source # |
Instance details Defined in Hledger.Data.Types Associated Types type Rep Account :: Type -> Type Source # Methods from :: Account -> Rep Account x Source # to :: Rep Account x -> Account Source #
ToJSON Account Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Account -> Value Source # toEncoding :: Account -> Encoding Source # toJSONList :: [Account] -> Value Source # toEncodingList :: [Account] -> Encoding Source #
FromJSON Account Source # |
Instance details Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser Account Source # parseJSONList :: Value -> Parser [Account] Source #
type Rep Account Source # |

Instance details

Defined in Hledger.Data.Types

type Rep Account = D1 ('MetaData "Account" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "Account" 'PrefixI 'True) (((S1 ('MetaSel ('Just "aname") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AccountName) :*: S1 ('MetaSel ('Just "adeclarationinfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe AccountDeclarationInfo))) :*: (S1 ('MetaSel ('Just "asubs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Account]) :*: S1 ('MetaSel ('Just "aparent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Account)))) :*: ((S1 ('MetaSel ('Just "aboring") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "anumpostings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "aebalance") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MixedAmount) :*: S1 ('MetaSel ('Just "aibalance") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 MixedAmount)))))

data NormalSign Source #

Whether an account's balance is normally a positive number (in accounting terms, a debit balance) or a negative number (credit balance). Assets and expenses are normally positive (debit), while liabilities, equity and income are normally negative (credit). https://en.wikipedia.org/wiki/Normal_balance

Constructors

NormallyPositive |
NormallyNegative |

#### Instances

Instances details

Eq NormalSign Source # |
Instance details Defined in Hledger.Data.Types Methods (==) :: NormalSign -> NormalSign -> Bool Source # (/=) :: NormalSign -> NormalSign -> Bool Source #
Show NormalSign Source # |
Instance details Defined in Hledger.Data.Types Methods showsPrec :: Int -> NormalSign -> ShowS Source # show :: NormalSign -> String Source # showList :: [NormalSign] -> ShowS Source #

data Ledger Source #

A Ledger has the journal it derives from, and the accounts derived from that. Accounts are accessible both list-wise and tree-wise, since each one knows its parent and subs; the first account is the root of the tree and always exists.

Constructors

Ledger |

Fields

- ljournal :: Journal
- laccounts :: [Account]

#### Instances

Instances details

Show Ledger Source # |
Instance details Defined in Hledger.Data.Ledger Methods showsPrec :: Int -> Ledger -> ShowS Source # show :: Ledger -> String Source # showList :: [Ledger] -> ShowS Source #
Generic Ledger Source # |
Instance details Defined in Hledger.Data.Json Associated Types type Rep Ledger :: Type -> Type Source # Methods from :: Ledger -> Rep Ledger x Source # to :: Rep Ledger x -> Ledger Source #
ToJSON Ledger Source # |
Instance details Defined in Hledger.Data.Json Methods toJSON :: Ledger -> Value Source # toEncoding :: Ledger -> Encoding Source # toJSONList :: [Ledger] -> Value Source # toEncodingList :: [Ledger] -> Encoding Source #
type Rep Ledger Source # |

Instance details

Defined in Hledger.Data.Json

type Rep Ledger = D1 ('MetaData "Ledger" "Hledger.Data.Types" "hledger-lib-1.19.1-HiJm5gTzIoI9YG44cjU7Jm" 'False) (C1 ('MetaCons "Ledger" 'PrefixI 'True) (S1 ('MetaSel ('Just "ljournal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Journal) :*: S1 ('MetaSel ('Just "laccounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Account])))

# Orphan instances

Generic ClockTime Source # |
Instance details Associated Types type Rep ClockTime :: Type -> Type Source # Methods from :: ClockTime -> Rep ClockTime x Source # to :: Rep ClockTime x -> ClockTime Source #
ToMarkup Quantity Source # |
Instance details Methods toMarkup :: Quantity -> Markup Source # preEscapedToMarkup :: Quantity -> Markup Source #