Commit graph

1862 commits

Author SHA1 Message Date
Ilya T
d0f2b64cbe Fix clang compile error (FreeBSD 10). 2015-03-13 08:20:37 +07:00
Alexis Hildebrandt
5e6d5e33af Merge pull request #396 from thdox/auto-match
Fix Auto match
2015-02-24 20:27:30 +01:00
thdox
73e3ecc6b8 Fix alignment of cleared-format with 4 spaces as separator. 2015-02-23 23:31:21 +01:00
thdox
80e432a7b2 Fix sorting for option --auto-match.
See http://en.cppreference.com/w/cpp/algorithm/max_element
and http://www.cplusplus.com/reference/algorithm/max_element/
The sorting for max requires < (and not >).
2015-02-22 16:07:54 +01:00
Alexis Hildebrandt
d5e1308d07 [ledger] Remove --cache option
and all boost serialisation related code.
2015-02-18 21:50:34 +01:00
Alexis Hildebrandt
f59abd4c76 [ledger] Remove --full-help option
since it is the same as --help.
2015-02-18 21:50:34 +01:00
Alexis Hildebrandt
17189b8106 [fix] Make trim function trim trailing whitespace
std::isspace(*e) returns false for the end of c-string null-byte.

Bugzilla: 1106
2015-01-20 22:18:32 +01:00
Alexis Hildebrandt
af7e7cdd8f Add pre-release info to --version output
Bump version to 3.1.1-alpha.1
2015-01-20 10:12:25 +01:00
Alexis Hildebrandt
80022bf04a [cmake] Minor cleanup 2015-01-20 10:12:25 +01:00
Alexis Hildebrandt
cebdfde369 Fix typo 2015-01-15 23:29:25 +01:00
Alexis Hildebrandt
f7fd65b9aa Fix -i short-option for --init-file
Bugfix for #1102

Signed-off-by: Alexis Hildebrandt <afh@surryhill.net>
2015-01-15 23:27:16 +01:00
Alexis Hildebrandt
01252035cd [doc] Add CheckTests to ctest
to check whether all available ledger options documented
and are being tested.

Signed-off-by: Alexis Hildebrandt <afh@surryhill.net>
2015-01-15 14:53:16 +01:00
Hans Erik van Elburg
98f67600a8 merge double fix + make changes minimalistic 2015-01-04 13:57:31 +01:00
Hans Erik van Elburg
93c55c5ec6 also added cygwin tweak to src/CMakeLists.txt 2015-01-03 23:35:39 +01:00
Alexis Hildebrandt
ba35340ca9 Bugfix 1038: empty reg report for this month period
when year was specified with literal Y or year directive, but not
when using apply year.
2014-12-29 11:08:10 +01:00
Alexis Hildebrandt
0462c887ae Improve error handling when parsing year directives
A literal Y directive or ‘year’ directive with an empty or invalid 
argument, e.g. ‘2o14’ (that is a small letter ‘oh’ instead of a zero)
would fail with the following rather unhelpful error message:
Error: bad lexical cast: source type value could not be interpreted as target
2014-12-28 13:42:02 +01:00
Alexis Hildebrandt
e716980c7d Fix plain year directive
Only Y2014 or apply year 2014 would actually set the year for the
following transactions; year 2014 would silently do nothing.
2014-12-28 13:32:22 +01:00
Alexis Hildebrandt
bb2b20b311 Use same license text formatting in source files 2014-12-27 11:38:36 +01:00
Alexis Hildebrandt
1dd9dcaab4 Bump copyright notice to 2015
The following script makes it a no-brainer:
% NEXT_YEAR=2015; ag -l 'Copyright.*Wiegley' \
  | xargs sed -i '' -e "s/\(Copyright.*\)-20[0-9]\{2\}/\1-${NEXT_YEAR}/"
2014-12-27 11:24:55 +01:00
Alexis Hildebrandt
a1a51f69f3 Correct no-python error messages
[ci skip]
2014-12-25 12:28:31 +01:00
Alexis Hildebrandt
f1478851ee Fix crash when using --trace 10 or above
uint8_t is typedef'd to char, thus boost::lexical_cast treats it
as such instead of a number.
2014-12-23 23:45:39 +01:00
Alexis Hildebrandt
0a0f2f0d69 Fix crash when using -M with empty result
ledger -f /dev/null reg -M test causes a segmentation fault,
see bug 730 and duplicates 1080 and 1084 for details.

Kudos to Ikke for helping with debugging.
2014-12-16 19:37:37 +01:00
Adrian Lang
a013a73b26 Fix off by one error in textual.cc
This fixes parsing of transactions with single-character payees and comments.
2014-12-11 21:57:25 +01:00
Christophe Rhodes
3e1f6670fc support date as well as datetime in Balance.value()
cargo-cut'n'paste from py_amount.cc
2014-12-01 21:03:23 +00:00
ELIPTUS
af571c1047 Improve Embedded Python Support
Discussion:
https://groups.google.com/d/msg/ledger-cli/kq9sKoRX9vw/fmyhvPslzokJ
2014-11-12 22:51:56 -08:00
Stefano Zacchiroli
56976a127c make --columns default to terminal width, as returned by ioctl()
If set, the COLUMNS environment variable will take precedence over terminal
width. However, please note that COLUMNS is usually *not* exported by shells to
child processes, so in most cases COLUMNS will be undefined for ledger---hence
the motivation for this change.

Terminal width is queried using ioctl() on stdin. For the sake of portability
the querying is done only on platform where ioctl() is detected as supported at
compile-time.
2014-10-13 17:15:56 -04:00
Martin Michlmayr
96223f9e20 Add ISO 8601 date as recognized date string
Dates specified via --begin and --end are converted to a value expression
using an ISO 8601 (yyyy-mm-dd) date, but this date was not recognized by
ledger.

Bug fix for #1072
2014-10-02 18:33:26 -04:00
Martin Michlmayr
fbcb5e9093 Fix period expression parsing for month to month without year
Bug fix for #1074, a regression introduced by the fix for bug #375
2014-10-02 17:31:26 -04:00
Carlos E. Garcia
5d6655c84f minor spelling fixes 2014-09-15 14:04:19 -04:00
Joseph Mornin
4c86042665 "mispelled" was misspelled 2014-09-08 09:41:21 -07:00
Joe Gallo
d5592ea1e3 #if guards for boost 1.56 compatibility 2014-08-28 11:04:55 -04:00
John Wiegley
948f5fea28 Revert "fix "no viable conversion from ... to 'bool'""
This reverts commit df9ae3ab9b.
2014-08-27 11:56:14 -05:00
John Wiegley
4ed6599579 Revert "fix "type 'char' cannot be used prior to '::'""
This reverts commit 38557ee632.
2014-08-27 11:56:07 -05:00
Joe Gallo
38557ee632 fix "type 'char' cannot be used prior to '::'" 2014-08-26 09:09:06 -04:00
Joe Gallo
df9ae3ab9b fix "no viable conversion from ... to 'bool'" 2014-08-26 09:07:57 -04:00
Craig Earls
fa46f3442d fix rare bug in balance report output if the budgeted amount happens to be zero.
See emails in group from John Rakestraw circa November 2011
2014-08-24 18:40:00 -07:00
Martin Michlmayr
b886342064 Preserve the given cost for print
Patch from John Wiegley
2014-07-14 21:05:54 -04:00
Martin Michlmayr
37b8b5e337 Preserve original cost basis when gain or loss is made
Change the definition of cost: in the past, if you bought 1 AAA for
$10 and then sold it for $12, ledger would take $12 as the cost.  With
the patch, the original cost of $10 is preserved ss the cost basis.
In my opinion, this brings ledger in line with accounting expectations.

This change fixes bugs #712 and #713.

Bug #712 is about Equity:Capital Gains and Equity:Capital Loss
entries ledger automatically generates that are in my opinion
incorrect.

Bug #713 is about strange behaviour with -B after a capital gain or
loss is made.

Patch from John Wiegley.
2014-07-14 20:39:04 -04:00
Martin Michlmayr
746ca1fe6d Unify debugging categories
Debugging categories follow the filename, which in this case is singular
(rather than plural) "account" and "amount".
2014-07-01 14:14:23 -04:00
Max Satula
de17ccf1f4 When a status flag (! or *) is explicitly specified for an individual posting, it always has a priority over entire transaction status. 2014-06-30 13:39:22 -04:00
Craig Earls
db73e7af9e Fix Bug 1057: Emacs output does not escape special characters. 2014-06-26 20:52:50 -07:00
Martin Michlmayr
23902686a3 Don't lose commodity when cost is not separated by whitespace
When a cost was specified without a whitespace after the @ symbol,
as in @$5.01, this was incorrectly parsed as 5.01 (losing the
commodity) rather than $5.01.

Bug fix for #1050
2014-06-05 19:46:22 -04:00
Martin Michlmayr
a5ffcc42ff Improve backwards compatibility with ledger2
This brings some single character format strings in line with what
they actually meant in ledger2.

Bug fix for #755
2014-05-30 23:52:36 -04:00
Martin Michlmayr
7eeb2e2e18 Recognize --cleared-format option
Bug fix for #747
2014-05-30 22:14:48 -04:00
Martin Michlmayr
dfcbbd169e Fix query string for select account
A wrong query string was generated by "select account": one ansify_if()
too much was listed and justify() was called with the wrong parameters.

Bug fix for #744
2014-05-30 22:01:08 -04:00
Martin Michlmayr
b2b84f35b4 Move the debug statement to where it makes more sense
It's possible to just say "select account" without a "from", so
put the debug statement at the end of the block where the variable
"formatter" is filled with the query string.
2014-05-30 22:00:16 -04:00
Martin Michlmayr
b534ee80a3 Handle POST_COST_VIRTUAL in print
Bug fix for #1046
2014-05-30 20:23:59 -04:00
Martin Michlmayr
fafd7c1346 Check whether a month is followed by a year
Bug fix for #375
2014-05-30 18:27:22 -04:00
Martin Michlmayr
2cee0fe23f Cosmetic change - format code consistently
Add a space between if and the opening bracket, between a closing
round bracket and the following opening curly bracket, etc.
2014-05-18 09:51:32 -04:00
thdox
8b3f8d1884 Fix bug introduced by commit AA2FF2B
Correction is to not use uninitialized amount
2014-05-17 23:41:07 +02:00