summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/textual.cc5
-rw-r--r--test/regress/1038_1.test18
-rw-r--r--test/regress/1038_2.test18
-rw-r--r--test/regress/1038_3.test20
4 files changed, 61 insertions, 0 deletions
diff --git a/src/textual.cc b/src/textual.cc
index f0df3b66..8007ca0d 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -285,6 +285,11 @@ void instance_t::parse()
}
}
+ if (apply_stack.front().value.type() == typeid(optional<datetime_t>))
+ epoch = boost::get<optional<datetime_t> >(apply_stack.front().value);
+
+ apply_stack.pop_front();
+
#if defined(TIMELOG_SUPPORT)
timelog.close();
#endif // TIMELOG_SUPPORT
diff --git a/test/regress/1038_1.test b/test/regress/1038_1.test
new file mode 100644
index 00000000..c833816e
--- /dev/null
+++ b/test/regress/1038_1.test
@@ -0,0 +1,18 @@
+Y2014
+
+04/13 Bank
+ Expenses:Loan $400
+ Assets:Cash
+
+05/13 Bug 1038 Test
+ Expenses:Some:Account $500
+ Assets:Cash
+
+06/13 Landlord
+ Expenses:Rent $600
+ Assets:Cash
+
+test reg --now 2014-05-14 -p 'this month'
+14-May-13 Bug 1038 Test Expenses:Some:Account $500 $500
+ Assets:Cash $-500 0
+end test
diff --git a/test/regress/1038_2.test b/test/regress/1038_2.test
new file mode 100644
index 00000000..ce0c046d
--- /dev/null
+++ b/test/regress/1038_2.test
@@ -0,0 +1,18 @@
+year 2014
+
+04/13 Bank
+ Expenses:Loan $400
+ Assets:Cash
+
+05/13 Bug 1038 Test
+ Expenses:Some:Account $500
+ Assets:Cash
+
+06/13 Landlord
+ Expenses:Rent $600
+ Assets:Cash
+
+test reg --now 2014-05-14 -p 'this month'
+14-May-13 Bug 1038 Test Expenses:Some:Account $500 $500
+ Assets:Cash $-500 0
+end test
diff --git a/test/regress/1038_3.test b/test/regress/1038_3.test
new file mode 100644
index 00000000..0e277d71
--- /dev/null
+++ b/test/regress/1038_3.test
@@ -0,0 +1,20 @@
+apply year 2014
+
+04/13 Bank
+ Expenses:Loan $400
+ Assets:Cash
+
+05/13 Bug 1038 Test
+ Expenses:Some:Account $500
+ Assets:Cash
+
+06/13 Landlord
+ Expenses:Rent $600
+ Assets:Cash
+
+end apply
+
+test reg --now 2014-05-14 -p 'this month'
+14-May-13 Bug 1038 Test Expenses:Some:Account $500 $500
+ Assets:Cash $-500 0
+end test