1 {-# LANGUAGE DeriveAnyClass #-}
2 {-# LANGUAGE OverloadedLists #-}
4 module Tests.Accounting where
6 import Literate.Accounting
7 import Literate.Invoice
8 import Literate.Organization
9 import Literate.Prelude
10 import Tests.Organization qualified as Orga
13 = CauseInvoice InvoiceId
14 deriving (Eq, Ord, Show, Generic, NFData)
17 = AccountOrga Organization
18 deriving (Eq, Ord, Show, Generic, NFData)
22 { amountsEuro :: Amount 100 (UnitName "€")
24 deriving (Eq, Ord, Show, Generic, NFData)
25 instance FromRational Amounts where
26 fromRational r = Amounts{amountsEuro = fromRational r}
28 accounting :: [Movement Cause Account Amounts]
31 { moveDescription = ""
33 , moveDate = "2026-01-27"
34 , movePostings = equalPostings (AccountOrga Orga.upwork) (AccountOrga Orga.julmInfo) 174.30
37 { moveDescription = ""
39 , moveDate = "2026-01-28"
40 , movePostings = equalPostings (AccountOrga Orga.nixosFoundationNGITeam) (AccountOrga Orga.julmInfo) 2000.00
43 { moveDescription = ""
45 , moveDate = "2026-01-29"
46 , movePostings = equalPostings (AccountOrga Orga.nixosFoundationNGITeam) (AccountOrga Orga.julmInfo) 4643.75