haspara-0.0.0.8: A library providing definitions to work with monetary values.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Haspara.Accounting.TrialBalance

Description

This module provides data definitions and functions for trial balances.

Synopsis

Documentation

newtype TrialBalance (precision :: Nat) account event Source #

Data definition for a trial balance.

Constructors

TrialBalance 

Fields

Instances

Instances details
(KnownNat precision, FromJSON account, FromJSON event) => FromJSON (TrialBalance precision account event) Source # 
Instance details

Defined in Haspara.Accounting.TrialBalance

Methods

parseJSON :: Value -> Parser (TrialBalance precision account event) #

parseJSONList :: Value -> Parser [TrialBalance precision account event] #

(KnownNat precision, ToJSON account, ToJSON event) => ToJSON (TrialBalance precision account event) Source # 
Instance details

Defined in Haspara.Accounting.TrialBalance

Methods

toJSON :: TrialBalance precision account event -> Value #

toEncoding :: TrialBalance precision account event -> Encoding #

toJSONList :: [TrialBalance precision account event] -> Value #

toEncodingList :: [TrialBalance precision account event] -> Encoding #

Generic (TrialBalance precision account event) Source # 
Instance details

Defined in Haspara.Accounting.TrialBalance

Associated Types

type Rep (TrialBalance precision account event) :: Type -> Type #

Methods

from :: TrialBalance precision account event -> Rep (TrialBalance precision account event) x #

to :: Rep (TrialBalance precision account event) x -> TrialBalance precision account event #

(KnownNat precision, Show account, Show event) => Show (TrialBalance precision account event) Source # 
Instance details

Defined in Haspara.Accounting.TrialBalance

Methods

showsPrec :: Int -> TrialBalance precision account event -> ShowS #

show :: TrialBalance precision account event -> String #

showList :: [TrialBalance precision account event] -> ShowS #

(Eq account, Eq event) => Eq (TrialBalance precision account event) Source # 
Instance details

Defined in Haspara.Accounting.TrialBalance

Methods

(==) :: TrialBalance precision account event -> TrialBalance precision account event -> Bool #

(/=) :: TrialBalance precision account event -> TrialBalance precision account event -> Bool #

type Rep (TrialBalance precision account event) Source # 
Instance details

Defined in Haspara.Accounting.TrialBalance

type Rep (TrialBalance precision account event) = D1 ('MetaData "TrialBalance" "Haspara.Accounting.TrialBalance" "haspara-0.0.0.8-83lIPqySeX32MZXT98KoZ2" '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.

Constructors

TrialBalanceItem 

Fields

Instances

Instances details
(KnownNat precision, FromJSON account, FromJSON event) => FromJSON (TrialBalanceItem precision account event) Source # 
Instance details

Defined in Haspara.Accounting.TrialBalance

Methods

parseJSON :: Value -> Parser (TrialBalanceItem precision account event) #

parseJSONList :: Value -> Parser [TrialBalanceItem precision account event] #

(KnownNat precision, ToJSON account, ToJSON event) => ToJSON (TrialBalanceItem precision account event) Source # 
Instance details

Defined in Haspara.Accounting.TrialBalance

Methods

toJSON :: TrialBalanceItem precision account event -> Value #

toEncoding :: TrialBalanceItem precision account event -> Encoding #

toJSONList :: [TrialBalanceItem precision account event] -> Value #

toEncodingList :: [TrialBalanceItem precision account event] -> Encoding #

Generic (TrialBalanceItem precision account event) Source # 
Instance details

Defined in Haspara.Accounting.TrialBalance

Associated Types

type Rep (TrialBalanceItem precision account event) :: Type -> Type #

Methods

from :: TrialBalanceItem precision account event -> Rep (TrialBalanceItem precision account event) x #

to :: Rep (TrialBalanceItem precision account event) x -> TrialBalanceItem precision account event #

(KnownNat precision, Show account, Show event) => Show (TrialBalanceItem precision account event) Source # 
Instance details

Defined in Haspara.Accounting.TrialBalance

Methods

showsPrec :: Int -> TrialBalanceItem precision account event -> ShowS #

show :: TrialBalanceItem precision account event -> String #

showList :: [TrialBalanceItem precision account event] -> ShowS #

(Eq account, Eq event) => Eq (TrialBalanceItem precision account event) Source # 
Instance details

Defined in Haspara.Accounting.TrialBalance

Methods

(==) :: TrialBalanceItem precision account event -> TrialBalanceItem precision account event -> Bool #

(/=) :: TrialBalanceItem precision account event -> TrialBalanceItem precision account event -> Bool #

type Rep (TrialBalanceItem precision account event) Source # 
Instance details

Defined in Haspara.Accounting.TrialBalance

type Rep (TrialBalanceItem precision account event) = D1 ('MetaData "TrialBalanceItem" "Haspara.Accounting.TrialBalance" "haspara-0.0.0.8-83lIPqySeX32MZXT98KoZ2" '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 #

Returns the amount of the trial balance item. This is a simple conversion from Balance to Amount.

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.