summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/Main.hs64
-rw-r--r--rdcapsis.cabal (renamed from wayligmative.cabal)4
2 files changed, 46 insertions, 22 deletions
diff --git a/app/Main.hs b/app/Main.hs
index 7b4551a..bc8ad37 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -20,25 +20,49 @@ import Import.Ing.SavingsAccountCsv qualified
20import System.IO (IOMode (ReadMode), withFile) 20import System.IO (IOMode (ReadMode), withFile)
21import Text.Pretty.Simple (pPrint) 21import Text.Pretty.Simple (pPrint)
22 22
23-- data AccountType = Asset | Equity | Liability | Expense | Income 23data AccountType = Asset | Equity | Liability | Expense | Income
24-- 24
25-- data TxAction = Inc | Dec 25data TxAction = Inc | Dec
26-- 26
27-- txAopp :: TxAction -> TxAction 27txAopp :: TxAction -> TxAction
28-- txaOpp Inc = Dec 28txaOpp Inc = Dec
29-- txaOpp Dec = Inc 29txaOpp Dec = Inc
30-- 30
31-- onDebit :: AccountType -> TxAction 31onDebit :: AccountType -> TxAction
32-- onDebit Asset = Inc 32onDebit Asset = Inc
33-- onDebit Equity = Dec 33onDebit Equity = Dec
34-- onDebit Liability = Dec 34onDebit Liability = Dec
35-- onDebit Expense = Inc 35onDebit Expense = Inc
36-- onDebit Income = Dec 36onDebit Income = Dec
37-- 37
38-- onCredit :: AccountType -> TxAction 38onCredit :: AccountType -> TxAction
39-- onCredit = txaOpp . onDebit 39onCredit = txaOpp . onDebit
40-- 40
41-- data Tx = Tx { txDebit :: [(Account, Decimal)], txCredit :: [(Account, Decimal)] } deriving Show 41data Ledger = [LedgerEntry]
42
43data LedgerEntry = TxEntry Tx | BalAssertEntry BalAssert
44
45-- A balance assertion is only valid when all transactions before it have been
46-- cleared and the balance of the account agrees with the amount in the
47-- assertion.
48data BalAssert = BalAssert {
49 amount :: Decimal,
50 tags :: Tags }
51
52data Tx = Tx {
53 txClearedAt :: Maybe UTCTime,
54 txCommodity :: Commodity,
55 txDebit :: [(Account, Commodity, Rate, Amount)],
56 txCredit :: [(Account, Commodity, Rate, Amount)]
57 -- Description
58 -- Type:
59 } deriving Show
60
61data Account = Account {
62 acName :: [T.Text],
63 acCommodity :: Commodity,
64 acBalance :: Amount }
65
42data Choice = Red | Blue | Green 66data Choice = Red | Blue | Green
43 deriving (Show) 67 deriving (Show)
44 68
@@ -91,7 +115,7 @@ theApp =
91 115
92main :: IO () 116main :: IO ()
93main = do 117main = do
94 let filename = "/home/rutgerbrf/Code/P/wayligmative/test3.csv" 118 let filename = "/home/rutgerbrf/Code/P/rdcapsis/test3.csv"
95 putStrLn $ "Reading " ++ filename 119 putStrLn $ "Reading " ++ filename
96 withFile filename ReadMode $ \h -> do 120 withFile filename ReadMode $ \h -> do
97 entries <- Import.Ing.CurrentAccountCsv.readFile h 121 entries <- Import.Ing.CurrentAccountCsv.readFile h
diff --git a/wayligmative.cabal b/rdcapsis.cabal
index 99c811d..5814782 100644
--- a/wayligmative.cabal
+++ b/rdcapsis.cabal
@@ -1,11 +1,11 @@
1cabal-version: 3.0 1cabal-version: 3.0
2name: wayligmative 2name: rdcapsis
3version: 0.1.0.0 3version: 0.1.0.0
4maintainer: [email protected] 4maintainer: [email protected]
5author: Rutger Broekhoff 5author: Rutger Broekhoff
6build-type: Simple 6build-type: Simple
7 7
8executable wayligmative 8executable rdcapsis
9 main-is: Main.hs 9 main-is: Main.hs
10 hs-source-dirs: app 10 hs-source-dirs: app
11 other-modules: 11 other-modules: