Commit graph

1821 commits

Author SHA1 Message Date
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
Martin Michlmayr
ab921cca0c Ensure that high-levels directives have arguments if they need one
Ensure that high-levels directives, such as account, alias and
commodity, have arguments if they need one.  Bug fix for #1036
2014-05-14 17:55:07 -04:00
Martin Michlmayr
86fd99c9d0 Ensure that directives have arguments if they need one
Ensure that account, commodity and payee directives have arguments
if they need one.  Bug fix for #785
2014-05-14 17:53:43 -04:00
Martin Michlmayr
60d9c2bc1d Remove trailing whitespace from error messages
Fix for bug #867
2014-05-13 18:08:34 -04:00
John Wiegley
1a2ab0eff7 Merge pull request #289 from csrhodes/payee-uuid-mapping
Payee uuid mapping
2014-05-13 15:35:56 -05:00
Christophe Rhodes
da51f5b510 support payee uuid directive
The semantics of this are a little bit tricky: we want, if we come
across a transaction with exactly the given UUID, to set the
transaction's payee to be the specified one.

We need to set that payee before the first post in the transaction is
parsed, otherwise that post will inherit the wrong payee; however, we
need to do it after the transaction's tags have been parsed.  The
implementation as it is in this commit is potentially a little
wasteful, if there are post-like (non-comment non-assertion) entries
in the transaction that don't successfully parse as posts.
2014-05-13 16:08:10 +01:00
Martin Michlmayr
0c9e188cfb Honour date-format for lot dates
Fixes bug #383
2014-05-13 00:03:39 -04:00
Martin Michlmayr
e367cfd895 Recognize the --no-pager option
Thanks to Johann Klähn.
2014-05-12 22:15:57 -04:00
Christophe Rhodes
bcb28b066f rename payee_mappings to payee_alias_mappings
(and similar renames) in preparation for payee_uuid_mappings
2014-05-12 23:16:07 +01:00
thdox
e422b41600 Library GMP is not yet ready for GCC 4.9, as described at bottom of page
http://gcc.gnu.org/gcc-4.9/porting_to.html

See extract below:

The <cstddef> header was updated for C++11 support and this breaks some
libraries which misuse macros meant for internal use by GCC only. For
instance with GMP versions up to 5.1.3, you may see:

/usr/include/c++/4.9.0/cstddef:51:11: error: ‘::max_align_t’ has not been declared
   using ::max_align_t;
           ^

Another possible error is:

someheader.h:99:13: error: ‘ptrdiff_t’ does not name a type

A workaround until libraries get updated is to include <cstddef> or
<stddef.h> before any headers from that library.
2014-05-11 11:14:49 +02:00
John Wiegley
bd8a1a6756 Use the POST_COST_VIRTUAL flag when exchange commodities
Fixes #999
2014-05-08 14:28:07 -05:00
John Wiegley
1aa0e03a9e Fix build for building with g++ 4.8 2014-05-07 20:49:45 +00:00
Johann Klähn
73caafa2c5 fix debug build for gcc
-ansi ≡ -std=c++98 ;)
2014-05-07 19:08:06 +02:00
John Wiegley
07b206bf6a Add the --no-pager option 2014-04-27 20:30:21 -05:00
John Wiegley
4707122eed Initialize journal_t::no_aliases to false upon costruction
This fixes a bug introduced by ecd5097d51.
2014-04-21 18:01:08 -05:00
John Wiegley
7be70aab59 Require the use of C++11 2014-04-17 14:34:36 -05:00
David Bremner
0ef8256409 Replace sha1.cc with boost::uuid::details::sha1
sha1.cc is not redistributable by Debian because the license doesn't
permit redistribution of modified versions.

This isn't ideal since the ::details namespace is subject to change,
but it avoids adding a dependency to ledger.
2014-04-17 14:27:21 -05:00
John Wiegley
aa2ff2b5db Improve an error message relating to balance assertions 2014-04-16 15:56:30 -05:00
John Wiegley
f73ff40a86 Add a safety check when using deferred postings 2014-04-15 01:31:47 -05:00
John Wiegley
0d23e3d4f6 Apply any outstanding deferred postings at the end of parsing 2014-04-14 11:08:26 -05:00
John Wiegley
8f8a94c28e Add the concept of "deferred postings"
This is pretty much exclusively for allowing one to use balance
assertions with replicated transactions across multiple files.
2014-04-13 23:26:14 -05:00
John Wiegley
634aa589cd The option --permissive now quiets balance assertions 2014-04-13 23:26:14 -05:00
Matthias Lederhofer
0e2d07c801 use /bin/sh to run the pager
This allows to specify options on the command-line of the pager, e.g.

  $ ledger --color --pager='less -R' ...
2014-04-02 23:10:03 +01:00
John Wiegley
3c51df125d Fix a compiler warning 2014-03-28 13:51:00 -05:00
Alexis Hildebrandt
8629f92cf8 CMake: Remove installation of third party code 2014-03-10 12:16:59 +01:00
Peter Feigl
ecd5097d51 Adding option --no-aliases to completely disable alias expansion 2014-02-26 23:50:50 +01:00
John Wiegley
ee36a33a19 Merge pull request #248 from ecraven/fix-warnings
Fixing two GCC warnings
2014-02-26 16:26:41 -06:00
Peter Feigl
7bcc5b7c2c Fixing two GCC warnings 2014-02-26 12:29:57 +01:00
Peter Feigl
75b0a5d8ff Adding option --recursive-aliases, adding documentation to man-page and manual 2014-02-26 09:29:31 +01:00
Peter Feigl
2dabb914c0 fixing problem with previous commit if no aliases are registered 2014-02-26 01:16:03 +01:00
Peter Feigl
c80b495546 Adding support for recursive aliases.
Alias expansion is now a loop. If you define

alias A=B:A
alias B=C:B

then A will expand to C:B:A.

Also added a short section to the manual about this.
2014-02-25 22:50:20 +01:00
John Wiegley
de8b078849 Attempt to convert balances to amounts before failing comparisons 2014-02-21 13:05:12 -06:00
John Wiegley
6a68119cbb Merge pull request #243 from kanru/justify-cjk
Correctly justify Unicode characters in terminal
2014-02-16 23:02:02 -06:00
Kan-Ru Chen (陳侃如)
9c7e5a612c Use mk_wcwidth instead mk_wcwidth_cjk 2014-02-13 19:19:40 +08:00
Kan-Ru Chen (陳侃如)
d5b5ea0213 Correctly justify Unicode characters in terminal
Many Unicode characters take more spaces than one ASCII character. For
example, Chinese characters are two characters wide when using monospace
font in terminal. This patch use wcwidth of Markus Kuhn to count the
correct width for justification.
2014-02-13 18:40:06 +08:00
Alexis Hildebrandt
e7cfaa1e65 Fix apply_year_directive
Using the Y 2014 syntax works fine, but using
apply year 2014 resulted in the following error:
Error: Year is out of valid range: 1400..10000
since part of the given year string was chopped off.
2014-02-12 10:38:07 +01:00
Alexis Hildebrandt
b359e851fe Correctly set runtime path on Linux on install 2014-02-03 12:02:03 +01:00
Alexis Hildebrandt
2b9208e850 Bump copyright information to 2014 2014-02-02 12:36:22 +01:00
Johann Klähn
e0ee1eb810 initialize member variables of posts_to_org_table
This fixes test/baseline/cmd-org.test when built with clang.
2014-02-01 19:41:20 +01:00
Alexis Hildebrandt
e362a481ec Create default scope from python session only if needed
Fixes test failures introduced with the commit
"Create default scope to read journal"
a9078767b8
2014-02-01 19:29:25 +01:00
Johann Klähn
0dc2b97813 python module file suffix is platform dependent 2014-02-01 12:10:53 +01:00
Alexis Hildebrandt
6eeda8bcea Fix shared library and python module
Conflicts:
	src/CMakeLists.txt
2014-02-01 12:00:32 +01:00