Commit Graph

234 Commits

Author SHA1 Message Date
Simon Michael
ef39cced4a don't fail when matching an empty pattern, as in "not:" 2009-05-16 21:19:38 +00:00
Simon Michael
8eb31bc5e3 enforce balancing for bracketed virtual postings 2009-05-16 23:12:42 +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
b103f6a0d8 be more accurate about checking balanced amounts, don't rely on display precision 2009-05-16 22:54:12 +00:00
Simon Michael
c5e7b12a59 add command, reads transactions interactively and adds them to the ledger 2009-04-08 05:30:26 +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
1548e84aa9 add file path field to RawLedger 2009-04-08 03:40:05 +00:00
Simon Michael
b60f9187c0 refactor, moving generic io functions into Ledger.IO 2009-04-04 08:50:36 +00:00
Simon Michael
ab94a6e9a2 --uncleared option 2009-04-03 11:45:56 +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
55c0a688c0 that parser is not right, breaks hours period selection 2009-01-23 18:10:17 +00:00
Simon Michael
fdc13f6f43 smart dates: make "this" optional 2009-01-23 02:27:56 +00:00
Simon Michael
415c48d855 getCurrentLocalTime 2009-01-25 06:47:05 +00:00
Simon Michael
26594287cc strip cleanup 2009-03-15 03:57:19 +00:00
Simon Michael
f7b2e62bcb cacheLedger cleanup 2009-03-17 19:50:43 +00:00
Simon Michael
38fd44917c test and fix for auto-clockout of a future clockin 2009-04-01 05:00:08 +00:00
Simon Michael
c2352c3c64 localise the single use of regexpr 2009-04-02 01:28:36 +00:00
Simon Michael
8256a4fcbd test util cleanups 2009-04-01 04:57:05 +00:00
Simon Michael
0693723aee ltrace, labelled trace 2009-03-15 03:58:43 +00:00
Simon Michael
931144a12d remove conflictory p 2009-01-25 13:55:08 +00:00
Simon Michael
bd8dcefd9d apply --depth to print command 2009-04-02 06:02:00 +00:00
Simon Michael
89abdfa456 refactor/fix balanced entry checking and test it properly 2009-04-01 08:55:46 +00:00
Simon Michael
0cacc2a7e4 test and bugfix for multi-day timelog session splitting 2009-03-15 12:42:03 +00:00
Simon Michael
564aba4976 split midnight-spanning timelog sessions. Accurate time reports at last! 2009-01-26 20:22:42 +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
ec10ab8a16 Added variants to parse dates into maybe values 2009-01-11 06:58:35 +00:00
Simon Michael
80f20bdad8 tests and bugfix for accountNameTreeFrom 2009-03-15 04:02:04 +00:00
Simon Michael
2dac5754c7 subAccounts test and bugfix 2009-03-15 04:06:10 +00:00
Simon Michael
d8989a357d account/description matching is supposed to be case-insensitive, fix 2009-01-27 22:16:57 +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
44cbed59cb use longer but standard and clearer getCurrentTime/Day 2009-01-24 19:48:37 +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
Simon Michael
46c09c6fac patterns now use not: and desc: prefixes instead of ^ and ^^
This is more like but not the same as ledger 3.
2009-04-02 06:25:22 +00:00
Simon Michael
564c218d61 dead code 2008-11-25 04:15:03 +00:00
tim
6fdaf2a248 Added showAmount' that shows only the number part of an amount 2008-11-23 21:26:38 +00:00
Simon Michael
770c2956a5 oops, maybe another piece of the Date/DateTime removal 2008-11-27 04:29:32 +00:00
Simon Michael
4d5478b334 haddock fix 2008-11-27 07:50:02 +00:00
Simon Michael
b4fed8f2fd docs 2008-12-04 19:32:30 +00:00
Simon Michael
e333c76d6f leaves utility 2008-12-04 19:32:42 +00:00
Simon Michael
6f6ce11ca8 more balance-calculating extraction 2008-12-05 08:26:13 +00:00
Simon Michael
eca112f7d4 extract common balance-calculating code 2008-12-05 05:09:54 +00:00
Simon Michael
76df6ec88f optimise cacheLedger by using the tree to help calculate account balances
from:

	total time  =        0.14 secs   (7 ticks @ 20 ms)
	total alloc = 275,520,536 bytes  (excludes profiling overheads)

     cacheLedger                                     1   0.0    0.1      42.9       48.6
      sumTransactions                                0   0.0    0.6      28.6       42.5
       isZeroAmount                              13529   0.0    2.0      14.3       39.2
        showAmount                               13529   0.0    7.2      14.3       37.2
         showAmount'                             13529  14.3   29.9      14.3       29.9
         con2tag_Side#                           27232   0.0    0.0       0.0        0.0
       normaliseMixedAmount                       6733   0.0    1.8      14.3        2.7
        con2tag_Side#                              120   0.0    0.0       0.0        0.0
        sumAmountsPreservingPrice                 6803   0.0    0.2      14.3        1.0
         amountop                                13351   0.0    0.4      14.3        0.8
          convertAmountTo                        13351  14.3    0.4      14.3        0.4
           conversionRate                        13351   0.0    0.0       0.0        0.0
      isAccountNamePrefixOf                      25122   0.0    2.0       0.0        2.0

to:

	total time  =        0.08 secs   (4 ticks @ 20 ms)
	total alloc = 168,637,964 bytes  (excludes profiling overheads)

     cacheLedger                                     1   0.0    0.1       0.0       27.1
      sumTransactions                                0   0.0    0.3       0.0       18.8
       isZeroAmount                               3931   0.0    0.9       0.0       17.3
        showAmount                                3931   0.0    3.4       0.0       16.3
         showAmount'                              3931   0.0   12.9       0.0       12.9
         con2tag_Side#                            7884   0.0    0.0       0.0        0.0
       normaliseMixedAmount                       1964   0.0    0.8       0.0        1.3
        con2tag_Side#                               12   0.0    0.0       0.0        0.0
        sumAmountsPreservingPrice                 1970   0.0    0.1       0.0        0.5
         amountop                                 3793   0.0    0.2       0.0        0.4
          convertAmountTo                         3793   0.0    0.2       0.0        0.2
           conversionRate                         3793   0.0    0.0       0.0        0.0
2008-12-05 03:31:45 +00:00
Simon Michael
8bc078ff7b fix haddock error preventing docs update 2008-12-10 05:52:26 +00:00
Simon Michael
fdb45b8d9c make mixed amount adding and showing more robust 2008-12-05 04:36:32 +00:00
Simon Michael
063dce2642 more string utils 2008-12-06 07:15:19 +00:00