Commit Graph

323 Commits

Author SHA1 Message Date
Simon Michael
4c97ca5514 smarter handling of priced amounts. Normalising and some basic arithmetic now preserve prices.
Currently, amounts with the same commodity but different prices are kept separate. Useful ?
2008-11-22 20:30:43 +00:00
Simon Michael
54ee68976b support converting amounts to cost, using their saved price.
And do this by default for auto-balancing transactions, as ledger seems to.
2008-11-22 20:32:58 +00:00
Simon Michael
54b164a7ab nullamt and nullmixedamt 2008-11-22 17:21:49 +00:00
Simon Michael
52ff46a326 --basis/-B flag, to show all priced amounts on cost basis. Also a --cost alias. 2008-11-22 20:35:17 +00:00
Simon Michael
2d49bc4100 haddock 2008-11-08 22:04:59 +00:00
Simon Michael
8939c1f7b7 samesymbol cleanup 2008-11-08 22:49:14 +00:00
Simon Michael
7362fbd730 begin smart date parsing 2008-11-22 12:18:19 +00:00
tim
60b4610c2f Fix bug in parsing of TimeLogs, and enabled a test case for them 2008-11-12 07:17:31 +00:00
Simon Michael
c46189a75b filter by account patterns when caching a ledger, fix balance report totals 2008-11-22 05:51:48 +00:00
Simon Michael
ea5a87815b rename setAmountDisplayPrefs to canonicaliseAmounts 2008-11-08 22:02:38 +00:00
tim
514f015849 Implemented types for dates and datetimes
This patch replaces the strings used in the Entry, TimeLogEntry, and Transaction
records with real types. Rather than use the inbuild system date and time types
directly, two custom types have been implemented that wrap UTCTime: Date and
DateTime. A minimal API for these has been added.
2008-11-11 12:34:05 +00:00
Simon Michael
a7b3e0d38d define nullentry, nullrawtxn 2008-11-08 20:25:51 +00:00
tim
3a35847aa1 Fix some signatures for functions that really take dates 2008-11-10 22:05:40 +00:00
Simon Michael
33f06f334e first attempt at storing per-amount price 2008-11-22 16:26:01 +00:00
Simon Michael
8e412b1be3 autoamt -> missingamt 2008-10-18 20:29:42 +00:00
Simon Michael
f3ba1eda0c amount cleanup 2008-10-18 20:27:25 +00:00
Simon Michael
0f2c8542fc if we happen to be showing a not-yet-auto-balanced entry, hide the AUTO marker 2008-10-16 03:55:38 +00:00
Simon Michael
47cf7c3eb6 gather match functions in one place 2008-11-22 05:48:56 +00:00
Simon Michael
83d36dae63 more tests cleanup, and start to move match functions to Utils 2008-11-22 04:44:12 +00:00
Simon Michael
96e0f70a38 use the greatest precision detected for a commodity, not the first one 2008-11-08 21:44:41 +00:00
Simon Michael
5c0ff1daa5 separate confusing "normalise" uses, begin to fix broken amount display prefs 2008-10-18 21:10:08 +00:00
Simon Michael
17ab6cb0ab support --real/-R flag 2008-10-16 09:50:16 +00:00
Simon Michael
57603db7b9 support -C/--cleared flag to filter by entry status (not transaction status) 2008-10-16 09:04:44 +00:00
Simon Michael
0b23598138 remove the hard-coded rate from Commodity 2008-10-18 10:46:49 +00:00
Simon Michael
80beac7d43 try making MixedAmount a full newtype, to avoid TypeSynonymInstances error 2008-10-18 10:38:01 +00:00
Simon Michael
2d41368b8b introduce MixedAmount 2008-10-17 00:57:10 +00:00
Simon Michael
f865ab1c1c code cleanups 2008-10-18 00:52:49 +00:00
Simon Michael
db8b00d6e5 doc update 2008-10-16 03:27:43 +00:00
Simon Michael
cc81700d2a normalise amounts after adding them, why not 2008-10-18 09:02:00 +00:00
Simon Michael
ebcf695240 simplify, remove dead code 2008-10-18 09:02:19 +00:00
Simon Michael
648887b36f use MixedAmount everywhere. seems to work. 2008-10-18 08:39:08 +00:00
Simon Michael
4f83326f14 display virtual accounts with appropriate brackets in register report 2008-10-16 06:12:40 +00:00
Simon Michael
c444b02349 a first cut at mixed amounts. Accounts have a MixedAmount balance, displayed on one line 2008-10-17 03:14:23 +00:00
Simon Michael
d31ba41703 rename and unify the autofill stuff 2008-10-18 06:45:02 +00:00
Simon Michael
a304ad3ca6 and more code cleanups. 2008-10-18 04:15:43 +00:00
Simon Michael
861e2beb1c clearer error message when we can't balance an entry 2008-10-16 04:00:45 +00:00
Simon Michael
0cfbced165 and allow parsing of mixed-commodity entries, as long as we don't have to balance them 2008-10-17 03:32:00 +00:00
Simon Michael
17ceb9039b rename sumLedgerTransactions 2008-10-16 08:48:25 +00:00
Simon Michael
405f71c389 ignore virtual transactions when auto-balancing 2008-10-16 06:52:35 +00:00
Simon Michael
9acf11de4d when we fail because of more than one missing amount in an entry, show the full entry 2008-10-16 03:56:43 +00:00
Simon Michael
a1d10691a3 more code cleanups 2008-10-18 02:43:13 +00:00
Simon Michael
dce8fd0dde parse virtual and balanced virtual transactions, refactor register and transaction output 2008-10-16 06:00:46 +00:00
Simon Michael
014723497f allow any non-whitespace in account names, perhaps avoiding misleading missing amounts errors 2008-10-16 04:17:25 +00:00
Simon Michael
490a81577f make patterns case-insensitive 2008-10-15 22:18:20 +00:00
Simon Michael
ba67e4c0a9 remove dead code 2008-10-15 22:18:05 +00:00
Simon Michael
4679003b83 for debugging 2008-10-15 21:10:59 +00:00
Simon Michael
5f1bec0b60 fix the always-on thousands comma 2008-10-15 19:54:35 +00:00
Simon Michael
ea2a418811 fix a bug in commodity detection 2008-10-15 19:28:36 +00:00
Simon Michael
529393ae49 ledger 2.6-style account name eliding 2008-10-15 19:14:34 +00:00
Simon Michael
7dea3bc201 hide the assets:time account in timelog reports 2008-10-15 19:11:06 +00:00
Simon Michael
3bcc3277ac the parser was too strict about decimal places when balance-checking 2008-10-15 18:01:49 +00:00
Simon Michael
5fcab59414 support negative patterns and ledger's special balance report account matching rule 2008-10-15 17:04:47 +00:00
Simon Michael
3dca1ca548 make isZeroAmount more robust, fix timelog balance total 2008-10-15 07:06:02 +00:00
Simon Michael
f99963786c require a balanced entry to have just one commodity, for now 2008-10-15 07:00:47 +00:00
Simon Michael
3138046744 clarify entry balance checking and show the full entry when unbalanced 2008-10-15 06:47:47 +00:00
Simon Michael
9f341b0279 make show entry more useful 2008-10-15 06:47:00 +00:00
Simon Michael
1e3291af48 focus on tests in Tests.hs, clean up 2008-10-15 06:32:52 +00:00
Simon Michael
7a69efec70 match full account name when (any) account pattern contains :, as ledger seems to 2008-10-15 06:32:42 +00:00
Simon Michael
760befef89 more cleanups 2008-10-15 06:00:10 +00:00
Simon Michael
8d70ed87ea small cleanups 2008-10-15 02:11:30 +00:00
Simon Michael
3dc5f54f39 display thousands with commas when appropriate 2008-10-15 01:06:05 +00:00
Simon Michael
aac492c746 rename amount show functions 2008-10-15 00:37:38 +00:00
Simon Michael
782d05aa61 use the display settings of the first amount detected in each commodity 2008-10-15 00:34:02 +00:00
Simon Michael
b1e2a83556 comment update 2008-10-15 00:33:15 +00:00
Simon Michael
042a8179e8 always give a proper parse error for numbers, remember precisions and thousands separators
(per amount for now)
2008-10-14 23:14:31 +00:00
Simon Michael
4efdda25b4 replace Currency with a more flexible, ledger-style Commodity 2008-10-12 21:52:48 +00:00
Simon Michael
80ef214f79 nicer ghci/repl usage, update docs 2008-10-12 09:17:21 +00:00
Simon Michael
a9f021eebe slightly less verbose Show Ledger 2008-10-12 09:16:04 +00:00
Simon Michael
01cd388c24 remove dead code, simplify cacheLedger again 2008-10-12 07:46:54 +00:00
Simon Michael
ce3eeb80b6 consolidate register command code, make it do filtering 2008-10-12 07:34:00 +00:00
Simon Michael
c07c149378 type signatures 2008-10-12 06:10:32 +00:00
Simon Michael
35376cfd9b more informative Show Account 2008-10-12 05:07:19 +00:00
Simon Michael
9b51d922dd more utilities 2008-10-11 04:18:26 +00:00
Simon Michael
2ff9c21b95 more account queries 2008-10-11 04:17:52 +00:00
Simon Michael
2cef939da1 rename accounts/filteraccounts fields to accountmap/filteraccountmap 2008-10-10 22:28:10 +00:00
Simon Michael
3458d1f379 more utils, Control.Monad 2008-10-10 11:52:15 +00:00
Simon Michael
d172cd0d6e a more compact showtree 2008-10-10 11:11:55 +00:00
Simon Michael
9b5a35b5d2 assertnotequal 2008-10-10 11:11:49 +00:00
Simon Michael
37e75d610e more tests cleanup.. prepare for per-module tests, but consolidate in Tests where I think we will stay 2008-10-10 08:16:55 +00:00
Simon Michael
d98643a364 tests cleanup 2008-10-10 07:39:20 +00:00
Simon Michael
d1dfcafc39 move entry filter functions to RawLedger 2008-10-10 04:23:25 +00:00
Simon Michael
67c203f316 move commands to top-level modules, make Ledger pure (except for Parse) 2008-10-10 03:32:12 +00:00
Simon Michael
73c49ec060 reduce unnecessary imports 2008-10-10 02:19:53 +00:00
Simon Michael
cdc5a23192 clean up imports whitespace, minimise explicit intra-app import/export declarations for now 2008-10-10 01:53:39 +00:00
Simon Michael
81ac9bcaa5 remove dead code 2008-10-09 13:16:57 +00:00
Simon Michael
11342db662 simplify filtering, make cacheLedger store filtered data as well, make balance reports work a little better 2008-10-09 13:02:26 +00:00
Simon Michael
b3ba124ce9 more informative show output 2008-10-09 12:59:05 +00:00
Simon Michael
165945cf20 better RawLedger string representation 2008-10-09 09:25:58 +00:00
Simon Michael
3fcb1aaa6c formatting 2008-10-09 09:25:37 +00:00
Simon Michael
e7cf5df029 update and sync the balance report documentation and sample.ledger 2008-10-09 07:10:25 +00:00
Simon Michael
1a608044d9 move regexp utilities to Utils 2008-10-09 07:08:36 +00:00
Simon Michael
a12d1b1c43 give time entries a blank description, as ledger does 2008-10-09 07:08:06 +00:00
Simon Michael
fbe0faa1aa slightly simplify time arithmetic 2008-10-09 07:07:48 +00:00
Simon Michael
ea41778948 timelog cleanups 2008-10-08 21:08:42 +00:00
Simon Michael
dff086a69d cleanups 2008-10-08 19:36:22 +00:00
Simon Michael
83e58501fc Parse cleanups 2008-10-08 18:25:51 +00:00
Simon Michael
fa1b4bdfa2 rename parseError, parsePatternArgs, fix a bug 2008-10-08 18:02:34 +00:00
Simon Michael
b8b3de0719 document an issue with parse errors 2008-10-08 17:47:58 +00:00
Simon Michael
91802391a1 um.. refactor option handling, filtering, and support -b/-e date filtering options 2008-10-08 17:00:22 +00:00
Simon Michael
9ad1310f60 fix the timelog parser, make timelog reports work 2008-10-03 13:41:27 +00:00
Simon Michael
48700f323f move raw ledger functions to RawLedger 2008-10-03 12:10:05 +00:00
Simon Michael
2ce3124738 fix failing test 2008-10-03 11:20:49 +00:00
Simon Michael
5ef0018001 make sum[Amount] preserve currency, fix a failing test 2008-10-03 11:15:03 +00:00
Simon Michael
6167dc4ed0 don't set currency to $ when not specified in ledger 2008-10-03 10:22:43 +00:00
Simon Michael
e9f4b32d02 don't treat accounts with trailing space and no amount as different 2008-10-03 09:47:50 +00:00
Simon Michael
c76540e348 make balance reports show the total balance when non-zero 2008-10-03 08:24:24 +00:00
Simon Michael
7db9c4c910 better zero amount checking 2008-10-03 08:21:35 +00:00
Simon Michael
cf194e6b60 rename showLedgerAccounts to showLedgerAccountBalances 2008-10-03 07:47:36 +00:00
Simon Michael
8bcb3c25a4 fully haddockise Ledger 2008-10-03 07:39:09 +00:00
Simon Michael
a7b1269d86 define Ledger's exports 2008-10-03 07:38:46 +00:00
Simon Michael
7acd389624 clarify the two kinds of boring account 2008-10-03 07:36:45 +00:00
Simon Michael
e5834ffe2f minor cleanups.. time to go 2008-10-03 03:38:33 +00:00
Simon Michael
8d91661e23 fix filtering by pattern 2008-10-03 03:15:51 +00:00
Simon Michael
3aa656ba69 rename LedgerEntry to Entry 2008-10-03 02:37:19 +00:00
Simon Michael
9ca02e21e4 Parse doc cleanup 2008-10-03 02:28:58 +00:00
Simon Michael
9a2dc41d30 move parseLedgerAndDo back to hledger main 2008-10-03 02:25:18 +00:00
Simon Michael
6ce6029c7a move type docs to the corresponding module descriptions and update 2008-10-03 02:04:15 +00:00
Simon Michael
b19fe33476 replace Models with a top-level Ledger module 2008-10-03 01:14:16 +00:00
Simon Michael
8db5aa5f04 doc wording 2008-10-03 00:53:49 +00:00
Simon Michael
c699b979f8 move the rest of the core code to the Ledger package 2008-10-03 00:40:06 +00:00
Simon Michael
3bca3cfa0f move Currency to Ledger/ 2008-10-03 00:22:17 +00:00
Simon Michael
82e4e14e8f move Types to Ledger/ 2008-10-03 00:12:59 +00:00
Simon Michael
627f78a730 first step towards a library, move Utils to Ledger.Utils 2008-10-03 00:05:16 +00:00