summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-02-28 02:47:22 -0600
committerJohn Wiegley <johnw@newartisans.com>2012-02-28 02:47:22 -0600
commit7a55c7ffc1e3565c82c746ea66dbb6af2e3d8509 (patch)
treecba2d3971f66ada7e4bcbbce975b0256aa2ac2f3
parent6adfcc8469e3d526f4bcb0971b49efb490ad6401 (diff)
downloadfork-ledger-7a55c7ffc1e3565c82c746ea66dbb6af2e3d8509.tar.gz
fork-ledger-7a55c7ffc1e3565c82c746ea66dbb6af2e3d8509.tar.bz2
fork-ledger-7a55c7ffc1e3565c82c746ea66dbb6af2e3d8509.zip
Allow xact notes on periodic transactions
Fixes #448
-rw-r--r--src/textual.cc9
-rw-r--r--test/regress/CFE5D8AA.test20
2 files changed, 26 insertions, 3 deletions
diff --git a/src/textual.cc b/src/textual.cc
index f6cbf070..739b63f0 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -1565,9 +1565,12 @@ bool instance_t::parse_posts(account_t * account,
std::streamsize len = read_line(line);
assert(len > 0);
- if (post_t * post = parse_post(line, len, account, NULL, defer_expr)) {
- xact.add_post(post);
- added = true;
+ char * p = skip_ws(line);
+ if (*p != ';') {
+ if (post_t * post = parse_post(line, len, account, NULL, defer_expr)) {
+ xact.add_post(post);
+ added = true;
+ }
}
}
diff --git a/test/regress/CFE5D8AA.test b/test/regress/CFE5D8AA.test
new file mode 100644
index 00000000..857dad13
--- /dev/null
+++ b/test/regress/CFE5D8AA.test
@@ -0,0 +1,20 @@
+~ monthly
+ assets:checking $1,000.00
+ income:work:salary $-1,000.00
+
+~ monthly
+ ; note
+ assets:checking $1,000.00
+ income:work:salary $-1,000.00
+
+~ monthly
+ assets:checking $1,000.00
+ income:work:salary
+
+~ monthly
+ ; note
+ assets:checking $1,000.00
+ income:work:salary
+
+test reg
+end test