Renamed XACT_BALANCE flag to XACT_MUST_BALANCE.

This commit is contained in:
John Wiegley 2008-09-19 08:08:28 -04:00
parent e85a52b72b
commit 1edb531c05
3 changed files with 8 additions and 8 deletions

View file

@ -197,7 +197,7 @@ void handle_value(const value_t& value,
if (! account->xdata().has_flags(ACCOUNT_EXT_HAS_NON_VIRTUALS)) {
xact.add_flags(XACT_VIRTUAL);
if (! account->xdata().has_flags(ACCOUNT_EXT_HAS_UNB_VIRTUALS))
xact.add_flags(XACT_BALANCE);
xact.add_flags(XACT_MUST_BALANCE);
}
xact_t::xdata_t& xdata(xact.xdata());
@ -420,7 +420,7 @@ void subtotal_xacts::operator()(xact_t& xact)
if (! xact.has_flags(XACT_VIRTUAL))
xact.reported_account()->xdata().add_flags(ACCOUNT_EXT_HAS_NON_VIRTUALS);
else if (! xact.has_flags(XACT_BALANCE))
else if (! xact.has_flags(XACT_MUST_BALANCE))
xact.reported_account()->xdata().add_flags(ACCOUNT_EXT_HAS_UNB_VIRTUALS);
}

View file

@ -168,7 +168,7 @@ xact_t * parse_xact(char * line, account_t * account, entry_t * entry = NULL)
"line " << linenum << ": " << "Parsed a virtual account name");
if (*b == '[') {
xact->add_flags(XACT_BALANCE);
xact->add_flags(XACT_MUST_BALANCE);
DEBUG("ledger.textual.parse",
"line " << linenum << ": " << "Transaction must balance");
}

View file

@ -45,10 +45,10 @@ typedef std::list<xact_t *> xacts_list;
class xact_t : public item_t
{
public:
#define XACT_VIRTUAL 0x0100 // the account was specified with (parens)
#define XACT_BALANCE 0x0200 // the account was specified with [brackets]
#define XACT_AUTO 0x0400 // transaction created by automated entry
#define XACT_CALCULATED 0x0800 // transaction's amount was auto-calculated
#define XACT_VIRTUAL 0x0100 // the account was specified with (parens)
#define XACT_MUST_BALANCE 0x0200 // the account was specified with [brackets]
#define XACT_AUTO 0x0400 // transaction created by automated entry
#define XACT_CALCULATED 0x0800 // transaction's amount was auto-calculated
entry_t * entry; // only set for xacts of regular entries
account_t * account;
@ -96,7 +96,7 @@ public:
virtual state_t state() const;
bool must_balance() const {
return ! has_flags(XACT_VIRTUAL) || has_flags(XACT_BALANCE);
return ! has_flags(XACT_VIRTUAL) || has_flags(XACT_MUST_BALANCE);
}
virtual expr_t::ptr_op_t lookup(const string& name);