summaryrefslogtreecommitdiff
path: root/src/timelog.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-13 03:41:00 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-03-13 03:41:00 -0500
commitcfe8142b2b371dd40867e010b6b6c58fe864ba21 (patch)
treee5a024f8a61281db8225acb3576b0137e9ec9a83 /src/timelog.cc
parentcb317f9d395f44b2c2fc48f02869c3ed0f5ebcd0 (diff)
downloadfork-ledger-cfe8142b2b371dd40867e010b6b6c58fe864ba21.tar.gz
fork-ledger-cfe8142b2b371dd40867e010b6b6c58fe864ba21.tar.bz2
fork-ledger-cfe8142b2b371dd40867e010b6b6c58fe864ba21.zip
Access to checkin/checkout of timelog entries
Diffstat (limited to 'src/timelog.cc')
-rw-r--r--src/timelog.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/timelog.cc b/src/timelog.cc
index b46d3922..00cefe10 100644
--- a/src/timelog.cc
+++ b/src/timelog.cc
@@ -76,6 +76,11 @@ namespace {
(_("Timelog check-out event does not match any current check-ins"));
}
+ if (event.checkin.is_not_a_date_time())
+ throw parse_error(_("Timelog check-in has no corresponding check-out"));
+ if (out_event.checkin.is_not_a_date_time())
+ throw parse_error(_("Timelog check-out has no corresponding check-in"));
+
if (out_event.checkin < event.checkin)
throw parse_error
(_("Timelog check-out date less than corresponding check-in"));
@@ -107,6 +112,8 @@ namespace {
post_t * post = new post_t(event.account, amt, POST_VIRTUAL);
post->set_state(item_t::CLEARED);
post->pos = event.position;
+ post->checkin = event.checkin;
+ post->checkout = out_event.checkin;
curr->add_post(post);
event.account->add_post(post);