Commit Graph

65 Commits

Author SHA1 Message Date
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
tim
fd8587fbdf Handle !includes relative to the including file 2009-02-04 21:27:20 +00:00
Simon Michael
25526cf4b3 parse timelog entries according to a timezone stored in the context 2009-01-24 21:46:09 +00:00
Simon Michael
b218647631 a little cleanup, haddock parsing context 2009-01-24 21:15:38 +00:00
Simon Michael
f8905464ac implement default year, allowing m/d dates in ledger 2009-01-27 21:55:26 +00:00
Simon Michael
16e33b50e6 parse Y default year lines in a ledger, so they don't break it (ignoring them) 2009-01-22 23:42:34 +00:00
nick
4ea30b7411 Fixed ;-only bug 2008-12-08 07:20:29 +00:00
nick
68682fa0ee Tilde expansion in !include 2008-12-10 17:40:05 +00:00
nick
600582184c Support for !account directives, and tests 2008-12-08 07:21:33 +00:00
nick
9b7a3689f5 !account affects timelog entries 2008-12-10 17:40:36 +00:00
tim
4bc97d237a Added support for reading historical prices from files 2008-12-16 10:54:20 +00:00
nick
0be862f760 Fixed TimeLog handling and certain blank lines 2008-12-08 03:45:35 +00:00
nick
ee4a2a1c1e New ledger parser with file inclusion 2008-12-08 01:49:31 +00:00
Simon Michael
630e22312b remove DateTime and Date types, use Day and UTCTime directly
This seems simplest for now, I might bring type synonyms back later.
2008-11-27 04:01:07 +00:00
Simon Michael
884ebf2979 gather date stuff together, FuzzyDate -> SmartDate 2008-11-27 00:35:00 +00:00
Simon Michael
e8a0d42906 cleanup 2008-11-26 22:15:22 +00:00
Simon Michael
8c56c3c4b3 refactoring date parsing, FuzzyDate 2008-11-26 23:21:24 +00:00
Simon Michael
49a84957a9 cleanup smartdate 2008-11-26 21:34:26 +00:00
Simon Michael
3e1a615dbf misc cleanup 2008-11-26 05:21:44 +00:00
Simon Michael
4d49177117 hacking in more date parsing.. today/tomorrow/yesterday 2008-11-26 04:51:15 +00:00
Simon Michael
6c88197c6a do IO date parsing up front, and support (english) month names 2008-11-26 04:04:05 +00:00
Simon Michael
1c60514973 tighten up date parsing, make it io-friendly and parse Y, M/D, D 2008-11-25 23:52:42 +00:00
Simon Michael
b3c0bba51e haddock fix 2008-11-24 00:14:11 +00:00
Simon Michael
dfe59676fb support all five date comparisons in --display 2008-11-26 21:18:24 +00:00
Simon Michael
33b2deba75 correction, dates in display expressions should be in brackets 2008-11-25 18:47:26 +00:00
Simon Michael
0582046648 preliminary --display/-d support (-d "d>DATE", sufficient for reconciling) 2008-11-24 21:51:31 +00:00
Simon Michael
64c6082c23 parse comment lines beginning with a space, as from M-; in emacs ledger-mode 2008-10-18 10:54:22 +00:00
Simon Michael
a49b9715ef allow extra whitespace and comments at end of ledger 2008-11-22 07:00:52 +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
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
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
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
648887b36f use MixedAmount everywhere. seems to work. 2008-10-18 08:39:08 +00:00
Simon Michael
d31ba41703 rename and unify the autofill stuff 2008-10-18 06:45:02 +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
3138046744 clarify entry balance checking and show the full entry when unbalanced 2008-10-15 06:47:47 +00:00
Simon Michael
1e3291af48 focus on tests in Tests.hs, clean up 2008-10-15 06:32:52 +00:00
Simon Michael
760befef89 more cleanups 2008-10-15 06:00:10 +00:00
Simon Michael
b1e2a83556 comment update 2008-10-15 00:33:15 +00:00