From 7cfc585deb5877c558f150a2fa90cfe5c705fcbb Mon Sep 17 00:00:00 2001 From: Gwyneth Morgan Date: Mon, 10 Oct 2022 19:36:55 +0000 Subject: xml: Include posting-specific payee in output In `ledger xml` export, include the ``-specific payee (from the `Payee:` tag) as ``. This data is already included under `` as ``, but that is more specific to Ledger's implementation; if in the future there is another way to set the payee (or perhaps an option to have the Payee tag in one's own language), that field wouldn't be a reliable method of getting this info. Example: 2022-01-01 Transaction-level payee a 10 b ; Payee: Posting-level payee Relevant XML output: 2022-01-01 Transaction-level payee a 10 10 Posting-level payee b -10 Payee: Posting-level payee Posting-level payee 0 --- src/post.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/post.cc') diff --git a/src/post.cc b/src/post.cc index 308283af..7c5379c4 100644 --- a/src/post.cc +++ b/src/post.cc @@ -723,6 +723,9 @@ void put_post(property_tree::ptree& st, const post_t& post) if (post._date_aux) put_date(st.put("aux-date", ""), *post._date_aux); + if (post.payee_from_tag() != "") + st.put("payee", post.payee_from_tag()); + if (post.account) { property_tree::ptree& t(st.put("account", "")); -- cgit v1.2.3