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.Accounting.PlanComptableGénéral qualified as PCG
11 import Tests.Organization qualified as Orga
14 = CauseInvoice InvoiceId
15 | CauseUrssaf {causeUrssafPeriod :: Period}
16 deriving (Eq, Ord, Show, Generic, NFData)
19 = AccountOrga Organization
20 | AccountPCG {accountPCG :: PCG.Compte, account :: Account}
21 deriving (Eq, Ord, Show, Generic, NFData)
24 -- 578 - FORMATION PROF. OBLIGATOIRE 14.00
28 { amountsEuro :: Amount 100 (UnitName "€")
30 deriving (Eq, Ord, Show, Generic, NFData)
31 instance FromRational Amounts where
32 fromRational r = Amounts{amountsEuro = fromRational r}
34 accounting :: [Movement Cause Account Amounts]
37 { moveDescription = ""
39 , moveDate = "2026-01-27"
40 , movePostings = equalPostings (AccountOrga Orga.upwork) (AccountOrga Orga.julmInfo) 174.30
43 { moveDescription = ""
45 , moveDate = "2026-01-28"
46 , movePostings = equalPostings (AccountOrga Orga.nixosFoundationNGITeam) (AccountOrga Orga.julmInfo) 2000.00
49 { moveDescription = ""
51 , moveDate = "2026-01-29"
52 , movePostings = equalPostings (AccountOrga Orga.nixosFoundationNGITeam) (AccountOrga Orga.julmInfo) 4643.75
55 { moveDescription = "Cotisation URSSAF"
56 , moveCause = [CauseUrssaf{causeUrssafPeriod = Period{periodBeginning = "2026-01-01", periodEnd = "2026-01-31"}}]
57 , moveDate = "2026-02-01"
60 { postingAccount = AccountOrga Orga.julmInfo
61 , postingFlow = FlowSource 1691.00
64 { postingAccount = AccountPCG{accountPCG = PCG.urssaf791, account = AccountOrga Orga.urssaf}
65 , postingFlow = FlowDest 1677.00
68 { postingAccount = AccountPCG{accountPCG = PCG.urssaf578, account = AccountOrga Orga.urssaf}
69 , postingFlow = FlowDest 14.00