Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides data definitions and functions for trial balances.
Synopsis
- newtype TrialBalance (precision :: Nat) account event = TrialBalance {
- trialBalanceItems :: [TrialBalanceItem precision account event]
- data TrialBalanceItem (precision :: Nat) account event = TrialBalanceItem {
- trialBalanceItemLedger :: !(Ledger precision account event)
- trialBalanceItemBalance :: !(Balance precision)
- trialBalanceItemAmount :: KnownNat precision => TrialBalanceItem precision account event -> Amount precision
- prepareTrialBalance :: KnownNat precision => GeneralLedger precision account event -> TrialBalance precision account event
- mkTrialBalanceItem :: KnownNat precision => Ledger precision account event -> TrialBalanceItem precision account event
- trialBalanceTotals :: KnownNat precision => TrialBalance precision account event -> (Balance precision, Balance precision)
Documentation
newtype TrialBalance (precision :: Nat) account event Source #
Data definition for a trial balance.
TrialBalance | |
|
Instances
(Eq account, Eq event) => Eq (TrialBalance precision account event) Source # | |
Defined in Haspara.Accounting.TrialBalance (==) :: TrialBalance precision account event -> TrialBalance precision account event -> Bool # (/=) :: TrialBalance precision account event -> TrialBalance precision account event -> Bool # | |
(KnownNat precision, Show account, Show event) => Show (TrialBalance precision account event) Source # | |
Defined in Haspara.Accounting.TrialBalance showsPrec :: Int -> TrialBalance precision account event -> ShowS # show :: TrialBalance precision account event -> String # showList :: [TrialBalance precision account event] -> ShowS # | |
Generic (TrialBalance precision account event) Source # | |
Defined in Haspara.Accounting.TrialBalance type Rep (TrialBalance precision account event) :: Type -> Type # from :: TrialBalance precision account event -> Rep (TrialBalance precision account event) x # to :: Rep (TrialBalance precision account event) x -> TrialBalance precision account event # | |
(KnownNat precision, ToJSON account, ToJSON event) => ToJSON (TrialBalance precision account event) Source # | |
Defined in Haspara.Accounting.TrialBalance toJSON :: TrialBalance precision account event -> Value # toEncoding :: TrialBalance precision account event -> Encoding # toJSONList :: [TrialBalance precision account event] -> Value # toEncodingList :: [TrialBalance precision account event] -> Encoding # | |
(KnownNat precision, FromJSON account, FromJSON event) => FromJSON (TrialBalance precision account event) Source # | |
Defined in Haspara.Accounting.TrialBalance parseJSON :: Value -> Parser (TrialBalance precision account event) # parseJSONList :: Value -> Parser [TrialBalance precision account event] # | |
type Rep (TrialBalance precision account event) Source # | |
Defined in Haspara.Accounting.TrialBalance type Rep (TrialBalance precision account event) = D1 ('MetaData "TrialBalance" "Haspara.Accounting.TrialBalance" "haspara-0.0.0.4-91kyQ1gsJrx6JOOKY5ajCi" 'True) (C1 ('MetaCons "TrialBalance" 'PrefixI 'True) (S1 ('MetaSel ('Just "trialBalanceItems") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TrialBalanceItem precision account event]))) |
data TrialBalanceItem (precision :: Nat) account event Source #
Data definition for a trial balance item.
TrialBalanceItem | |
|
Instances
(Eq account, Eq event) => Eq (TrialBalanceItem precision account event) Source # | |
Defined in Haspara.Accounting.TrialBalance (==) :: TrialBalanceItem precision account event -> TrialBalanceItem precision account event -> Bool # (/=) :: TrialBalanceItem precision account event -> TrialBalanceItem precision account event -> Bool # | |
(KnownNat precision, Show account, Show event) => Show (TrialBalanceItem precision account event) Source # | |
Defined in Haspara.Accounting.TrialBalance showsPrec :: Int -> TrialBalanceItem precision account event -> ShowS # show :: TrialBalanceItem precision account event -> String # showList :: [TrialBalanceItem precision account event] -> ShowS # | |
Generic (TrialBalanceItem precision account event) Source # | |
Defined in Haspara.Accounting.TrialBalance type Rep (TrialBalanceItem precision account event) :: Type -> Type # from :: TrialBalanceItem precision account event -> Rep (TrialBalanceItem precision account event) x # to :: Rep (TrialBalanceItem precision account event) x -> TrialBalanceItem precision account event # | |
(KnownNat precision, ToJSON account, ToJSON event) => ToJSON (TrialBalanceItem precision account event) Source # | |
Defined in Haspara.Accounting.TrialBalance toJSON :: TrialBalanceItem precision account event -> Value # toEncoding :: TrialBalanceItem precision account event -> Encoding # toJSONList :: [TrialBalanceItem precision account event] -> Value # toEncodingList :: [TrialBalanceItem precision account event] -> Encoding # | |
(KnownNat precision, FromJSON account, FromJSON event) => FromJSON (TrialBalanceItem precision account event) Source # | |
Defined in Haspara.Accounting.TrialBalance parseJSON :: Value -> Parser (TrialBalanceItem precision account event) # parseJSONList :: Value -> Parser [TrialBalanceItem precision account event] # | |
type Rep (TrialBalanceItem precision account event) Source # | |
Defined in Haspara.Accounting.TrialBalance type Rep (TrialBalanceItem precision account event) = D1 ('MetaData "TrialBalanceItem" "Haspara.Accounting.TrialBalance" "haspara-0.0.0.4-91kyQ1gsJrx6JOOKY5ajCi" 'False) (C1 ('MetaCons "TrialBalanceItem" 'PrefixI 'True) (S1 ('MetaSel ('Just "trialBalanceItemLedger") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Ledger precision account event)) :*: S1 ('MetaSel ('Just "trialBalanceItemBalance") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Balance precision)))) |
trialBalanceItemAmount :: KnownNat precision => TrialBalanceItem precision account event -> Amount precision Source #
prepareTrialBalance :: KnownNat precision => GeneralLedger precision account event -> TrialBalance precision account event Source #
Given a general ledger, prepares the trial balance.
mkTrialBalanceItem :: KnownNat precision => Ledger precision account event -> TrialBalanceItem precision account event Source #
Converts a Ledger
to a TrialBalanceItem
.
trialBalanceTotals :: KnownNat precision => TrialBalance precision account event -> (Balance precision, Balance precision) Source #
Computes the trial balance totals as a 2-tuple of total debits and total credits.