hledger-0.4: A ledger-compatible text-based accounting tool.Source codeContentsIndex
Ledger.Types
Description
This is the next layer up from Ledger.Utils. All main data types are defined here to avoid import cycles; see the corresponding modules for documentation.
Synopsis
type SmartDate = (String, String, String)
data DateSpan = DateSpan (Maybe Day) (Maybe Day)
data Interval
= NoInterval
| Daily
| Weekly
| Monthly
| Quarterly
| Yearly
type AccountName = String
data Side
= L
| R
data Commodity = Commodity {
symbol :: String
side :: Side
spaced :: Bool
comma :: Bool
precision :: Int
}
data Amount = Amount {
commodity :: Commodity
quantity :: Double
price :: Maybe MixedAmount
}
newtype MixedAmount = Mixed [Amount]
data TransactionType
= RegularTransaction
| VirtualTransaction
| BalancedVirtualTransaction
data RawTransaction = RawTransaction {
tstatus :: Bool
taccount :: AccountName
tamount :: MixedAmount
tcomment :: String
rttype :: TransactionType
}
data ModifierEntry = ModifierEntry {
valueexpr :: String
m_transactions :: [RawTransaction]
}
data PeriodicEntry = PeriodicEntry {
periodicexpr :: String
p_transactions :: [RawTransaction]
}
data Entry = Entry {
edate :: Day
estatus :: Bool
ecode :: String
edescription :: String
ecomment :: String
etransactions :: [RawTransaction]
epreceding_comment_lines :: String
}
data HistoricalPrice = HistoricalPrice {
hdate :: Day
hsymbol1 :: String
hsymbol2 :: String
hprice :: Double
}
data RawLedger = RawLedger {
modifier_entries :: [ModifierEntry]
periodic_entries :: [PeriodicEntry]
entries :: [Entry]
open_timelog_entries :: [TimeLogEntry]
historical_prices :: [HistoricalPrice]
final_comment_lines :: String
}
data TimeLogEntry = TimeLogEntry {
tlcode :: Char
tldatetime :: LocalTime
tlcomment :: String
}
data TimeLog = TimeLog {
timelog_entries :: [TimeLogEntry]
}
data Transaction = Transaction {
entryno :: Int
status :: Bool
date :: Day
description :: String
account :: AccountName
amount :: MixedAmount
ttype :: TransactionType
}
data Account = Account {
aname :: AccountName
atransactions :: [Transaction]
abalance :: MixedAmount
}
data Ledger = Ledger {
rawledgertext :: String
rawledger :: RawLedger
accountnametree :: Tree AccountName
accountmap :: Map AccountName Account
}
Documentation
type SmartDate = (String, String, String)Source
data DateSpan Source
Constructors
DateSpan (Maybe Day) (Maybe Day)
show/hide Instances
data Interval Source
Constructors
NoInterval
Daily
Weekly
Monthly
Quarterly
Yearly
show/hide Instances
type AccountName = StringSource
data Side Source
Constructors
L
R
show/hide Instances
data Commodity Source
Constructors
Commodity
symbol :: Stringthe commodity's symbol
side :: Sideshould the symbol appear on the left or the right
spaced :: Boolshould there be a space between symbol and quantity
comma :: Boolshould thousands be comma-separated
precision :: Intnumber of decimal places to display
show/hide Instances
data Amount Source
Constructors
Amount
commodity :: Commodity
quantity :: Double
price :: Maybe MixedAmountoptional per-unit price for this amount at the time of entry
show/hide Instances
newtype MixedAmount Source
Constructors
Mixed [Amount]
show/hide Instances
data TransactionType Source
Constructors
RegularTransaction
VirtualTransaction
BalancedVirtualTransaction
show/hide Instances
data RawTransaction Source
Constructors
RawTransaction
tstatus :: Bool
taccount :: AccountName
tamount :: MixedAmount
tcomment :: String
rttype :: TransactionType
show/hide Instances
data ModifierEntry Source
a ledger modifier entry. Currently ignored.
Constructors
ModifierEntry
valueexpr :: String
m_transactions :: [RawTransaction]
show/hide Instances
data PeriodicEntry Source
a ledger periodic entry. Currently ignored.
Constructors
PeriodicEntry
periodicexpr :: String
p_transactions :: [RawTransaction]
show/hide Instances
data Entry Source
Constructors
Entry
edate :: Day
estatus :: Bool
ecode :: String
edescription :: String
ecomment :: String
etransactions :: [RawTransaction]
epreceding_comment_lines :: String
show/hide Instances
data HistoricalPrice Source
Constructors
HistoricalPrice
hdate :: Day
hsymbol1 :: String
hsymbol2 :: String
hprice :: Double
show/hide Instances
data RawLedger Source
Constructors
RawLedger
modifier_entries :: [ModifierEntry]
periodic_entries :: [PeriodicEntry]
entries :: [Entry]
open_timelog_entries :: [TimeLogEntry]
historical_prices :: [HistoricalPrice]
final_comment_lines :: String
show/hide Instances
data TimeLogEntry Source
Constructors
TimeLogEntry
tlcode :: Char
tldatetime :: LocalTime
tlcomment :: String
show/hide Instances
data TimeLog Source
Constructors
TimeLog
timelog_entries :: [TimeLogEntry]
show/hide Instances
data Transaction Source
Constructors
Transaction
entryno :: Int
status :: Bool
date :: Day
description :: String
account :: AccountName
amount :: MixedAmount
ttype :: TransactionType
show/hide Instances
data Account Source
Constructors
Account
aname :: AccountName
atransactions :: [Transaction]
abalance :: MixedAmount
show/hide Instances
data Ledger Source
Constructors
Ledger
rawledgertext :: String
rawledger :: RawLedger
accountnametree :: Tree AccountName
accountmap :: Map AccountName Account
show/hide Instances
Produced by Haddock version 2.6.0