Commit Graph

107 Commits

Author SHA1 Message Date
ob
8937ed457d GHC 6.12.1 has UTF8 support on board. Using System.IO.UTF8 can cause problems.
Therefore use System.IO.UTF8 only on previous versions.
Testet with GHC 6.10.4 and 6.12.1
2010-02-13 20:00:34 +00:00
Simon Michael
c08bccb158 parsing: use actual (ie, first) date's year as a default for the effective (ie, second) date 2010-02-03 21:19:01 +00:00
Simon Michael
60bda57a26 drop LedgerPosting, it's no longer needed; more rename cleanups 2009-12-19 05:57:54 +00:00
Simon Michael
ec95b0723c make Postings reference their parent Transaction
With this change, Transactions and Postings reference each other
co-recursively.  This makes constructing them more tedious, but it
may also allow LedgerPostings to be dropped and code to be simplified.
Time and space performance of register and balance is as before.
2009-12-19 03:44:52 +00:00
Simon Michael
8405072ff6 refactor 2009-12-20 15:50:54 +00:00
Simon Michael
f1813fbb0e more LedgerTransaction/Transaction/LedgerPosting field renames 2009-12-16 17:58:51 +00:00
Simon Michael
30b83bb105 rename LedgerTransaction to Transaction 2009-12-16 08:07:26 +00:00
Simon Michael
0656d575ac rename Transaction to LedgerPosting 2009-12-16 07:58:06 +00:00
Simon Michael
2e9b27da0d rename RawLedger to Journal 2009-12-16 07:00:43 +00:00
Simon Michael
79880de744 don't let ledgercomment parser always pass 2009-06-20 04:01:25 +00:00
Simon Michael
29bf134624 better postings parse error 2009-06-20 04:09:59 +00:00
Simon Michael
f7e8ae1c55 whitespace parsing tweak 2009-06-21 14:42:59 +00:00
marko.kocic
afa2d065bd Hlint: Error: Monad law, right identity 2009-09-22 10:50:02 +00:00
marko.kocic
af3ad2abe1 Hlint: Error: Redundant return 2009-09-22 12:17:25 +00:00
Simon Michael
20878df544 hlint: use getContents 2009-09-23 17:43:23 +00:00
Simon Michael
a8e510d789 tighten up some imports 2009-07-09 19:03:08 +00:00
Simon Michael
26848584ee fix a warning 2009-11-19 02:00:48 +00:00
Simon Michael
042a2ad45e allow (and ignore) a time in price records 2009-11-19 02:02:12 +00:00
Simon Michael
5493a604e3 parsing: fix timelog parsing 2009-12-07 23:29:19 +00:00
Simon Michael
9560073b2a make historical prices more robust, fix a runtime Map.find error 2009-12-09 20:51:00 +00:00
marko.kocic
b197693197 Hlint: Warning: Redundant brackets 2009-09-22 16:51:27 +00:00
marko.kocic
2855fe9e0a Hlint: Error: Redundant do 2009-09-22 12:08:28 +00:00
marko.kocic
8fdd28d446 Hlint: Error: Redundant $ 2009-09-22 11:55:11 +00:00
Simon Michael
5d6c6d778e there shouldn't be brackets in transaction's effective date, my mistake 2009-12-12 03:03:41 +00:00
Simon Michael
b6a5a3398e parsing: tighten up dates, error messages, tests 2009-11-25 21:21:49 +00:00
Simon Michael
e3e935e129 parsing: require whitespace between date and status code, prevent silent effective date breakage 2009-11-25 20:12:09 +00:00
marko.kocic
ddc176d83e Hlint: Warning: Eta reduce 2009-09-22 15:56:59 +00:00
Simon Michael
d98d136fc7 allow comment lines intermixed with posting lines 2009-06-20 04:02:10 +00:00
Simon Michael
06eb2a9aa8 --effective option uses transactions' effective dates, if any 2009-07-08 23:37:44 +00:00
Simon Michael
d1418a2a21 show better errors for unbalanced transaction and missing default year 2009-06-05 19:35:12 +00:00
Simon Michael
3be793f108 fix nafai's bug: fail on empty account name components, don't just ignore 2009-06-05 18:02:22 +00:00
Simon Michael
cb8ea69dfc fix warnings all over - hledger is now -W-clean 2009-06-05 09:44:20 +00:00
Simon Michael
568e752484 allow parentheses and brackets inside account names, as ledger does 2009-05-25 17:28:41 +00:00
Simon Michael
1572622ae6 use a consistent prefix for Transaction field accessors 2009-04-04 21:26:55 +00:00
Simon Michael
a78f5a1f04 model timelog entry codes precisely 2009-04-03 20:04:51 +00:00
Simon Michael
2c989522da add missing type signatures, for tags 2009-04-07 21:38:38 +00:00
Simon Michael
cfaacd26b6 parse error fixes 2009-04-10 04:38:46 +00:00
Simon Michael
1085d476f1 parse zero-length input as an empty ledger 2009-04-10 05:42:26 +00:00
Simon Michael
69ce8b9a8e don't treat comments as part of ledger transaction descriptions 2009-04-10 05:37:26 +00:00
Simon Michael
eb3ec063d0 require a non-empty description in ledger transactions 2009-04-10 04:39:54 +00:00
Simon Michael
5d1f535b5e require some postings in ledger transactions 2009-04-10 05:00:51 +00:00
Simon Michael
638238dc5c ledgerFile cleanup 2009-04-10 05:40:57 +00:00
Simon Michael
1fd416ba96 whitespace 2009-04-16 06:34:32 +00:00
Sergey Astanin
86fab58e6a Allow UTF8 in ledgers (account names, descriptions).
This patch fixes broken layout of some commands when there is Unicode
text in the ledger file.

I substituted System.IO functions with System.IO.UTF8. Now all strings
are Unicode internally, and take's and length's work correctly.
In particular, add, balance, hist, print and register commands seem
to work correctly; ui is still broken for me, I didn't try web.

I decode command line arguments from UTF8 forcefully, to permit
searches for accounts and descriptions with Unicode (otherwise, it
does not work).

The patch adds an additional dependency: utf8-string.

This patch does not include new test cases.
2009-05-14 20:44:06 +00:00
Simon Michael
32a3af8334 transactionamount -> postingamount 2009-04-07 21:18:51 +00:00
Simon Michael
d8fe2aabb2 drop TimeLog, it's no longer needed 2009-04-03 11:05:16 +00:00
Simon Michael
0f1cbef9a8 namegeddon! conform to new terminology in ledger 3, more or less
This renames RawTransaction -> Posting and Entry -> LedgerTransaction,
plus a bunch more cleanups for consistency.  So while ledger 3 has
transactions containing postings, and so do we when speaking to users,
internally we call ledger 3's transactions LedgerTransaction, and we keep
our old Transaction type as well, because it's useful and used all over
the place. To review:

- ledger 2 had Entrys containing Transactions.

- hledger 0.4 had Entrys containing RawTransactions, and Transactions
  which are a RawTransaction with its parent Entry's info added.
  Transactions are what we most work with when reporting and are
  ubiquitous in the code and docs.

- ledger 3 has Transactions containing Postings.

- hledger 0.5 now has LedgerTransactions containing Postings, with
  Transactions kept as before (a Posting plus it's parent's info).  These
  could be named PartialTransactions or TransactionPostings, but it gets
  too verbose and obscure for devs and users.
2009-04-03 10:58:05 +00:00
Simon Michael
1fc9db3af5 individual transactions now have a cleared status 2009-01-23 00:14:12 +00:00
Simon Michael
89abdfa456 refactor/fix balanced entry checking and test it properly 2009-04-01 08:55:46 +00:00
Simon Michael
ae5a9439d0 count time elapsed in open timelog entries, ignore time zone
Any open sessions in a timelog will be considered clocked out as of the
current time, and included in calculations. Also, contrary to the earlier
patch we now ignore timezone everywhere and deal only with local times.
This might need revisiting eg to track time while crossing timezones.
2009-01-25 07:06:59 +00:00