1 {-# LANGUAGE DeriveAnyClass #-}
3 module Literate.Accounting (
4 module Literate.Accounting,
5 module Literate.Accounting.Amount,
6 module Literate.Accounting.Flow,
7 module Literate.Accounting.Quantity,
8 module Literate.Accounting.Unit,
11 import Literate.Accounting.Amount
12 import Literate.Accounting.Flow
13 import Literate.Accounting.Quantity
14 import Literate.Accounting.Unit
15 import Literate.Prelude
18 type Euro = Amount 100 (UnitName "€")
20 data Movement cause account amounts
22 { moveDescription :: Text
23 , moveDate :: LocalTime
24 , movePostings :: [Posting account amounts]
25 , moveCause :: Set cause
29 data Posting account amounts
31 { postingAccount :: account
32 , postingFlow :: Flow amounts
34 deriving (Eq, Show, NFData, Generic)
36 equalPostings :: account -> account -> amounts -> [Posting account amounts]
37 equalPostings from to amts =
39 { postingAccount = from
40 , postingFlow = FlowSource amts
44 , postingFlow = FlowDest amts