diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-10 12:29:58 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-10 12:29:58 -0400 |
commit | 685b12d8d3d225498f6dfdbe7b17056684cc2ca8 (patch) | |
tree | 1077572642a7ac55f29a31d95288c79e1dc03a74 /src/xact.cc | |
parent | a2bcfe4338801d1979ee859a3ce6cc289f80a5aa (diff) | |
download | fork-ledger-685b12d8d3d225498f6dfdbe7b17056684cc2ca8.tar.gz fork-ledger-685b12d8d3d225498f6dfdbe7b17056684cc2ca8.tar.bz2 fork-ledger-685b12d8d3d225498f6dfdbe7b17056684cc2ca8.zip |
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
Diffstat (limited to 'src/xact.cc')
-rw-r--r-- | src/xact.cc | 6 |
1 files changed, 6 insertions, 0 deletions
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) { |