1 {-# LANGUAGE DeriveAnyClass #-}
3 module Literate.Accounting (
4 module Literate.Accounting,
5 module Literate.Accounting.Amount,
6 module Literate.Accounting.Quantity,
7 module Literate.Accounting.Unit,
10 import Literate.Accounting.Amount
11 import Literate.Accounting.Flow
12 import Literate.Accounting.Quantity
13 import Literate.Accounting.Unit
14 import Literate.Prelude
17 type Euro = Amount 100 (UnitName "€")
19 data Movement cause account amounts
21 { moveDescription :: Text
22 , moveDate :: LocalTime
23 , movePostings :: [Posting account amounts]
24 , moveCause :: Set cause
28 data Posting account amounts
30 { postingAccount :: account
31 , postingFlow :: Flow amounts
33 deriving (Eq, Show, NFData, Generic)
35 equalPostings :: account -> account -> amounts -> [Posting account amounts]
36 equalPostings from to amts =
38 { postingAccount = from
39 , postingFlow = FlowSource amts
43 , postingFlow = FlowDest amts