From 685b12d8d3d225498f6dfdbe7b17056684cc2ca8 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 10 Jun 2010 12:29:58 -0400 Subject: Allow fixated costs, as well as prices You can now establish a fixated price automatically by way of a fixated cost. The syntax for this is: 2009/11/01 Sample Assets 1 apple @ =$0.10 Equity --- src/xact.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/xact.cc') diff --git a/src/xact.cc b/src/xact.cc index 77a55c66..60186b1e 100644 --- a/src/xact.cc +++ b/src/xact.cc @@ -300,6 +300,12 @@ bool xact_base_t::finalize() post->amount = breakdown.amount; DEBUG("xact.finalize", "added breakdown, balance = " << balance); } + + if (post->has_flags(POST_COST_FIXATED) && + post->amount.has_annotation() && post->amount.annotation().price) { + DEBUG("xact.finalize", "fixating annotation price"); + post->amount.annotation().add_flags(ANNOTATION_PRICE_FIXATED); + } } if (null_post != NULL) { -- cgit v1.2.3