summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.dir-locals.el2
-rw-r--r--LICENSE.md2
-rwxr-xr-xacprep30
-rw-r--r--contrib/ParseCcStmt.cs2
-rw-r--r--default.nix2
-rw-r--r--doc/ledger.14
-rw-r--r--doc/ledger3.texi30
-rw-r--r--src/account.cc2
-rw-r--r--src/account.h2
-rw-r--r--src/amount.cc2
-rw-r--r--src/amount.h2
-rw-r--r--src/annotate.cc2
-rw-r--r--src/annotate.h2
-rw-r--r--src/balance.cc2
-rw-r--r--src/balance.h2
-rw-r--r--src/chain.cc6
-rw-r--r--src/chain.h2
-rw-r--r--src/commodity.cc2
-rw-r--r--src/commodity.h2
-rw-r--r--src/compare.cc18
-rw-r--r--src/compare.h18
-rw-r--r--src/context.h2
-rw-r--r--src/convert.cc2
-rw-r--r--src/convert.h2
-rw-r--r--src/csv.cc2
-rw-r--r--src/csv.h2
-rw-r--r--src/draft.cc2
-rw-r--r--src/draft.h2
-rw-r--r--src/emacs.cc2
-rw-r--r--src/emacs.h2
-rw-r--r--src/error.cc2
-rw-r--r--src/error.h2
-rw-r--r--src/expr.cc2
-rw-r--r--src/expr.h2
-rw-r--r--src/exprbase.h2
-rw-r--r--src/filters.cc4
-rw-r--r--src/filters.h31
-rw-r--r--src/flags.h2
-rw-r--r--src/format.cc2
-rw-r--r--src/format.h2
-rw-r--r--src/generate.cc2
-rw-r--r--src/generate.h2
-rw-r--r--src/global.cc6
-rw-r--r--src/global.h4
-rw-r--r--src/history.cc2
-rw-r--r--src/history.h2
-rw-r--r--src/item.cc2
-rw-r--r--src/item.h2
-rw-r--r--src/iterators.cc6
-rw-r--r--src/iterators.h21
-rw-r--r--src/journal.cc2
-rw-r--r--src/journal.h2
-rw-r--r--src/lookup.cc2
-rw-r--r--src/lookup.h2
-rw-r--r--src/main.cc2
-rw-r--r--src/mask.cc2
-rw-r--r--src/mask.h2
-rw-r--r--src/op.cc2
-rw-r--r--src/op.h2
-rw-r--r--src/option.cc2
-rw-r--r--src/option.h2
-rw-r--r--src/org.cc2
-rw-r--r--src/org.h2
-rw-r--r--src/output.cc27
-rw-r--r--src/output.h2
-rw-r--r--src/parser.cc2
-rw-r--r--src/parser.h2
-rw-r--r--src/pool.cc2
-rw-r--r--src/pool.h2
-rw-r--r--src/post.cc2
-rw-r--r--src/post.h2
-rw-r--r--src/precmd.cc2
-rw-r--r--src/precmd.h2
-rw-r--r--src/predicate.h2
-rw-r--r--src/print.cc2
-rw-r--r--src/print.h2
-rw-r--r--src/pstream.h2
-rw-r--r--src/ptree.cc2
-rw-r--r--src/ptree.h2
-rw-r--r--src/py_account.cc2
-rw-r--r--src/py_amount.cc2
-rw-r--r--src/py_balance.cc2
-rw-r--r--src/py_commodity.cc2
-rw-r--r--src/py_expr.cc2
-rw-r--r--src/py_format.cc2
-rw-r--r--src/py_item.cc2
-rw-r--r--src/py_journal.cc2
-rw-r--r--src/py_post.cc2
-rw-r--r--src/py_session.cc2
-rw-r--r--src/py_times.cc2
-rw-r--r--src/py_utils.cc2
-rw-r--r--src/py_value.cc2
-rw-r--r--src/py_xact.cc2
-rw-r--r--src/pyfstream.h2
-rw-r--r--src/pyinterp.cc2
-rw-r--r--src/pyinterp.h2
-rw-r--r--src/pyledger.cc2
-rw-r--r--src/pyutils.h2
-rw-r--r--src/query.cc2
-rw-r--r--src/query.h2
-rw-r--r--src/quotes.cc2
-rw-r--r--src/quotes.h2
-rw-r--r--src/report.cc12
-rw-r--r--src/report.h2
-rw-r--r--src/scope.cc2
-rw-r--r--src/scope.h2
-rw-r--r--src/select.cc2
-rw-r--r--src/select.h2
-rw-r--r--src/session.cc8
-rw-r--r--src/session.h2
-rw-r--r--src/stats.cc2
-rw-r--r--src/stats.h2
-rw-r--r--src/stream.cc2
-rw-r--r--src/stream.h2
-rw-r--r--src/system.hh.in2
-rw-r--r--src/temps.cc2
-rw-r--r--src/temps.h2
-rw-r--r--src/textual.cc2
-rw-r--r--src/timelog.cc2
-rw-r--r--src/timelog.h2
-rw-r--r--src/times.cc2
-rw-r--r--src/times.h2
-rw-r--r--src/token.cc2
-rw-r--r--src/token.h2
-rw-r--r--src/unistring.h2
-rw-r--r--src/utils.cc2
-rw-r--r--src/utils.h2
-rw-r--r--src/value.cc2
-rw-r--r--src/value.h2
-rw-r--r--src/views.cc2
-rw-r--r--src/views.h2
-rw-r--r--src/xact.cc2
-rw-r--r--src/xact.h2
-rw-r--r--test/baseline/feat-value-expr.test2
-rwxr-xr-xtest/convert.py2
-rw-r--r--test/regress/1055.test26
-rw-r--r--test/regress/1132.test16
-rw-r--r--test/regress/550-584.test (renamed from test/input/spaces.dat)18
138 files changed, 323 insertions, 202 deletions
diff --git a/.dir-locals.el b/.dir-locals.el
index ca104fb0..de699515 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -32,5 +32,5 @@
(c-special-indent-hook . c-gnu-impose-minimum)
(c-block-comment-prefix . ""))))
(emacs-lisp-mode
- (indent-tabs-mode)))
+ (indent-tabs-mode . nil)))
diff --git a/LICENSE.md b/LICENSE.md
index c160fd1f..a0783f75 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,4 +1,4 @@
-Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+Copyright (c) 2003-2017, John Wiegley. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
diff --git a/acprep b/acprep
index a7285bf4..d1c24388 100755
--- a/acprep
+++ b/acprep
@@ -66,6 +66,16 @@ class BoostInfo(object):
if system == 'centos':
return [ 'boost-devel' ]
+ elif system == 'ubuntu-xenial':
+ return [ 'libboost-dev',
+ 'libboost-date-time-dev',
+ 'libboost-filesystem-dev',
+ 'libboost-iostreams-dev',
+ 'libboost-python-dev',
+ 'libboost-regex-dev',
+ 'libboost-system-dev',
+ 'libboost-test-dev' ]
+
elif system == 'ubuntu-trusty':
return [ 'libboost-dev',
'libboost-date-time-dev',
@@ -565,6 +575,26 @@ class PrepareBuild(CommandLineApp):
'libutfcpp-dev',
'sloccount'
] + BoostInfo().dependencies('ubuntu-trusty')
+ elif re.search('xenial', info):
+ self.log.info('Looks like you are using APT on Ubuntu Xenial')
+ packages = [
+ 'sudo', 'apt-get', 'install',
+ 'build-essential',
+ 'doxygen',
+ 'cmake',
+ 'ninja-build',
+ 'zlib1g-dev',
+ 'libbz2-dev',
+ 'python-dev',
+ 'libgmp3-dev',
+ 'libmpfr-dev',
+ 'gettext',
+ 'libedit-dev',
+ 'texinfo',
+ 'lcov',
+ 'libutfcpp-dev',
+ 'sloccount'
+ ] + BoostInfo().dependencies('ubuntu-xenial')
elif re.search('saucy', info):
self.log.info('Looks like you are using APT on Ubuntu Saucy')
packages = [
diff --git a/contrib/ParseCcStmt.cs b/contrib/ParseCcStmt.cs
index d5a42fbd..75a38aa9 100644
--- a/contrib/ParseCcStmt.cs
+++ b/contrib/ParseCcStmt.cs
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/default.nix b/default.nix
index f0bfdd2f..85932da9 100644
--- a/default.nix
+++ b/default.nix
@@ -3,7 +3,7 @@
let
version = "3.1.1";
- rev = "20160906";
+ rev = "20161114";
in
stdenv.mkDerivation {
diff --git a/doc/ledger.1 b/doc/ledger.1
index 141d245c..85a9937b 100644
--- a/doc/ledger.1
+++ b/doc/ledger.1
@@ -1,4 +1,4 @@
-.Dd March 23, 2012
+.Dd February 16, 2017
.Dt LEDGER 1
.Os
.Sh NAME
@@ -6,8 +6,8 @@
.Nd Command-line, double-entry account reporting tool
.Sh SYNOPSIS
.Nm
-.Op Ar command
.Op Ar options
+.Op Ar command
.Op Ar arguments
.Sh DESCRIPTION
.Nm
diff --git a/doc/ledger3.texi b/doc/ledger3.texi
index 5407aa71..cecb317e 100644
--- a/doc/ledger3.texi
+++ b/doc/ledger3.texi
@@ -111,7 +111,7 @@
@copying
-Copyright @copyright{} 2003–2016, John Wiegley. All rights reserved.
+Copyright @copyright{} 2003--2017, John Wiegley. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -179,7 +179,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Ledger is a command-line accounting tool that provides double-entry
accounting based on a text journal. It provides no bells or whistles,
and returns the user to the days before user interfaces were even a
-twinkling in their father's CRT.
+twinkling in their fathers' CRTs.
@end ifnottex
@@ -1977,7 +1977,7 @@ amount using the @samp{(( ))} commodity annotation.
2012-03-07 KFC
Expenses:Food7 1 CAD
- Assets:Cas7
+ Assets:Cash7
2012-03-08 XACT
Expenses:Food8 $1
@@ -3056,7 +3056,7 @@ used as the payee name for that posting. This affects the
This is useful when for example you deposit 4 checks at a time to the
bank. On the bank statement, there is just one amount @samp{$400}, but
-you can specify from whom each check came from, as shown by example
+you can specify from whom each check came, as shown by example
below:
@smallexample @c input:9B43E57
@@ -3505,7 +3505,7 @@ But this does not do what you might expect:
@smallexample
2012-04-10 My Broker
Assets:Brokerage 10 AAPL @@ $50.00
- Assets:Brokerage:Cash $750.00
+ Assets:Brokerage:Cash $-500.00
2012-04-10 My Broker
Assets:Brokerage:Cash $375.00
@@ -3531,11 +3531,11 @@ following two transactions are equivalent:
@smallexample
2012-04-10 My Broker
Assets:Brokerage 10 AAPL @@ $50.00
- Assets:Brokerage:Cash $750.00
+ Assets:Brokerage:Cash $-500.00
2012-04-10 My Broker
Assets:Brokerage 10 AAPL @{$50.00@}
- Assets:Brokerage:Cash $750.00
+ Assets:Brokerage:Cash $-500.00
@end smallexample
However, note that what you see in some reports may differ, for
@@ -3554,7 +3554,7 @@ at the time of a transaction. This is done using @samp{@{=AMOUNT@}}:
@smallexample
2012-04-10 My Broker
Assets:Brokerage 10 AAPL @{=$50.00@}
- Assets:Brokerage:Cash $750.00
+ Assets:Brokerage:Cash $-500.00
@end smallexample
These 10 AAPL will now always be reported as being worth $50, no
@@ -3570,7 +3570,7 @@ fixated prices by way of the cost:
@smallexample
2012-04-10 My Broker
Assets:Brokerage 10 AAPL @@ =$50.00
- Assets:Brokerage:Cash $750.00
+ Assets:Brokerage:Cash $-500.00
@end smallexample
This is the same as the previous transaction, with the same caveats
@@ -8966,7 +8966,7 @@ day of the month (dd), zero padded up to 10.
day of the month (dd), no leading zero up to 10.
@item %j
-day of year, zero padded 000–366.
+day of year, zero padded 000--366.
@item %u
day of week starting with Monday (1), i.e. @code{mtwtfss} 3.
@@ -9017,16 +9017,16 @@ Additional date format parameters which can be used:
@table @code
@item %U
-week number Sunday as first day of week, ranging 01–53.
+week number Sunday as first day of week, ranging 01--53.
@item %W
-week number Monday as first day of week, ranging 01–53.
+week number Monday as first day of week, ranging 01--53.
@item %V
-week of the year, ranging 01–53.
+week of the year, ranging 01--53.
@item %C
-century, ranging 00–99.
+century, ranging 00--99.
@item %D
yields @code{%m/%d/%y} as in @samp{02/10/10}.
@@ -9126,7 +9126,7 @@ Even if you don't create a session manually, one is created for you by
the top-level interface functions. The Session is where objects live
like the Commodities that Amounts refer to.
-The make a Session useful, you must read a Journal into it, using the
+To make a Session useful, you must read a Journal into it, using the
function `@code{read_journal}`. This reads Ledger data from the given
file, populates a Journal object within the current Session, and
returns a reference to that Journal object.
diff --git a/src/account.cc b/src/account.cc
index 2a48eaf5..14e8b0a9 100644
--- a/src/account.cc
+++ b/src/account.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/account.h b/src/account.h
index 4a4e859d..e8f28596 100644
--- a/src/account.h
+++ b/src/account.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/amount.cc b/src/amount.cc
index 52ccbc88..0244de66 100644
--- a/src/amount.cc
+++ b/src/amount.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/amount.h b/src/amount.h
index 8885a69d..90a13a59 100644
--- a/src/amount.h
+++ b/src/amount.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/annotate.cc b/src/annotate.cc
index e953f441..22b01364 100644
--- a/src/annotate.cc
+++ b/src/annotate.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/annotate.h b/src/annotate.h
index 0ea2561b..8c2382de 100644
--- a/src/annotate.h
+++ b/src/annotate.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/balance.cc b/src/balance.cc
index ca14c7ff..3cfbe55f 100644
--- a/src/balance.cc
+++ b/src/balance.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/balance.h b/src/balance.h
index d68fccc8..d63b771c 100644
--- a/src/balance.h
+++ b/src/balance.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/chain.cc b/src/chain.cc
index 94afc0fa..b913a4e3 100644
--- a/src/chain.cc
+++ b/src/chain.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -186,9 +186,9 @@ post_handler_ptr chain_post_handlers(post_handler_ptr base_handler,
// value expression.
if (report.HANDLED(sort_)) {
if (report.HANDLED(sort_xacts_))
- handler.reset(new sort_xacts(handler, report.HANDLER(sort_).str()));
+ handler.reset(new sort_xacts(handler, expr_t(report.HANDLER(sort_).str()), report));
else
- handler.reset(new sort_posts(handler, report.HANDLER(sort_).str()));
+ handler.reset(new sort_posts(handler, report.HANDLER(sort_).str(), report));
}
// collapse_posts causes xacts with multiple posts to appear as xacts
diff --git a/src/chain.h b/src/chain.h
index 16fb4400..69de57f0 100644
--- a/src/chain.h
+++ b/src/chain.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/commodity.cc b/src/commodity.cc
index 1475f52e..47093ba3 100644
--- a/src/commodity.cc
+++ b/src/commodity.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/commodity.h b/src/commodity.h
index 1741bfaf..fd09ea46 100644
--- a/src/commodity.h
+++ b/src/commodity.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/compare.cc b/src/compare.cc
index 547acc18..8254527b 100644
--- a/src/compare.cc
+++ b/src/compare.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -33,8 +33,10 @@
#include "compare.h"
#include "op.h"
+#include "scope.h"
#include "post.h"
#include "account.h"
+#include "report.h"
namespace ledger {
@@ -65,6 +67,20 @@ void push_sort_value(std::list<sort_value_t>& sort_values,
}
template <>
+void compare_items<post_t>::find_sort_values(
+ std::list<sort_value_t>& sort_values, scope_t& scope) {
+ bind_scope_t bound_scope(report, scope);
+ push_sort_value(sort_values, sort_order.get_op(), bound_scope);
+}
+
+template <>
+void compare_items<account_t>::find_sort_values(
+ std::list<sort_value_t>& sort_values, scope_t& scope) {
+ bind_scope_t bound_scope(report, scope);
+ push_sort_value(sort_values, sort_order.get_op(), bound_scope);
+}
+
+template <>
bool compare_items<post_t>::operator()(post_t * left, post_t * right)
{
assert(left);
diff --git a/src/compare.h b/src/compare.h
index baee6075..6a2f68cf 100644
--- a/src/compare.h
+++ b/src/compare.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -48,6 +48,7 @@ namespace ledger {
class post_t;
class account_t;
+class report_t;
void push_sort_value(std::list<sort_value_t>& sort_values,
expr_t::ptr_op_t node, scope_t& scope);
@@ -56,23 +57,24 @@ template <typename T>
class compare_items
{
expr_t sort_order;
+ report_t& report;
compare_items();
public:
- compare_items(const compare_items& other) : sort_order(other.sort_order) {
- TRACE_CTOR(compare_items, "copy");
+ compare_items(const expr_t& _sort_order, report_t& _report) :
+ sort_order(_sort_order), report(_report) {
+ TRACE_CTOR(compare_items, "const value_expr&, report_t&");
}
- compare_items(const expr_t& _sort_order) : sort_order(_sort_order) {
- TRACE_CTOR(compare_items, "const value_expr&");
+ compare_items(const compare_items& other) :
+ sort_order(other.sort_order), report(other.report) {
+ TRACE_CTOR(compare_items, "copy");
}
~compare_items() throw() {
TRACE_DTOR(compare_items);
}
- void find_sort_values(std::list<sort_value_t>& sort_values, scope_t& scope) {
- push_sort_value(sort_values, sort_order.get_op(), scope);
- }
+ void find_sort_values(std::list<sort_value_t>& sort_values, scope_t& scope);
bool operator()(T * left, T * right);
};
diff --git a/src/context.h b/src/context.h
index 61797dc4..f4f772b0 100644
--- a/src/context.h
+++ b/src/context.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/convert.cc b/src/convert.cc
index d0a0dc39..ae965a08 100644
--- a/src/convert.cc
+++ b/src/convert.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/convert.h b/src/convert.h
index cb6bcd71..8945112f 100644
--- a/src/convert.h
+++ b/src/convert.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/csv.cc b/src/csv.cc
index 85e41057..76dfd864 100644
--- a/src/csv.cc
+++ b/src/csv.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/csv.h b/src/csv.h
index a294a865..573aaa8b 100644
--- a/src/csv.h
+++ b/src/csv.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/draft.cc b/src/draft.cc
index f7557373..b8f162e4 100644
--- a/src/draft.cc
+++ b/src/draft.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/draft.h b/src/draft.h
index f4c24c26..49ea9a47 100644
--- a/src/draft.h
+++ b/src/draft.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/emacs.cc b/src/emacs.cc
index 9f2626a3..17d3a590 100644
--- a/src/emacs.cc
+++ b/src/emacs.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/emacs.h b/src/emacs.h
index 52b7bd37..55cc697c 100644
--- a/src/emacs.h
+++ b/src/emacs.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/error.cc b/src/error.cc
index 4b3565a3..92203d11 100644
--- a/src/error.cc
+++ b/src/error.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/error.h b/src/error.h
index 73a0e395..4df74cfc 100644
--- a/src/error.h
+++ b/src/error.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/expr.cc b/src/expr.cc
index bc877c1a..1faf9917 100644
--- a/src/expr.cc
+++ b/src/expr.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/expr.h b/src/expr.h
index bbe4bf74..4a64ac68 100644
--- a/src/expr.h
+++ b/src/expr.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/exprbase.h b/src/exprbase.h
index 6d13c429..72694008 100644
--- a/src/exprbase.h
+++ b/src/exprbase.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/filters.cc b/src/filters.cc
index 8aa1218b..4a1a5c30 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -154,7 +154,7 @@ void truncate_xacts::operator()(post_t& post)
void sort_posts::post_accumulated_posts()
{
std::stable_sort(posts.begin(), posts.end(),
- compare_items<post_t>(sort_order));
+ compare_items<post_t>(sort_order, report));
foreach (post_t * post, posts) {
post->xdata().drop_flags(POST_EXT_SORT_CALC);
diff --git a/src/filters.h b/src/filters.h
index 4aa8af7a..8b1f8d2a 100644
--- a/src/filters.h
+++ b/src/filters.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -237,17 +237,20 @@ class sort_posts : public item_handler<post_t>
posts_deque posts;
expr_t sort_order;
+ report_t& report;
sort_posts();
public:
- sort_posts(post_handler_ptr handler, const expr_t& _sort_order)
- : item_handler<post_t>(handler), sort_order(_sort_order) {
- TRACE_CTOR(sort_posts, "post_handler_ptr, const value_expr&");
+ sort_posts(post_handler_ptr handler, const expr_t& _sort_order,
+ report_t& _report)
+ : item_handler<post_t>(handler), sort_order(_sort_order), report(_report) {
+ TRACE_CTOR(sort_posts, "post_handler_ptr, const value_expr&, report_t&");
}
- sort_posts(post_handler_ptr handler, const string& _sort_order)
- : item_handler<post_t>(handler), sort_order(_sort_order) {
- TRACE_CTOR(sort_posts, "post_handler_ptr, const string&");
+ sort_posts(post_handler_ptr handler, const string& _sort_order,
+ report_t& _report)
+ : item_handler<post_t>(handler), sort_order(_sort_order), report(_report) {
+ TRACE_CTOR(sort_posts, "post_handler_ptr, const string&, report_t&");
}
virtual ~sort_posts() {
TRACE_DTOR(sort_posts);
@@ -280,15 +283,17 @@ class sort_xacts : public item_handler<post_t>
sort_xacts();
public:
- sort_xacts(post_handler_ptr handler, const expr_t& _sort_order)
- : sorter(handler, _sort_order) {
+ sort_xacts(post_handler_ptr handler, const expr_t& _sort_order,
+ report_t& _report)
+ : sorter(handler, _sort_order, _report) {
TRACE_CTOR(sort_xacts,
- "post_handler_ptr, const value_expr&");
+ "post_handler_ptr, const value_expr&, report_t&");
}
- sort_xacts(post_handler_ptr handler, const string& _sort_order)
- : sorter(handler, _sort_order) {
+ sort_xacts(post_handler_ptr handler, const string& _sort_order,
+ report_t& _report)
+ : sorter(handler, _sort_order, _report) {
TRACE_CTOR(sort_xacts,
- "post_handler_ptr, const string&");
+ "post_handler_ptr, const string&, report_t&");
}
virtual ~sort_xacts() {
TRACE_DTOR(sort_xacts);
diff --git a/src/flags.h b/src/flags.h
index e6b66470..91b8838f 100644
--- a/src/flags.h
+++ b/src/flags.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/format.cc b/src/format.cc
index b6f0d5ae..9b137296 100644
--- a/src/format.cc
+++ b/src/format.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/format.h b/src/format.h
index 8856905d..c63075c7 100644
--- a/src/format.h
+++ b/src/format.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/generate.cc b/src/generate.cc
index c1ecb007..9a7d9317 100644
--- a/src/generate.cc
+++ b/src/generate.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/generate.h b/src/generate.h
index d4f13070..756a7097 100644
--- a/src/generate.h
+++ b/src/generate.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/global.cc b/src/global.cc
index 882840de..37765a9b 100644
--- a/src/global.cc
+++ b/src/global.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -136,9 +136,7 @@ void global_scope_t::read_init()
path init_file;
if (HANDLED(init_file_)) {
init_file=HANDLER(init_file_).str();
- if (exists(init_file)) {
- parse_init(init_file);
- } else {
+ if (!exists(init_file)) {
throw_(parse_error, _f("Could not find specified init file %1%") % init_file);
}
} else {
diff --git a/src/global.h b/src/global.h
index 1a4a3076..b35fa653 100644
--- a/src/global.h
+++ b/src/global.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -129,7 +129,7 @@ public:
out << '-' << Ledger_VERSION_DATE;
out << _(", the command-line accounting tool");
out <<
- _("\n\nCopyright (c) 2003-2016, John Wiegley. All rights reserved.\n\n\
+ _("\n\nCopyright (c) 2003-2017, John Wiegley. All rights reserved.\n\n\
This program is made available under the terms of the BSD Public License.\n\
See LICENSE file included with the distribution for details and disclaimer.");
out << std::endl;
diff --git a/src/history.cc b/src/history.cc
index 25d42b06..48f3a80e 100644
--- a/src/history.cc
+++ b/src/history.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/history.h b/src/history.h
index 37efb068..06cda7a8 100644
--- a/src/history.h
+++ b/src/history.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/item.cc b/src/item.cc
index 0402f467..e56a29b6 100644
--- a/src/item.cc
+++ b/src/item.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/item.h b/src/item.h
index 4dc6df7e..6bd09855 100644
--- a/src/item.h
+++ b/src/item.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/iterators.cc b/src/iterators.cc
index 88233ea1..222ba10d 100644
--- a/src/iterators.cc
+++ b/src/iterators.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -201,7 +201,7 @@ void sorted_accounts_iterator::push_back(account_t& account)
std::stable_sort(accounts_list.back().begin(),
accounts_list.back().end(),
- compare_items<account_t>(sort_cmp));
+ compare_items<account_t>(sort_cmp, report));
#if DEBUG_ON
if (SHOW_DEBUG("account.sorted")) {
@@ -234,7 +234,7 @@ void sorted_accounts_iterator::sort_accounts(account_t& account,
deque.push_back(pair.second);
std::stable_sort(deque.begin(), deque.end(),
- compare_items<account_t>(sort_cmp));
+ compare_items<account_t>(sort_cmp, report));
#if DEBUG_ON
if (SHOW_DEBUG("account.sorted")) {
diff --git a/src/iterators.h b/src/iterators.h
index a3f535b1..818b0ccd 100644
--- a/src/iterators.h
+++ b/src/iterators.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -50,6 +50,7 @@
namespace ledger {
class journal_t;
+class report_t;
template <typename Derived, typename Value, typename CategoryOrTraversal>
class iterator_facade_base
@@ -279,8 +280,9 @@ class sorted_accounts_iterator
: public iterator_facade_base<sorted_accounts_iterator, account_t *,
boost::forward_traversal_tag>
{
- expr_t sort_cmp;
- bool flatten_all;
+ expr_t sort_cmp;
+ report_t& report;
+ bool flatten_all;
typedef std::deque<account_t *> accounts_deque_t;
@@ -290,16 +292,21 @@ class sorted_accounts_iterator
public:
sorted_accounts_iterator(account_t& account,
- const expr_t& _sort_cmp, bool _flatten_all)
- : sort_cmp(_sort_cmp), flatten_all(_flatten_all) {
+ const expr_t& _sort_cmp,
+ report_t& _report,
+ bool _flatten_all)
+ : sort_cmp(_sort_cmp), report(_report),
+ flatten_all(_flatten_all) {
push_back(account);
increment();
- TRACE_CTOR(sorted_accounts_iterator, "account_t&, expr_t, bool");
+ TRACE_CTOR(sorted_accounts_iterator,
+ "account_t&, expr_t, report_t&, bool");
}
sorted_accounts_iterator(const sorted_accounts_iterator& i)
: iterator_facade_base<sorted_accounts_iterator, account_t *,
boost::forward_traversal_tag>(i),
- sort_cmp(i.sort_cmp), flatten_all(i.flatten_all),
+ sort_cmp(i.sort_cmp), report(i.report),
+ flatten_all(i.flatten_all),
accounts_list(i.accounts_list),
sorted_accounts_i(i.sorted_accounts_i),
sorted_accounts_end(i.sorted_accounts_end) {
diff --git a/src/journal.cc b/src/journal.cc
index 36fe5fc0..023fd38e 100644
--- a/src/journal.cc
+++ b/src/journal.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/journal.h b/src/journal.h
index 76e1735d..59a23f4b 100644
--- a/src/journal.h
+++ b/src/journal.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/lookup.cc b/src/lookup.cc
index 11b7db61..8106f712 100644
--- a/src/lookup.cc
+++ b/src/lookup.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/lookup.h b/src/lookup.h
index 2c4e6575..f2ace5cd 100644
--- a/src/lookup.h
+++ b/src/lookup.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/main.cc b/src/main.cc
index 07192651..f0209ca0 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/mask.cc b/src/mask.cc
index c6868dde..4c908d11 100644
--- a/src/mask.cc
+++ b/src/mask.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/mask.h b/src/mask.h
index f416611f..d2a8a963 100644
--- a/src/mask.h
+++ b/src/mask.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/op.cc b/src/op.cc
index 97437ce3..56c2be30 100644
--- a/src/op.cc
+++ b/src/op.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/op.h b/src/op.h
index 937b321d..1c3843d6 100644
--- a/src/op.h
+++ b/src/op.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/option.cc b/src/option.cc
index 7c5c5e07..f9de9102 100644
--- a/src/option.cc
+++ b/src/option.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/option.h b/src/option.h
index b06c1754..c588dfce 100644
--- a/src/option.h
+++ b/src/option.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/org.cc b/src/org.cc
index 4d572415..7c2779c9 100644
--- a/src/org.cc
+++ b/src/org.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/org.h b/src/org.h
index da28c772..75f75dae 100644
--- a/src/org.h
+++ b/src/org.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/output.cc b/src/output.cc
index 418140ae..2a8c8201 100644
--- a/src/output.cc
+++ b/src/output.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -332,18 +332,19 @@ void report_tags::flush()
void report_tags::gather_metadata(item_t& item)
{
- if (item.metadata)
- foreach (const item_t::string_map::value_type& data, *item.metadata) {
- string tag(data.first);
- if (report.HANDLED(values) && data.second.first)
- tag += ": " + data.second.first.get().to_string();
-
- std::map<string, std::size_t>::iterator i = tags.find(tag);
- if (i == tags.end())
- tags.insert(tags_pair(tag, 1));
- else
- (*i).second++;
- }
+ if (! item.metadata)
+ return;
+ foreach (const item_t::string_map::value_type& data, *item.metadata) {
+ string tag(data.first);
+ if (report.HANDLED(values) && data.second.first)
+ tag += ": " + data.second.first.get().to_string();
+
+ std::map<string, std::size_t>::iterator i = tags.find(tag);
+ if (i == tags.end())
+ tags.insert(tags_pair(tag, 1));
+ else
+ (*i).second++;
+ }
}
void report_tags::operator()(post_t& post)
diff --git a/src/output.h b/src/output.h
index ea474e2b..40276ccb 100644
--- a/src/output.h
+++ b/src/output.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/parser.cc b/src/parser.cc
index 53b03a0c..7f942a15 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/parser.h b/src/parser.h
index 913179a1..31b070c5 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/pool.cc b/src/pool.cc
index dff02df8..931a1708 100644
--- a/src/pool.cc
+++ b/src/pool.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/pool.h b/src/pool.h
index 945fd083..6bc64e21 100644
--- a/src/pool.h
+++ b/src/pool.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/post.cc b/src/post.cc
index 8d2693c7..7b8763d6 100644
--- a/src/post.cc
+++ b/src/post.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/post.h b/src/post.h
index d7d8f7c4..3cc4657b 100644
--- a/src/post.h
+++ b/src/post.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/precmd.cc b/src/precmd.cc
index af8c5ee0..d0ab4d82 100644
--- a/src/precmd.cc
+++ b/src/precmd.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/precmd.h b/src/precmd.h
index 365cc1ba..ed168b10 100644
--- a/src/precmd.h
+++ b/src/precmd.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/predicate.h b/src/predicate.h
index aca44452..258a23af 100644
--- a/src/predicate.h
+++ b/src/predicate.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/print.cc b/src/print.cc
index 0cc23275..e52fae1b 100644
--- a/src/print.cc
+++ b/src/print.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/print.h b/src/print.h
index 70b26d65..ff4b8e7e 100644
--- a/src/print.h
+++ b/src/print.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/pstream.h b/src/pstream.h
index fc7fc8ca..a0cb47a0 100644
--- a/src/pstream.h
+++ b/src/pstream.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/ptree.cc b/src/ptree.cc
index 534db003..9c748bc9 100644
--- a/src/ptree.cc
+++ b/src/ptree.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/ptree.h b/src/ptree.h
index ca7b46e2..bf41c54f 100644
--- a/src/ptree.h
+++ b/src/ptree.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_account.cc b/src/py_account.cc
index c4a9ae07..0ebe737c 100644
--- a/src/py_account.cc
+++ b/src/py_account.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_amount.cc b/src/py_amount.cc
index 8a8ea871..f3e0d7e0 100644
--- a/src/py_amount.cc
+++ b/src/py_amount.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_balance.cc b/src/py_balance.cc
index 6a6c59fb..b608ed69 100644
--- a/src/py_balance.cc
+++ b/src/py_balance.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_commodity.cc b/src/py_commodity.cc
index c457e64d..a262dc16 100644
--- a/src/py_commodity.cc
+++ b/src/py_commodity.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_expr.cc b/src/py_expr.cc
index de3ac925..68b38459 100644
--- a/src/py_expr.cc
+++ b/src/py_expr.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_format.cc b/src/py_format.cc
index 4dcd4ba3..9123bfb0 100644
--- a/src/py_format.cc
+++ b/src/py_format.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_item.cc b/src/py_item.cc
index 644b11f1..6f412c9d 100644
--- a/src/py_item.cc
+++ b/src/py_item.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_journal.cc b/src/py_journal.cc
index 879f9548..ac923cca 100644
--- a/src/py_journal.cc
+++ b/src/py_journal.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_post.cc b/src/py_post.cc
index 85d4701a..fb50a7c4 100644
--- a/src/py_post.cc
+++ b/src/py_post.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_session.cc b/src/py_session.cc
index 0ddf66d2..7aa54959 100644
--- a/src/py_session.cc
+++ b/src/py_session.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_times.cc b/src/py_times.cc
index be3e4f31..f7270dcf 100644
--- a/src/py_times.cc
+++ b/src/py_times.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_utils.cc b/src/py_utils.cc
index 731294b2..9bb110f1 100644
--- a/src/py_utils.cc
+++ b/src/py_utils.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_value.cc b/src/py_value.cc
index 655337ba..922fbf8d 100644
--- a/src/py_value.cc
+++ b/src/py_value.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/py_xact.cc b/src/py_xact.cc
index f7283989..f0884b7d 100644
--- a/src/py_xact.cc
+++ b/src/py_xact.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/pyfstream.h b/src/pyfstream.h
index a90b121c..1da9ad7c 100644
--- a/src/pyfstream.h
+++ b/src/pyfstream.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/pyinterp.cc b/src/pyinterp.cc
index 81924c86..22f925c6 100644
--- a/src/pyinterp.cc
+++ b/src/pyinterp.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/pyinterp.h b/src/pyinterp.h
index 9c24b0cf..d719b198 100644
--- a/src/pyinterp.h
+++ b/src/pyinterp.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/pyledger.cc b/src/pyledger.cc
index a516f66d..878cd666 100644
--- a/src/pyledger.cc
+++ b/src/pyledger.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/pyutils.h b/src/pyutils.h
index 07ce7bdd..b4b07a36 100644
--- a/src/pyutils.h
+++ b/src/pyutils.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/query.cc b/src/query.cc
index a2117cfe..3f6c4873 100644
--- a/src/query.cc
+++ b/src/query.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/query.h b/src/query.h
index cbfac6bc..ad76c53c 100644
--- a/src/query.h
+++ b/src/query.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/quotes.cc b/src/quotes.cc
index cef9b713..02f0b693 100644
--- a/src/quotes.cc
+++ b/src/quotes.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/quotes.h b/src/quotes.h
index b3978171..03a13df1 100644
--- a/src/quotes.h
+++ b/src/quotes.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/report.cc b/src/report.cc
index 09cae692..2f3cc302 100644
--- a/src/report.cc
+++ b/src/report.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -431,8 +431,9 @@ namespace {
} else {
expr_t sort_expr(report.HANDLER(sort_).str());
sort_expr.set_context(&report);
- sorted_accounts_iterator iter(*report.session.journal->master,
- sort_expr, report.HANDLED(flat));
+ sorted_accounts_iterator iter(
+ *report.session.journal->master, sort_expr, report,
+ report.HANDLED(flat));
pass_down_accounts<sorted_accounts_iterator>
(handler, iter, predicate_t(report.HANDLER(display_).str(),
report.what_to_keep()), report);
@@ -444,8 +445,9 @@ namespace {
} else {
expr_t sort_expr(report.HANDLER(sort_).str());
sort_expr.set_context(&report);
- sorted_accounts_iterator iter(*report.session.journal->master,
- sort_expr, report.HANDLED(flat));
+ sorted_accounts_iterator iter(
+ *report.session.journal->master, sort_expr, report,
+ report.HANDLED(flat));
pass_down_accounts<sorted_accounts_iterator>(handler, iter);
}
}
diff --git a/src/report.h b/src/report.h
index 6bd3ca73..0c68b182 100644
--- a/src/report.h
+++ b/src/report.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/scope.cc b/src/scope.cc
index 03387549..83fddeee 100644
--- a/src/scope.cc
+++ b/src/scope.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/scope.h b/src/scope.h
index 147b400f..1bead5a7 100644
--- a/src/scope.h
+++ b/src/scope.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/select.cc b/src/select.cc
index 8e7786e6..af5815d1 100644
--- a/src/select.cc
+++ b/src/select.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/select.h b/src/select.h
index 89d7c989..6cff34e8 100644
--- a/src/select.h
+++ b/src/select.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/session.cc b/src/session.cc
index 8d03431f..deba3afa 100644
--- a/src/session.cc
+++ b/src/session.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -284,7 +284,7 @@ value_t session_t::fn_str(call_scope_t& args)
value_t session_t::fn_lot_price(call_scope_t& args)
{
- amount_t amt(args.get<amount_t>(1, false));
+ amount_t amt(args.get<amount_t>(0, false));
if (amt.has_annotation() && amt.annotation().price)
return *amt.annotation().price;
else
@@ -292,7 +292,7 @@ value_t session_t::fn_lot_price(call_scope_t& args)
}
value_t session_t::fn_lot_date(call_scope_t& args)
{
- amount_t amt(args.get<amount_t>(1, false));
+ amount_t amt(args.get<amount_t>(0, false));
if (amt.has_annotation() && amt.annotation().date)
return *amt.annotation().date;
else
@@ -300,7 +300,7 @@ value_t session_t::fn_lot_date(call_scope_t& args)
}
value_t session_t::fn_lot_tag(call_scope_t& args)
{
- amount_t amt(args.get<amount_t>(1, false));
+ amount_t amt(args.get<amount_t>(0, false));
if (amt.has_annotation() && amt.annotation().tag)
return string_value(*amt.annotation().tag);
else
diff --git a/src/session.h b/src/session.h
index 3d35a93e..bb9c5f7e 100644
--- a/src/session.h
+++ b/src/session.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/stats.cc b/src/stats.cc
index 2d1f8dc7..88d7157d 100644
--- a/src/stats.cc
+++ b/src/stats.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/stats.h b/src/stats.h
index dfb9e796..57ca210a 100644
--- a/src/stats.h
+++ b/src/stats.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/stream.cc b/src/stream.cc
index e07fd61d..98470480 100644
--- a/src/stream.cc
+++ b/src/stream.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/stream.h b/src/stream.h
index 996cffb1..3400647c 100644
--- a/src/stream.h
+++ b/src/stream.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/system.hh.in b/src/system.hh.in
index 331f7a0e..9df9c0fc 100644
--- a/src/system.hh.in
+++ b/src/system.hh.in
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/temps.cc b/src/temps.cc
index b8e7bfb6..5859284c 100644
--- a/src/temps.cc
+++ b/src/temps.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/temps.h b/src/temps.h
index eb2b9b23..7e65e118 100644
--- a/src/temps.h
+++ b/src/temps.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/textual.cc b/src/textual.cc
index 456ff8af..dcb69858 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/timelog.cc b/src/timelog.cc
index 870a4b4b..7004eb44 100644
--- a/src/timelog.cc
+++ b/src/timelog.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/timelog.h b/src/timelog.h
index 95a87eae..b1076c46 100644
--- a/src/timelog.h
+++ b/src/timelog.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/times.cc b/src/times.cc
index 8b0490ff..1fe9a58d 100644
--- a/src/times.cc
+++ b/src/times.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/times.h b/src/times.h
index df833958..fc50f4b9 100644
--- a/src/times.h
+++ b/src/times.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/token.cc b/src/token.cc
index f616ae3e..268c0e60 100644
--- a/src/token.cc
+++ b/src/token.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/token.h b/src/token.h
index b9ccde86..1bd6cd99 100644
--- a/src/token.h
+++ b/src/token.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/unistring.h b/src/unistring.h
index fc37c9f2..d6c3f5fd 100644
--- a/src/unistring.h
+++ b/src/unistring.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/utils.cc b/src/utils.cc
index fca9e6d4..145f5290 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/utils.h b/src/utils.h
index d4a03a73..adc882de 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/value.cc b/src/value.cc
index 878d7349..014f9e2d 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/value.h b/src/value.h
index eb0c7c76..5aa2060f 100644
--- a/src/value.h
+++ b/src/value.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/views.cc b/src/views.cc
index 65d21a9a..be880833 100644
--- a/src/views.cc
+++ b/src/views.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/views.h b/src/views.h
index 070ac22d..ee195504 100644
--- a/src/views.h
+++ b/src/views.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/xact.cc b/src/xact.cc
index 2524889d..69887437 100644
--- a/src/xact.cc
+++ b/src/xact.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/src/xact.h b/src/xact.h
index a43246ee..9371084f 100644
--- a/src/xact.h
+++ b/src/xact.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2017, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
diff --git a/test/baseline/feat-value-expr.test b/test/baseline/feat-value-expr.test
index 01f9780b..885fd194 100644
--- a/test/baseline/feat-value-expr.test
+++ b/test/baseline/feat-value-expr.test
@@ -77,7 +77,7 @@ account Expenses:Food5
2012-03-07 KFC
Expenses:Food7 1 CAD
- Assets:Cas7
+ Assets:Cash7
2012-03-08 XACT
Expenses:Food8 $1
diff --git a/test/convert.py b/test/convert.py
index 857d4d30..34152de2 100755
--- a/test/convert.py
+++ b/test/convert.py
@@ -3,7 +3,7 @@
# convert.py: This script converts a Boost.Test unit test into an
# equivalent Python unit test.
#
-# Copyright (c) 2003-2016, John Wiegley. All rights reserved.
+# Copyright (c) 2003-2017, John Wiegley. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
diff --git a/test/regress/1055.test b/test/regress/1055.test
new file mode 100644
index 00000000..e3e997fa
--- /dev/null
+++ b/test/regress/1055.test
@@ -0,0 +1,26 @@
+2011-01-01 * Opening balance
+ Assets:Broker 250.00 GBP = 250.00 GBP
+ Equity:Opening balance -250.00 GBP
+
+2011-02-01 * Buy 1 AAA for 10.00 GBP
+ Assets:Broker 1 AAA = 1 AAA
+ Assets:Broker -10.00 GBP
+
+2011-03-01 * Buy 1 AAA for 10.00 GBP
+ Assets:Broker 1 AAA = 2 AAA
+ Assets:Broker -10.00 GBP
+
+2011-04-01 * Buy 1 BBB for 15.00 GBP
+ Assets:Broker 1 BBB = 1 BBB
+ Assets:Broker -15.00 GBP
+
+test bal
+ 2 AAA
+ 1 BBB
+ 215.00 GBP Assets:Broker
+ -250.00 GBP Equity:Opening balance
+--------------------
+ 2 AAA
+ 1 BBB
+ -35.00 GBP
+end test
diff --git a/test/regress/1132.test b/test/regress/1132.test
new file mode 100644
index 00000000..d912ddcf
--- /dev/null
+++ b/test/regress/1132.test
@@ -0,0 +1,16 @@
+1994/09/02=1994/08/25 * Joe
+ Actif:Courant:BnpCc 126,00 F
+ Actif:Remboursement:Autre -126,00 F = 0,00 F
+
+1994/10/20=1994/08/25 * (3551465) Bill
+ Actif:Remboursement:Autre 126,00 F
+ Actif:Courant:BnpCc
+
+test bal -> 1
+__ERROR__
+While parsing file "$FILE", line 3:
+While parsing posting:
+ Actif:Remboursement:Autre -126,00 F = 0,00 F
+ ^^^^^^
+Error: Balance assertion off by 126,00 F (expected to see -126,00 F)
+end test
diff --git a/test/input/spaces.dat b/test/regress/550-584.test
index 1ada1b61..1c3be3b8 100644
--- a/test/input/spaces.dat
+++ b/test/regress/550-584.test
@@ -53,3 +53,21 @@
; COM commodity has three spaces after
Expenses:misc 1 COM
Assets:checking
+
+test payees
+test
+testcommodity
+end test
+
+test reg --group-by "tag('test')"
+spaces
+11-Nov-28 test Expenses:misc $1 $1
+11-Nov-28 test Expenses:misc $2 $3
+11-Nov-28 test Expenses:misc $4 $7
+11-Nov-28 test Expenses:misc $8 $15
+end test
+
+test commodities
+$
+COM
+end test