summaryrefslogtreecommitdiff
path: root/src/textual.cc
diff options
context:
space:
mode:
authorDiogo Trentini <diogotrentini@gmail.com>2020-09-16 22:38:01 -0300
committerMartin Michlmayr <tbm@cyrius.com>2021-02-02 17:45:10 +0800
commit5560b0c40f3986704df25095fcc485bcc1de9e5b (patch)
treef61df53eea9a57da82717409c89b1309f09ecd32 /src/textual.cc
parentebd2d8dd0865ef41d1931c5304cb42ee1b312cb7 (diff)
downloadfork-ledger-5560b0c40f3986704df25095fcc485bcc1de9e5b.tar.gz
fork-ledger-5560b0c40f3986704df25095fcc485bcc1de9e5b.tar.bz2
fork-ledger-5560b0c40f3986704df25095fcc485bcc1de9e5b.zip
Fix issues related to payees declared on posting's metadata
Payees declared on posting's metadata are now validated with `--check-payees` option. Also, their aliases are now considered on reports as well.
Diffstat (limited to 'src/textual.cc')
-rw-r--r--src/textual.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/textual.cc b/src/textual.cc
index 70bf4129..b8523dbe 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -1033,7 +1033,7 @@ void instance_t::account_value_directive(account_t * account, string expr_str)
void instance_t::payee_directive(char * line)
{
- string payee = context.journal->register_payee(line, NULL);
+ string payee = context.journal->register_payee(line);
while (peek_whitespace_line()) {
read_line(line);
@@ -1756,6 +1756,10 @@ post_t * instance_t::parse_post(char * line,
foreach (string& tag, tags)
post->parse_tags(tag.c_str(), *context.scope, true);
+ string post_payee = post->payee_from_tag();
+ if (post_payee != "")
+ post->set_payee(context.journal->validate_payee(post_payee));
+
TRACE_STOP(post_details, 1);
return post.release();
@@ -1874,7 +1878,7 @@ xact_t * instance_t::parse_xact(char * line,
}
++p;
}
- xact->payee = context.journal->register_payee(next, xact.get());
+ xact->payee = context.journal->validate_payee(next);
next = p;
} else {
xact->payee = _("<Unspecified payee>");