From 6828b8e89bdd9328c81e81e98088143786559976 Mon Sep 17 00:00:00 2001 From: Christoph Dittmann Date: Sun, 17 Jun 2018 11:23:31 +0100 Subject: Expose post_t::given_cost over python This fixes #1655 by making the post_t::given_cost variable accessible over python. This allows access to the given cost of a posting. For example, here it will be "-2 EUR": A -2 XXX {1 EUR} [2018-01-01] @@ 2 EUR If a per-unit cost is given, the given_cost variable will still contain the cost of the posting. For example, here it will be "-4 EUR": B -2 XXX {1 EUR} [2018-01-01] @ 2 EUR --- src/py_post.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/py_post.cc') diff --git a/src/py_post.cc b/src/py_post.cc index 6195570b..525b47c2 100644 --- a/src/py_post.cc +++ b/src/py_post.cc @@ -153,6 +153,11 @@ void export_post() return_value_policy()), make_setter(&post_t::cost, return_value_policy())) + .add_property("given_cost", + make_getter(&post_t::given_cost, + return_value_policy()), + make_setter(&post_t::given_cost, + return_value_policy())) .add_property("assigned_amount", make_getter(&post_t::assigned_amount, return_value_policy()), -- cgit v1.2.3