{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE OverloadedLists #-} module Tests.Accounting where import Literate.Accounting import Literate.Invoice import Literate.Organization import Literate.Prelude import Tests.Accounting.PlanComptableGénéral qualified as PCG import Tests.Organization qualified as Orga data Cause = CauseInvoice InvoiceId | CauseUrssaf {causeUrssafPeriod :: Period} deriving (Eq, Ord, Show, Generic, NFData) data Account = AccountOrga Organization | AccountPCG {accountPCG :: PCG.Compte, account :: Account} deriving (Eq, Ord, Show, Generic, NFData) -- 791 - 1677.00 -- 578 - FORMATION PROF. OBLIGATOIRE 14.00 data Amounts = Amounts { amountsEuro :: Amount 100 (UnitName "€") } deriving (Eq, Ord, Show, Generic, NFData) instance FromRational Amounts where fromRational r = Amounts{amountsEuro = fromRational r} accounting :: [Movement Cause Account Amounts] accounting = [ Movement { moveDescription = "" , moveCause = [] , moveDate = "2026-01-27" , movePostings = equalPostings (AccountOrga Orga.upwork) (AccountOrga Orga.julmInfo) 174.30 } , Movement { moveDescription = "" , moveCause = [] , moveDate = "2026-01-28" , movePostings = equalPostings (AccountOrga Orga.nixosFoundationNGITeam) (AccountOrga Orga.julmInfo) 2000.00 } , Movement { moveDescription = "" , moveCause = [] , moveDate = "2026-01-29" , movePostings = equalPostings (AccountOrga Orga.nixosFoundationNGITeam) (AccountOrga Orga.julmInfo) 4643.75 } , Movement { moveDescription = "Cotisation URSSAF" , moveCause = [CauseUrssaf{causeUrssafPeriod = Period{periodBeginning = "2026-01-01", periodEnd = "2026-01-31"}}] , moveDate = "2026-02-01" , movePostings = [ Posting { postingAccount = AccountOrga Orga.julmInfo , postingFlow = FlowSource 1691.00 } , Posting { postingAccount = AccountPCG{accountPCG = PCG.urssaf791, account = AccountOrga Orga.urssaf} , postingFlow = FlowDest 1677.00 } , Posting { postingAccount = AccountPCG{accountPCG = PCG.urssaf578, account = AccountOrga Orga.urssaf} , postingFlow = FlowDest 14.00 } ] } ]