(parse_transaction): Assign the entry to an xact while parsing it so
that the 'd' variable is available to value expressions within a transaction amount or cost.
This commit is contained in:
parent
a597b0fb5e
commit
935f849c7d
1 changed files with 5 additions and 2 deletions
|
|
@ -171,10 +171,13 @@ value_expr_t * parse_amount(const char * text, amount_t& amt,
|
||||||
return expr;
|
return expr;
|
||||||
}
|
}
|
||||||
|
|
||||||
transaction_t * parse_transaction(char * line, account_t * account)
|
transaction_t * parse_transaction(char * line, account_t * account,
|
||||||
|
entry_t * entry = NULL)
|
||||||
{
|
{
|
||||||
// The account will be determined later...
|
// The account will be determined later...
|
||||||
std::auto_ptr<transaction_t> xact(new transaction_t(NULL));
|
std::auto_ptr<transaction_t> xact(new transaction_t(NULL));
|
||||||
|
if (entry)
|
||||||
|
xact->entry = entry;
|
||||||
|
|
||||||
// The call to `next_element' will skip past the account name, and
|
// The call to `next_element' will skip past the account name, and
|
||||||
// return a pointer to the beginning of the amount. Once we know
|
// return a pointer to the beginning of the amount. Once we know
|
||||||
|
|
@ -455,7 +458,7 @@ entry_t * parse_entry(std::istream& in, char * line, account_t * master,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transaction_t * xact = parse_transaction(line, master)) {
|
if (transaction_t * xact = parse_transaction(line, master, curr.get())) {
|
||||||
if (state != transaction_t::UNCLEARED &&
|
if (state != transaction_t::UNCLEARED &&
|
||||||
xact->state == transaction_t::UNCLEARED)
|
xact->state == transaction_t::UNCLEARED)
|
||||||
xact->state = state;
|
xact->state = state;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue