From f1a2a5a18d5e7104ad308b2f56a9188f441bb7f2 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 7 Dec 2009 21:23:50 -0500 Subject: Cost of a post with neg. amount should be negative --- src/draft.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/draft.cc') diff --git a/src/draft.cc b/src/draft.cc index 8478a31d..fc53e956 100644 --- a/src/draft.cc +++ b/src/draft.cc @@ -458,6 +458,9 @@ xact_t * draft_t::insert(journal_t& journal) *post.cost *= new_post->amount; post.cost->set_commodity(cost_commodity); } + else if (new_post->amount.sign() < 0) { + new_post->cost->in_place_negate(); + } new_post->cost = *post.cost; DEBUG("derive.xact", "Copied over posting cost"); -- cgit v1.2.3