Interpolate uses of $account in automated postings
Fixes 5CB52887-408E-48F0-8798-3C640D0295B3
This commit is contained in:
parent
68056c1948
commit
a596727d3d
1 changed files with 8 additions and 2 deletions
10
src/xact.cc
10
src/xact.cc
|
|
@ -716,8 +716,14 @@ void auto_xact_t::extend_xact(xact_base_t& xact)
|
||||||
account_t * account = post->account;
|
account_t * account = post->account;
|
||||||
string fullname = account->fullname();
|
string fullname = account->fullname();
|
||||||
assert(! fullname.empty());
|
assert(! fullname.empty());
|
||||||
if (fullname == "$account" || fullname == "@account")
|
|
||||||
account = initial_post->account;
|
if (contains(fullname, "$account")) {
|
||||||
|
fullname = regex_replace(fullname, regex("\\$account\\>"),
|
||||||
|
initial_post->account->fullname());
|
||||||
|
while (account->parent)
|
||||||
|
account = account->parent;
|
||||||
|
account = account->find_account(fullname);
|
||||||
|
}
|
||||||
|
|
||||||
// Copy over details so that the resulting post is a mirror of
|
// Copy over details so that the resulting post is a mirror of
|
||||||
// the automated xact's one.
|
// the automated xact's one.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue