summaryrefslogtreecommitdiff
path: root/src/xact.cc
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-03-09 12:27:08 -0500
committerCraig Earls <enderw88@gmail.com>2013-03-09 12:27:08 -0500
commitca99c0de03432393aa6576244005c9ad8806fa29 (patch)
treebf0dd4586adb4b7df1adad8a5eff5d2bca36f4e3 /src/xact.cc
parent4c608cccd0c6f06f403882dcca36cb62a40178a2 (diff)
parentbfe360d4c992caf2e7da09ab058599c0404f1348 (diff)
downloadfork-ledger-ca99c0de03432393aa6576244005c9ad8806fa29.tar.gz
fork-ledger-ca99c0de03432393aa6576244005c9ad8806fa29.tar.bz2
fork-ledger-ca99c0de03432393aa6576244005c9ad8806fa29.zip
Merge branch 'next' into ledger-mode-automatic-transactions
Diffstat (limited to 'src/xact.cc')
-rw-r--r--src/xact.cc18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/xact.cc b/src/xact.cc
index d33520b4..8aecf5d6 100644
--- a/src/xact.cc
+++ b/src/xact.cc
@@ -847,10 +847,8 @@ void auto_xact_t::extend_xact(xact_base_t& xact, parse_context_t& context)
}
}
-void put_xact(property_tree::ptree& pt, const xact_t& xact)
+void put_xact(property_tree::ptree& st, const xact_t& xact)
{
- property_tree::ptree& st(pt.put("transaction", ""));
-
if (xact.state() == item_t::CLEARED)
st.put("<xmlattr>.state", "cleared");
else if (xact.state() == item_t::PENDING)
@@ -859,14 +857,10 @@ void put_xact(property_tree::ptree& pt, const xact_t& xact)
if (xact.has_flags(ITEM_GENERATED))
st.put("<xmlattr>.generated", "true");
- if (xact._date) {
- property_tree::ptree& t(st.put("date", ""));
- put_date(t, *xact._date, false);
- }
- if (xact._date_aux) {
- property_tree::ptree& t(st.put("aux-date", ""));
- put_date(t, *xact._date_aux, false);
- }
+ if (xact._date)
+ put_date(st.put("date", ""), *xact._date);
+ if (xact._date_aux)
+ put_date(st.put("aux-date", ""), *xact._date_aux);
if (xact.code)
st.put("code", *xact.code);
@@ -877,7 +871,7 @@ void put_xact(property_tree::ptree& pt, const xact_t& xact)
st.put("note", *xact.note);
if (xact.metadata)
- put_metadata(st, *xact.metadata);
+ put_metadata(st.put("metadata", ""), *xact.metadata);
}
} // namespace ledger