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.
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
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
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.
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.
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.
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.