Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Hledger.Data.Types
Contents
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 Ledger = Ledger {}
- data NormalSign
- data Account = Account {
- aname :: AccountName
- adeclarationinfo :: Maybe AccountDeclarationInfo
- asubs :: [Account]
- aparent :: Maybe Account
- aboring :: Bool
- anumpostings :: Int
- aebalance :: MixedAmount
- aibalance :: MixedAmount
- data AccountDeclarationInfo = AccountDeclarationInfo {
- adicomment :: Text
- aditags :: [Tag]
- adideclarationorder :: Int
- adisourcepos :: SourcePos
- data PayeeDeclarationInfo = PayeeDeclarationInfo {
- pdicomment :: Text
- pditags :: [Tag]
- type StorageFormat = String
- type ParsedJournal = Journal
- data Journal = Journal {
- jparsedefaultyear :: Maybe Year
- jparsedefaultcommodity :: Maybe (CommoditySymbol, AmountStyle)
- jparsedecimalmark :: Maybe DecimalMark
- jparseparentaccounts :: [AccountName]
- jparsealiases :: [AccountAlias]
- jparsetimeclockentries :: [TimeclockEntry]
- jincludefilestack :: [FilePath]
- jdeclaredpayees :: [(Payee, PayeeDeclarationInfo)]
- jdeclaredaccounts :: [(AccountName, AccountDeclarationInfo)]
- jdeclaredaccounttags :: Map AccountName [Tag]
- jdeclaredaccounttypes :: Map AccountType [AccountName]
- jaccounttypes :: Map AccountName AccountType
- jglobalcommoditystyles :: Map CommoditySymbol AmountStyle
- jcommodities :: Map CommoditySymbol Commodity
- jinferredcommodities :: Map CommoditySymbol AmountStyle
- jpricedirectives :: [PriceDirective]
- jinferredmarketprices :: [MarketPrice]
- jtxnmodifiers :: [TransactionModifier]
- jperiodictxns :: [PeriodicTransaction]
- jtxns :: [Transaction]
- jfinalcommentlines :: Text
- jfiles :: [(FilePath, Text)]
- jlastreadtime :: POSIXTime
- data MarketPrice = MarketPrice {
- mpdate :: Day
- mpfrom :: CommoditySymbol
- mpto :: CommoditySymbol
- mprate :: Quantity
- data PriceDirective = PriceDirective {
- pddate :: Day
- pdcommodity :: CommoditySymbol
- pdamount :: Amount
- data TimeclockEntry = TimeclockEntry {
- tlsourcepos :: SourcePos
- tlcode :: TimeclockCode
- tldatetime :: LocalTime
- tlaccount :: AccountName
- tldescription :: Text
- data TimeclockCode
- = SetBalance
- | SetRequiredHours
- | In
- | Out
- | FinalOut
- data PeriodicTransaction = PeriodicTransaction {
- ptperiodexpr :: Text
- ptinterval :: Interval
- ptspan :: DateSpan
- ptstatus :: Status
- ptcode :: Text
- ptdescription :: Text
- ptcomment :: Text
- pttags :: [Tag]
- ptpostings :: [Posting]
- data TMPostingRule = TMPostingRule {
- tmprPosting :: Posting
- tmprIsMultiplier :: Bool
- data TransactionModifier = TransactionModifier {
- tmquerytxt :: Text
- tmpostingrules :: [TMPostingRule]
- data Transaction = Transaction {}
- 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 BalanceAssertion = BalanceAssertion {
- baamount :: Amount
- batotal :: Bool
- bainclusive :: Bool
- baposition :: SourcePos
- data Status
- type DateTag = (TagName, Day)
- type Tag = (TagName, TagValue)
- type TagValue = Text
- type TagName = Text
- data PostingType
- data MixedAmountKey
- newtype MixedAmount = Mixed (Map MixedAmountKey Amount)
- data Amount = Amount {
- acommodity :: !CommoditySymbol
- aquantity :: !Quantity
- astyle :: !AmountStyle
- aprice :: !(Maybe AmountPrice)
- data Commodity = Commodity {
- csymbol :: CommoditySymbol
- cformat :: Maybe AmountStyle
- type CommoditySymbol = Text
- data DigitGroupStyle = DigitGroups !Char ![Word8]
- data AmountPrecision
- = Precision !Word8
- | NaturalPrecision
- data AmountStyle = AmountStyle {
- ascommodityside :: !Side
- ascommodityspaced :: !Bool
- asprecision :: !AmountPrecision
- asdecimalpoint :: !(Maybe Char)
- asdigitgroups :: !(Maybe DigitGroupStyle)
- data AmountPrice
- = UnitPrice !Amount
- | TotalPrice !Amount
- type Quantity = Decimal
- type DecimalMark = Char
- data Side
- data AccountAlias
- data AccountType
- type AccountName = Text
- type Payee = Text
- data Interval
- = NoInterval
- | Days Int
- | Weeks Int
- | Months Int
- | Quarters Int
- | Years Int
- | DayOfMonth Int
- | WeekdayOfMonth Int Int
- | DaysOfWeek [Int]
- | DayOfYear Int Int
- data Period
- = DayPeriod Day
- | WeekPeriod Day
- | MonthPeriod Year Month
- | QuarterPeriod Year Quarter
- | YearPeriod Year
- | PeriodBetween Day Day
- | PeriodFrom Day
- | PeriodTo Day
- | PeriodAll
- data DateSpan = DateSpan (Maybe Day) (Maybe Day)
- data WhichDate
- data SmartInterval
- data SmartDate
- = SmartCompleteDate Day
- | SmartAssumeStart Year (Maybe Month)
- | SmartFromReference (Maybe Month) MonthDay
- | SmartMonth Month
- | SmartRelative Integer SmartInterval
- type WeekDay = Int
- type MonthDay = Int
- type YearDay = Int
- type MonthWeek = Int
- type YearWeek = Int
- type Quarter = Int
- type Month = Int
- isAccountSubtypeOf :: AccountType -> AccountType -> Bool
- isDecimalMark :: Char -> Bool
- maCompare :: MixedAmount -> MixedAmount -> Ordering
- nulltransactionmodifier :: TransactionModifier
- nullperiodictransaction :: PeriodicTransaction
- nullpayeedeclarationinfo :: PayeeDeclarationInfo
- nullaccountdeclarationinfo :: AccountDeclarationInfo
- type Year = Integer
Documentation
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.
Instances
ToJSON Ledger | |
Defined in Hledger.Data.Json Methods toEncoding :: Ledger -> Encoding toJSONList :: [Ledger] -> Value toEncodingList :: [Ledger] -> Encoding | |
Generic Ledger Source # | |
Show Ledger | |
type Rep Ledger Source # | |
Defined in Hledger.Data.Types type Rep Ledger = D1 ('MetaData "Ledger" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" 'False) (C1 ('MetaCons "Ledger" 'PrefixI 'True) (S1 ('MetaSel ('Just "ljournal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Journal) :*: S1 ('MetaSel ('Just "laccounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Account]))) |
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
Show NormalSign Source # | |
Defined in Hledger.Data.Types Methods showsPrec :: Int -> NormalSign -> ShowS show :: NormalSign -> String showList :: [NormalSign] -> ShowS | |
Eq NormalSign Source # | |
Defined in Hledger.Data.Types |
An account, with its balances, parent/subaccount relationships, etc. Only the name is required; the other fields are added when needed.
Constructors
Account | |
Fields
|
Instances
FromJSON Account | |
Defined in Hledger.Data.Json | |
ToJSON Account | |
Defined in Hledger.Data.Json Methods toEncoding :: Account -> Encoding toJSONList :: [Account] -> Value toEncodingList :: [Account] -> Encoding | |
Generic Account Source # | |
Show Account | |
Eq Account | |
type Rep Account Source # | |
Defined in Hledger.Data.Types type Rep Account = D1 ('MetaData "Account" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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 AccountDeclarationInfo Source #
Extra information about an account that can be derived from its account directive (and the other account directives).
Constructors
AccountDeclarationInfo | |
Fields
|
Instances
FromJSON AccountDeclarationInfo | |
Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser AccountDeclarationInfo parseJSONList :: Value -> Parser [AccountDeclarationInfo] | |
ToJSON AccountDeclarationInfo | |
Defined in Hledger.Data.Json Methods toJSON :: AccountDeclarationInfo -> Value toEncoding :: AccountDeclarationInfo -> Encoding toJSONList :: [AccountDeclarationInfo] -> Value toEncodingList :: [AccountDeclarationInfo] -> Encoding | |
Generic AccountDeclarationInfo Source # | |
Defined in Hledger.Data.Types Associated Types type Rep AccountDeclarationInfo :: Type -> Type Methods from :: AccountDeclarationInfo -> Rep AccountDeclarationInfo x to :: Rep AccountDeclarationInfo x -> AccountDeclarationInfo | |
Show AccountDeclarationInfo Source # | |
Defined in Hledger.Data.Types Methods showsPrec :: Int -> AccountDeclarationInfo -> ShowS show :: AccountDeclarationInfo -> String showList :: [AccountDeclarationInfo] -> ShowS | |
Eq AccountDeclarationInfo Source # | |
Defined in Hledger.Data.Types Methods (==) :: AccountDeclarationInfo -> AccountDeclarationInfo -> Bool (/=) :: AccountDeclarationInfo -> AccountDeclarationInfo -> Bool | |
type Rep AccountDeclarationInfo Source # | |
Defined in Hledger.Data.Types type Rep AccountDeclarationInfo = D1 ('MetaData "AccountDeclarationInfo" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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) :*: S1 ('MetaSel ('Just "adisourcepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourcePos)))) |
data PayeeDeclarationInfo Source #
Extra information found in a payee directive.
Constructors
PayeeDeclarationInfo | |
Fields
|
Instances
ToJSON PayeeDeclarationInfo | |
Defined in Hledger.Data.Json Methods toJSON :: PayeeDeclarationInfo -> Value toEncoding :: PayeeDeclarationInfo -> Encoding toJSONList :: [PayeeDeclarationInfo] -> Value toEncodingList :: [PayeeDeclarationInfo] -> Encoding | |
Generic PayeeDeclarationInfo Source # | |
Defined in Hledger.Data.Types Associated Types type Rep PayeeDeclarationInfo :: Type -> Type Methods from :: PayeeDeclarationInfo -> Rep PayeeDeclarationInfo x to :: Rep PayeeDeclarationInfo x -> PayeeDeclarationInfo | |
Show PayeeDeclarationInfo Source # | |
Defined in Hledger.Data.Types Methods showsPrec :: Int -> PayeeDeclarationInfo -> ShowS show :: PayeeDeclarationInfo -> String showList :: [PayeeDeclarationInfo] -> ShowS | |
Eq PayeeDeclarationInfo Source # | |
Defined in Hledger.Data.Types Methods (==) :: PayeeDeclarationInfo -> PayeeDeclarationInfo -> Bool (/=) :: PayeeDeclarationInfo -> PayeeDeclarationInfo -> Bool | |
type Rep PayeeDeclarationInfo Source # | |
Defined in Hledger.Data.Types type Rep PayeeDeclarationInfo = D1 ('MetaData "PayeeDeclarationInfo" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" 'False) (C1 ('MetaCons "PayeeDeclarationInfo" 'PrefixI 'True) (S1 ('MetaSel ('Just "pdicomment") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "pditags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Tag]))) |
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.
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.
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
|
Instances
ToJSON Journal | |
Defined in Hledger.Data.Json Methods toEncoding :: Journal -> Encoding toJSONList :: [Journal] -> Value toEncodingList :: [Journal] -> Encoding | |
Semigroup Journal | |
Generic Journal Source # | |
Show Journal | |
Default Journal | |
Defined in Hledger.Data.Journal | |
Eq Journal Source # | |
type Rep Journal Source # | |
Defined in Hledger.Data.Types type Rep Journal = D1 ('MetaData "Journal" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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 "jparsedecimalmark") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe DecimalMark)) :*: (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 "jdeclaredpayees") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Payee, PayeeDeclarationInfo)]))) :*: (S1 ('MetaSel ('Just "jdeclaredaccounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(AccountName, AccountDeclarationInfo)]) :*: (S1 ('MetaSel ('Just "jdeclaredaccounttags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map AccountName [Tag])) :*: S1 ('MetaSel ('Just "jdeclaredaccounttypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map AccountType [AccountName])))))) :*: (((S1 ('MetaSel ('Just "jaccounttypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map AccountName AccountType)) :*: (S1 ('MetaSel ('Just "jglobalcommoditystyles") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map CommoditySymbol AmountStyle)) :*: 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 POSIXTime))))))) |
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
|
Instances
FromJSON MarketPrice | |
Defined in Hledger.Data.Json | |
ToJSON MarketPrice | |
Defined in Hledger.Data.Json Methods toJSON :: MarketPrice -> Value toEncoding :: MarketPrice -> Encoding toJSONList :: [MarketPrice] -> Value toEncodingList :: [MarketPrice] -> Encoding | |
Generic MarketPrice Source # | |
Defined in Hledger.Data.Types Associated Types type Rep MarketPrice :: Type -> Type | |
Show MarketPrice Source # | |
Defined in Hledger.Data.Types Methods showsPrec :: Int -> MarketPrice -> ShowS show :: MarketPrice -> String showList :: [MarketPrice] -> ShowS | |
Eq MarketPrice Source # | |
Defined in Hledger.Data.Types | |
Ord MarketPrice Source # | |
Defined in Hledger.Data.Types Methods compare :: MarketPrice -> MarketPrice -> Ordering (<) :: MarketPrice -> MarketPrice -> Bool (<=) :: MarketPrice -> MarketPrice -> Bool (>) :: MarketPrice -> MarketPrice -> Bool (>=) :: MarketPrice -> MarketPrice -> Bool max :: MarketPrice -> MarketPrice -> MarketPrice min :: MarketPrice -> MarketPrice -> MarketPrice | |
type Rep MarketPrice Source # | |
Defined in Hledger.Data.Types type Rep MarketPrice = D1 ('MetaData "MarketPrice" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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 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
|
Instances
ToJSON PriceDirective | |
Defined in Hledger.Data.Json Methods toJSON :: PriceDirective -> Value toEncoding :: PriceDirective -> Encoding toJSONList :: [PriceDirective] -> Value toEncodingList :: [PriceDirective] -> Encoding | |
Generic PriceDirective Source # | |
Defined in Hledger.Data.Types Associated Types type Rep PriceDirective :: Type -> Type | |
Show PriceDirective Source # | |
Defined in Hledger.Data.Types Methods showsPrec :: Int -> PriceDirective -> ShowS show :: PriceDirective -> String showList :: [PriceDirective] -> ShowS | |
Eq PriceDirective Source # | |
Defined in Hledger.Data.Types Methods (==) :: PriceDirective -> PriceDirective -> Bool (/=) :: PriceDirective -> PriceDirective -> Bool | |
Ord PriceDirective Source # | |
Defined in Hledger.Data.Types Methods compare :: PriceDirective -> PriceDirective -> Ordering (<) :: PriceDirective -> PriceDirective -> Bool (<=) :: PriceDirective -> PriceDirective -> Bool (>) :: PriceDirective -> PriceDirective -> Bool (>=) :: PriceDirective -> PriceDirective -> Bool max :: PriceDirective -> PriceDirective -> PriceDirective min :: PriceDirective -> PriceDirective -> PriceDirective | |
type Rep PriceDirective Source # | |
Defined in Hledger.Data.Types type Rep PriceDirective = D1 ('MetaData "PriceDirective" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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 TimeclockEntry Source #
Constructors
TimeclockEntry | |
Fields
|
Instances
ToJSON TimeclockEntry | |
Defined in Hledger.Data.Json Methods toJSON :: TimeclockEntry -> Value toEncoding :: TimeclockEntry -> Encoding toJSONList :: [TimeclockEntry] -> Value toEncodingList :: [TimeclockEntry] -> Encoding | |
Generic TimeclockEntry Source # | |
Defined in Hledger.Data.Types Associated Types type Rep TimeclockEntry :: Type -> Type | |
Show TimeclockEntry | |
Defined in Hledger.Data.Timeclock Methods showsPrec :: Int -> TimeclockEntry -> ShowS show :: TimeclockEntry -> String showList :: [TimeclockEntry] -> ShowS | |
Eq TimeclockEntry Source # | |
Defined in Hledger.Data.Types Methods (==) :: TimeclockEntry -> TimeclockEntry -> Bool (/=) :: TimeclockEntry -> TimeclockEntry -> Bool | |
Ord TimeclockEntry Source # | |
Defined in Hledger.Data.Types Methods compare :: TimeclockEntry -> TimeclockEntry -> Ordering (<) :: TimeclockEntry -> TimeclockEntry -> Bool (<=) :: TimeclockEntry -> TimeclockEntry -> Bool (>) :: TimeclockEntry -> TimeclockEntry -> Bool (>=) :: TimeclockEntry -> TimeclockEntry -> Bool max :: TimeclockEntry -> TimeclockEntry -> TimeclockEntry min :: TimeclockEntry -> TimeclockEntry -> TimeclockEntry | |
type Rep TimeclockEntry Source # | |
Defined in Hledger.Data.Types type Rep TimeclockEntry = D1 ('MetaData "TimeclockEntry" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" 'False) (C1 ('MetaCons "TimeclockEntry" 'PrefixI 'True) ((S1 ('MetaSel ('Just "tlsourcepos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourcePos) :*: 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 TimeclockCode Source #
Constructors
SetBalance | |
SetRequiredHours | |
In | |
Out | |
FinalOut |
Instances
ToJSON TimeclockCode | |
Defined in Hledger.Data.Json Methods toJSON :: TimeclockCode -> Value toEncoding :: TimeclockCode -> Encoding toJSONList :: [TimeclockCode] -> Value toEncodingList :: [TimeclockCode] -> Encoding | |
Generic TimeclockCode Source # | |
Defined in Hledger.Data.Types Associated Types type Rep TimeclockCode :: Type -> Type | |
Read TimeclockCode | |
Defined in Hledger.Data.Timeclock Methods readsPrec :: Int -> ReadS TimeclockCode readList :: ReadS [TimeclockCode] readPrec :: ReadPrec TimeclockCode readListPrec :: ReadPrec [TimeclockCode] | |
Show TimeclockCode | |
Defined in Hledger.Data.Timeclock Methods showsPrec :: Int -> TimeclockCode -> ShowS show :: TimeclockCode -> String showList :: [TimeclockCode] -> ShowS | |
Eq TimeclockCode Source # | |
Defined in Hledger.Data.Types | |
Ord TimeclockCode Source # | |
Defined in Hledger.Data.Types Methods compare :: TimeclockCode -> TimeclockCode -> Ordering (<) :: TimeclockCode -> TimeclockCode -> Bool (<=) :: TimeclockCode -> TimeclockCode -> Bool (>) :: TimeclockCode -> TimeclockCode -> Bool (>=) :: TimeclockCode -> TimeclockCode -> Bool max :: TimeclockCode -> TimeclockCode -> TimeclockCode min :: TimeclockCode -> TimeclockCode -> TimeclockCode | |
type Rep TimeclockCode Source # | |
Defined in Hledger.Data.Types type Rep TimeclockCode = D1 ('MetaData "TimeclockCode" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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 PeriodicTransaction Source #
A periodic transaction rule, describing a transaction that recurs.
Constructors
PeriodicTransaction | |
Fields
|
Instances
ToJSON PeriodicTransaction | |
Defined in Hledger.Data.Json Methods toJSON :: PeriodicTransaction -> Value toEncoding :: PeriodicTransaction -> Encoding toJSONList :: [PeriodicTransaction] -> Value toEncodingList :: [PeriodicTransaction] -> Encoding | |
Generic PeriodicTransaction Source # | |
Defined in Hledger.Data.Types Associated Types type Rep PeriodicTransaction :: Type -> Type Methods from :: PeriodicTransaction -> Rep PeriodicTransaction x to :: Rep PeriodicTransaction x -> PeriodicTransaction | |
Show PeriodicTransaction | |
Defined in Hledger.Data.PeriodicTransaction Methods showsPrec :: Int -> PeriodicTransaction -> ShowS show :: PeriodicTransaction -> String showList :: [PeriodicTransaction] -> ShowS | |
Eq PeriodicTransaction Source # | |
Defined in Hledger.Data.Types Methods (==) :: PeriodicTransaction -> PeriodicTransaction -> Bool (/=) :: PeriodicTransaction -> PeriodicTransaction -> Bool | |
type Rep PeriodicTransaction Source # | |
Defined in Hledger.Data.Types type Rep PeriodicTransaction = D1 ('MetaData "PeriodicTransaction" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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])))))) |
data TMPostingRule Source #
A transaction modifier transformation, which adds an extra posting to the matched posting's transaction. Can be like a regular posting, or can have the tmprIsMultiplier flag set, indicating that it's a multiplier for the matched posting's amount.
Constructors
TMPostingRule | |
Fields
|
Instances
ToJSON TMPostingRule | |
Defined in Hledger.Data.Json Methods toJSON :: TMPostingRule -> Value toEncoding :: TMPostingRule -> Encoding toJSONList :: [TMPostingRule] -> Value toEncodingList :: [TMPostingRule] -> Encoding | |
Generic TMPostingRule Source # | |
Defined in Hledger.Data.Types Associated Types type Rep TMPostingRule :: Type -> Type | |
Show TMPostingRule Source # | |
Defined in Hledger.Data.Types Methods showsPrec :: Int -> TMPostingRule -> ShowS show :: TMPostingRule -> String showList :: [TMPostingRule] -> ShowS | |
Eq TMPostingRule Source # | |
Defined in Hledger.Data.Types | |
type Rep TMPostingRule Source # | |
Defined in Hledger.Data.Types type Rep TMPostingRule = D1 ('MetaData "TMPostingRule" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" 'False) (C1 ('MetaCons "TMPostingRule" 'PrefixI 'True) (S1 ('MetaSel ('Just "tmprPosting") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Posting) :*: S1 ('MetaSel ('Just "tmprIsMultiplier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))) |
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
|
Instances
ToJSON TransactionModifier | |
Defined in Hledger.Data.Json Methods toJSON :: TransactionModifier -> Value toEncoding :: TransactionModifier -> Encoding toJSONList :: [TransactionModifier] -> Value toEncodingList :: [TransactionModifier] -> Encoding | |
Generic TransactionModifier Source # | |
Defined in Hledger.Data.Types Associated Types type Rep TransactionModifier :: Type -> Type Methods from :: TransactionModifier -> Rep TransactionModifier x to :: Rep TransactionModifier x -> TransactionModifier | |
Show TransactionModifier Source # | |
Defined in Hledger.Data.Types Methods showsPrec :: Int -> TransactionModifier -> ShowS show :: TransactionModifier -> String showList :: [TransactionModifier] -> ShowS | |
Eq TransactionModifier Source # | |
Defined in Hledger.Data.Types Methods (==) :: TransactionModifier -> TransactionModifier -> Bool (/=) :: TransactionModifier -> TransactionModifier -> Bool | |
type Rep TransactionModifier Source # | |
Defined in Hledger.Data.Types type Rep TransactionModifier = D1 ('MetaData "TransactionModifier" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" 'False) (C1 ('MetaCons "TransactionModifier" 'PrefixI 'True) (S1 ('MetaSel ('Just "tmquerytxt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "tmpostingrules") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TMPostingRule]))) |
data Transaction Source #
Constructors
Transaction | |
Fields
|
Instances
FromJSON Transaction | |
Defined in Hledger.Data.Json | |
ToJSON Transaction | |
Defined in Hledger.Data.Json Methods toJSON :: Transaction -> Value toEncoding :: Transaction -> Encoding toJSONList :: [Transaction] -> Value toEncodingList :: [Transaction] -> Encoding | |
Generic Transaction Source # | |
Defined in Hledger.Data.Types Associated Types type Rep Transaction :: Type -> Type | |
Show Transaction Source # | |
Defined in Hledger.Data.Types Methods showsPrec :: Int -> Transaction -> ShowS show :: Transaction -> String showList :: [Transaction] -> ShowS | |
Eq Transaction Source # | |
Defined in Hledger.Data.Types | |
type Rep Transaction Source # | |
Defined in Hledger.Data.Types type Rep Transaction = D1 ('MetaData "Transaction" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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 (SourcePos, SourcePos)) :*: (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])))))) |
Constructors
Posting | |
Fields
|
Instances
FromJSON Posting | |
Defined in Hledger.Data.Json | |
ToJSON Posting | |
Defined in Hledger.Data.Json Methods toEncoding :: Posting -> Encoding toJSONList :: [Posting] -> Value toEncodingList :: [Posting] -> Encoding | |
Generic Posting Source # | |
Show Posting Source # | Posting's show instance elides the parent transaction so as not to recurse forever. |
Eq Posting Source # | |
type Rep Posting Source # | |
Defined in Hledger.Data.Types type Rep Posting = D1 ('MetaData "Posting" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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 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:
- 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.
- total assertions. Because otherwise assertions are a bit leaky. Implemented with == syntax.
- subaccount-inclusive assertions. Because that's something folks need. Not implemented.
- 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.
- multicommodity assertions, asserting the balance of multiple commodities at once. Not implemented, requires #934.
Constructors
BalanceAssertion | |
Fields
|
Instances
FromJSON BalanceAssertion | |
Defined in Hledger.Data.Json Methods parseJSON :: Value -> Parser BalanceAssertion parseJSONList :: Value -> Parser [BalanceAssertion] | |
ToJSON BalanceAssertion | |
Defined in Hledger.Data.Json Methods toJSON :: BalanceAssertion -> Value toEncoding :: BalanceAssertion -> Encoding toJSONList :: [BalanceAssertion] -> Value toEncodingList :: [BalanceAssertion] -> Encoding | |
Generic BalanceAssertion Source # | |
Defined in Hledger.Data.Types Associated Types type Rep BalanceAssertion :: Type -> Type Methods from :: BalanceAssertion -> Rep BalanceAssertion x to :: Rep BalanceAssertion x -> BalanceAssertion | |
Show BalanceAssertion Source # | |
Defined in Hledger.Data.Types Methods showsPrec :: Int -> BalanceAssertion -> ShowS show :: BalanceAssertion -> String showList :: [BalanceAssertion] -> ShowS | |
Eq BalanceAssertion Source # | |
Defined in Hledger.Data.Types Methods (==) :: BalanceAssertion -> BalanceAssertion -> Bool (/=) :: BalanceAssertion -> BalanceAssertion -> Bool | |
type Rep BalanceAssertion Source # | |
Defined in Hledger.Data.Types type Rep BalanceAssertion = D1 ('MetaData "BalanceAssertion" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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 SourcePos)))) |
The status of a transaction or posting, recorded with a status mark (nothing, !, or *). What these mean is ultimately user defined.
Instances
FromJSON Status | |
Defined in Hledger.Data.Json | |
ToJSON Status | |
Defined in Hledger.Data.Json Methods toEncoding :: Status -> Encoding toJSONList :: [Status] -> Value toEncodingList :: [Status] -> Encoding | |
Bounded Status Source # | |
Defined in Hledger.Data.Types | |
Enum Status Source # | |
Defined in Hledger.Data.Types | |
Generic Status Source # | |
Show Status Source # | |
Eq Status Source # | |
Ord Status Source # | |
type Rep Status Source # | |
Defined in Hledger.Data.Types type Rep Status = D1 ('MetaData "Status" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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 PostingType Source #
Constructors
RegularPosting | |
VirtualPosting | |
BalancedVirtualPosting |
Instances
FromJSON PostingType | |
Defined in Hledger.Data.Json | |
ToJSON PostingType | |
Defined in Hledger.Data.Json Methods toJSON :: PostingType -> Value toEncoding :: PostingType -> Encoding toJSONList :: [PostingType] -> Value toEncodingList :: [PostingType] -> Encoding | |
Generic PostingType Source # | |
Defined in Hledger.Data.Types Associated Types type Rep PostingType :: Type -> Type | |
Show PostingType Source # | |
Defined in Hledger.Data.Types Methods showsPrec :: Int -> PostingType -> ShowS show :: PostingType -> String showList :: [PostingType] -> ShowS | |
Eq PostingType Source # | |
Defined in Hledger.Data.Types | |
type Rep PostingType Source # | |
Defined in Hledger.Data.Types type Rep PostingType = D1 ('MetaData "PostingType" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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))) |
data MixedAmountKey Source #
Stores the CommoditySymbol of the Amount, along with the CommoditySymbol of the price, and its unit price if being used.
Constructors
MixedAmountKeyNoPrice !CommoditySymbol | |
MixedAmountKeyTotalPrice !CommoditySymbol !CommoditySymbol | |
MixedAmountKeyUnitPrice !CommoditySymbol !CommoditySymbol !Quantity |
Instances
Generic MixedAmountKey Source # | |
Defined in Hledger.Data.Types Associated Types type Rep MixedAmountKey :: Type -> Type | |
Show MixedAmountKey Source # | |
Defined in Hledger.Data.Types Methods showsPrec :: Int -> MixedAmountKey -> ShowS show :: MixedAmountKey -> String showList :: [MixedAmountKey] -> ShowS | |
Eq MixedAmountKey Source # | |
Defined in Hledger.Data.Types Methods (==) :: MixedAmountKey -> MixedAmountKey -> Bool (/=) :: MixedAmountKey -> MixedAmountKey -> Bool | |
Ord MixedAmountKey Source # | We don't auto-derive the Ord instance because it would give an undesired ordering. We want the keys to be sorted lexicographically: (1) By the primary commodity of the amount. (2) By the commodity of the price, with no price being first. (3) By the unit price, from most negative to most positive, with total prices before unit prices. For example, we would like the ordering to give MixedAmountKeyNoPrice X < MixedAmountKeyTotalPrice X Z < MixedAmountKeyNoPrice Y |
Defined in Hledger.Data.Types Methods compare :: MixedAmountKey -> MixedAmountKey -> Ordering (<) :: MixedAmountKey -> MixedAmountKey -> Bool (<=) :: MixedAmountKey -> MixedAmountKey -> Bool (>) :: MixedAmountKey -> MixedAmountKey -> Bool (>=) :: MixedAmountKey -> MixedAmountKey -> Bool max :: MixedAmountKey -> MixedAmountKey -> MixedAmountKey min :: MixedAmountKey -> MixedAmountKey -> MixedAmountKey | |
type Rep MixedAmountKey Source # | |
Defined in Hledger.Data.Types type Rep MixedAmountKey = D1 ('MetaData "MixedAmountKey" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" 'False) (C1 ('MetaCons "MixedAmountKeyNoPrice" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol)) :+: (C1 ('MetaCons "MixedAmountKeyTotalPrice" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol)) :+: C1 ('MetaCons "MixedAmountKeyUnitPrice" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Quantity))))) |
newtype MixedAmount Source #
Constructors
Mixed (Map MixedAmountKey Amount) |
Instances
Constructors
Amount | |
Fields
|
Instances
FromJSON Amount | |
Defined in Hledger.Data.Json | |
ToJSON Amount | |
Defined in Hledger.Data.Json Methods toEncoding :: Amount -> Encoding toJSONList :: [Amount] -> Value toEncodingList :: [Amount] -> Encoding | |
Generic Amount Source # | |
Num Amount | |
Show Amount Source # | |
Eq Amount Source # | |
Ord Amount Source # | |
type Rep Amount Source # | |
Defined in Hledger.Data.Types type Rep Amount = D1 ('MetaData "Amount" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" 'False) (C1 ('MetaCons "Amount" 'PrefixI 'True) ((S1 ('MetaSel ('Just "acommodity") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 CommoditySymbol) :*: S1 ('MetaSel ('Just "aquantity") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Quantity)) :*: (S1 ('MetaSel ('Just "astyle") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AmountStyle) :*: S1 ('MetaSel ('Just "aprice") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe AmountPrice))))) |
Constructors
Commodity | |
Fields
|
Instances
ToJSON Commodity | |
Defined in Hledger.Data.Json Methods toEncoding :: Commodity -> Encoding toJSONList :: [Commodity] -> Value toEncodingList :: [Commodity] -> Encoding | |
Generic Commodity Source # | |
Show Commodity Source # | |
Eq Commodity Source # | |
type Rep Commodity Source # | |
Defined in Hledger.Data.Types type Rep Commodity = D1 ('MetaData "Commodity" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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)))) |
type CommoditySymbol = Text Source #
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
data AmountPrecision Source #
The "display precision" for a hledger amount, by which we mean the number of decimal digits to display to the right of the decimal mark. This can be from 0 to 255 digits (the maximum supported by the Decimal library), or NaturalPrecision meaning "show all significant decimal digits".
Constructors
Precision !Word8 | |
NaturalPrecision |
Instances
data AmountStyle Source #
Display style for an amount.
Constructors
AmountStyle | |
Fields
|
Instances
FromJSON AmountStyle | |
Defined in Hledger.Data.Json | |
ToJSON AmountStyle | |
Defined in Hledger.Data.Json Methods toJSON :: AmountStyle -> Value toEncoding :: AmountStyle -> Encoding toJSONList :: [AmountStyle] -> Value toEncodingList :: [AmountStyle] -> Encoding | |
Generic AmountStyle Source # | |
Defined in Hledger.Data.Types Associated Types type Rep AmountStyle :: Type -> Type | |
Read AmountStyle Source # | |
Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS AmountStyle readList :: ReadS [AmountStyle] readPrec :: ReadPrec AmountStyle readListPrec :: ReadPrec [AmountStyle] | |
Show AmountStyle Source # | |
Defined in Hledger.Data.Types Methods showsPrec :: Int -> AmountStyle -> ShowS show :: AmountStyle -> String showList :: [AmountStyle] -> ShowS | |
Eq AmountStyle Source # | |
Defined in Hledger.Data.Types | |
Ord AmountStyle Source # | |
Defined in Hledger.Data.Types Methods compare :: AmountStyle -> AmountStyle -> Ordering (<) :: AmountStyle -> AmountStyle -> Bool (<=) :: AmountStyle -> AmountStyle -> Bool (>) :: AmountStyle -> AmountStyle -> Bool (>=) :: AmountStyle -> AmountStyle -> Bool max :: AmountStyle -> AmountStyle -> AmountStyle min :: AmountStyle -> AmountStyle -> AmountStyle | |
type Rep AmountStyle Source # | |
Defined in Hledger.Data.Types type Rep AmountStyle = D1 ('MetaData "AmountStyle" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" 'False) (C1 ('MetaCons "AmountStyle" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ascommodityside") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Side) :*: S1 ('MetaSel ('Just "ascommodityspaced") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "asprecision") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AmountPrecision) :*: (S1 ('MetaSel ('Just "asdecimalpoint") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Char)) :*: S1 ('MetaSel ('Just "asdigitgroups") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe DigitGroupStyle)))))) |
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
FromJSON AmountPrice | |
Defined in Hledger.Data.Json | |
ToJSON AmountPrice | |
Defined in Hledger.Data.Json Methods toJSON :: AmountPrice -> Value toEncoding :: AmountPrice -> Encoding toJSONList :: [AmountPrice] -> Value toEncodingList :: [AmountPrice] -> Encoding | |
Generic AmountPrice Source # | |
Defined in Hledger.Data.Types Associated Types type Rep AmountPrice :: Type -> Type | |
Show AmountPrice Source # | |
Defined in Hledger.Data.Types Methods showsPrec :: Int -> AmountPrice -> ShowS show :: AmountPrice -> String showList :: [AmountPrice] -> ShowS | |
Eq AmountPrice Source # | |
Defined in Hledger.Data.Types | |
Ord AmountPrice Source # | |
Defined in Hledger.Data.Types Methods compare :: AmountPrice -> AmountPrice -> Ordering (<) :: AmountPrice -> AmountPrice -> Bool (<=) :: AmountPrice -> AmountPrice -> Bool (>) :: AmountPrice -> AmountPrice -> Bool (>=) :: AmountPrice -> AmountPrice -> Bool max :: AmountPrice -> AmountPrice -> AmountPrice min :: AmountPrice -> AmountPrice -> AmountPrice | |
type Rep AmountPrice Source # | |
Defined in Hledger.Data.Types type Rep AmountPrice = D1 ('MetaData "AmountPrice" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" 'False) (C1 ('MetaCons "UnitPrice" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Amount)) :+: C1 ('MetaCons "TotalPrice" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Amount))) |
type DecimalMark = Char Source #
One of the decimal marks we support: either period or comma.
Instances
FromJSON Side | |
Defined in Hledger.Data.Json | |
ToJSON Side | |
Defined in Hledger.Data.Json Methods toEncoding :: Side -> Encoding toJSONList :: [Side] -> Value toEncodingList :: [Side] -> Encoding | |
Generic Side Source # | |
Read Side Source # | |
Defined in Hledger.Data.Types | |
Show Side Source # | |
Eq Side Source # | |
Ord Side Source # | |
type Rep Side Source # | |
Defined in Hledger.Data.Types type Rep Side = D1 ('MetaData "Side" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" 'False) (C1 ('MetaCons "L" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "R" 'PrefixI 'False) (U1 :: Type -> Type)) |
data AccountAlias Source #
Constructors
BasicAlias AccountName AccountName | |
RegexAlias Regexp Replacement |
Instances
ToJSON AccountAlias | |
Defined in Hledger.Data.Json Methods toJSON :: AccountAlias -> Value toEncoding :: AccountAlias -> Encoding toJSONList :: [AccountAlias] -> Value toEncodingList :: [AccountAlias] -> Encoding | |
Generic AccountAlias Source # | |
Defined in Hledger.Data.Types Associated Types type Rep AccountAlias :: Type -> Type | |
Read AccountAlias Source # | |
Defined in Hledger.Data.Types Methods readsPrec :: Int -> ReadS AccountAlias readList :: ReadS [AccountAlias] readPrec :: ReadPrec AccountAlias readListPrec :: ReadPrec [AccountAlias] | |
Show AccountAlias Source # | |
Defined in Hledger.Data.Types Methods showsPrec :: Int -> AccountAlias -> ShowS show :: AccountAlias -> String showList :: [AccountAlias] -> ShowS | |
Eq AccountAlias Source # | |
Defined in Hledger.Data.Types | |
Ord AccountAlias Source # | |
Defined in Hledger.Data.Types Methods compare :: AccountAlias -> AccountAlias -> Ordering (<) :: AccountAlias -> AccountAlias -> Bool (<=) :: AccountAlias -> AccountAlias -> Bool (>) :: AccountAlias -> AccountAlias -> Bool (>=) :: AccountAlias -> AccountAlias -> Bool max :: AccountAlias -> AccountAlias -> AccountAlias min :: AccountAlias -> AccountAlias -> AccountAlias | |
type Rep AccountAlias Source # | |
Defined in Hledger.Data.Types type Rep AccountAlias = D1 ('MetaData "AccountAlias" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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 AccountType Source #
Constructors
Asset | |
Liability | |
Equity | |
Revenue | |
Expense | |
Cash | a subtype of Asset - liquid assets to show in cashflow report |
Conversion | a subtype of Equity - account in which to generate conversion postings for transaction prices |
Instances
ToJSON AccountType | |
Defined in Hledger.Data.Json Methods toJSON :: AccountType -> Value toEncoding :: AccountType -> Encoding toJSONList :: [AccountType] -> Value toEncodingList :: [AccountType] -> Encoding | |
ToJSONKey AccountType | |
Defined in Hledger.Data.Json | |
Generic AccountType Source # | |
Defined in Hledger.Data.Types Associated Types type Rep AccountType :: Type -> Type | |
Show AccountType Source # | |
Defined in Hledger.Data.Types Methods showsPrec :: Int -> AccountType -> ShowS show :: AccountType -> String showList :: [AccountType] -> ShowS | |
Eq AccountType Source # | |
Defined in Hledger.Data.Types | |
Ord AccountType Source # | |
Defined in Hledger.Data.Types Methods compare :: AccountType -> AccountType -> Ordering (<) :: AccountType -> AccountType -> Bool (<=) :: AccountType -> AccountType -> Bool (>) :: AccountType -> AccountType -> Bool (>=) :: AccountType -> AccountType -> Bool max :: AccountType -> AccountType -> AccountType min :: AccountType -> AccountType -> AccountType | |
type Rep AccountType Source # | |
Defined in Hledger.Data.Types type Rep AccountType = D1 ('MetaData "AccountType" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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) :+: C1 ('MetaCons "Conversion" 'PrefixI 'False) (U1 :: Type -> Type)))) |
type AccountName = Text Source #
Constructors
NoInterval | |
Days Int | |
Weeks Int | |
Months Int | |
Quarters Int | |
Years Int | |
DayOfMonth Int | |
WeekdayOfMonth Int Int | |
DaysOfWeek [Int] | |
DayOfYear Int Int |
Instances
ToJSON Interval | |
Defined in Hledger.Data.Json Methods toEncoding :: Interval -> Encoding toJSONList :: [Interval] -> Value toEncodingList :: [Interval] -> Encoding | |
Generic Interval Source # | |
Show Interval Source # | |
Default Interval Source # | |
Defined in Hledger.Data.Types | |
Eq Interval Source # | |
Ord Interval Source # | |
Defined in Hledger.Data.Types | |
type Rep Interval Source # | |
Defined in Hledger.Data.Types type Rep Interval = D1 ('MetaData "Interval" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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 "DaysOfWeek" '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)))))) |
Constructors
DayPeriod Day | |
WeekPeriod Day | |
MonthPeriod Year Month | |
QuarterPeriod Year Quarter | |
YearPeriod Year | |
PeriodBetween Day Day | |
PeriodFrom Day | |
PeriodTo Day | |
PeriodAll |
Instances
ToJSON Period | |
Defined in Hledger.Data.Json Methods toEncoding :: Period -> Encoding toJSONList :: [Period] -> Value toEncodingList :: [Period] -> Encoding | |
Generic Period Source # | |
Show Period Source # | |
Default Period Source # | |
Defined in Hledger.Data.Types | |
Eq Period Source # | |
Ord Period Source # | |
type Rep Period Source # | |
Defined in Hledger.Data.Types type Rep Period = D1 ('MetaData "Period" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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))))) |
Constructors
DateSpan (Maybe Day) (Maybe Day) |
Instances
ToJSON DateSpan | |
Defined in Hledger.Data.Json Methods toEncoding :: DateSpan -> Encoding toJSONList :: [DateSpan] -> Value toEncodingList :: [DateSpan] -> Encoding | |
Generic DateSpan Source # | |
Show DateSpan | |
Default DateSpan Source # | |
Defined in Hledger.Data.Types | |
Eq DateSpan Source # | |
Ord DateSpan Source # | |
Defined in Hledger.Data.Types | |
type Rep DateSpan Source # | |
Defined in Hledger.Data.Types type Rep DateSpan = D1 ('MetaData "DateSpan" "Hledger.Data.Types" "hledger-lib-1.27.1-JB586fuzHSIKwG2PmW891j" '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)))) |
Constructors
PrimaryDate | |
SecondaryDate |
Instances
data SmartInterval Source #
Instances
Show SmartInterval Source # | |
Defined in Hledger.Data.Types Methods showsPrec :: Int -> SmartInterval -> ShowS show :: SmartInterval -> String showList :: [SmartInterval] -> ShowS |
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
SmartCompleteDate Day | |
SmartAssumeStart Year (Maybe Month) | |
SmartFromReference (Maybe Month) MonthDay | |
SmartMonth Month | |
SmartRelative Integer SmartInterval |
isAccountSubtypeOf :: AccountType -> AccountType -> Bool Source #
Check whether the first argument is a subtype of the second: either equal or one of the defined subtypes.
isDecimalMark :: Char -> Bool Source #
maCompare :: MixedAmount -> MixedAmount -> Ordering Source #
Compare two MixedAmounts, substituting 0 for the quantity of any missing commodities in either.