Renamed XACT_BALANCE flag to XACT_MUST_BALANCE.
This commit is contained in:
parent
e85a52b72b
commit
1edb531c05
3 changed files with 8 additions and 8 deletions
|
|
@ -197,7 +197,7 @@ void handle_value(const value_t& value,
|
||||||
if (! account->xdata().has_flags(ACCOUNT_EXT_HAS_NON_VIRTUALS)) {
|
if (! account->xdata().has_flags(ACCOUNT_EXT_HAS_NON_VIRTUALS)) {
|
||||||
xact.add_flags(XACT_VIRTUAL);
|
xact.add_flags(XACT_VIRTUAL);
|
||||||
if (! account->xdata().has_flags(ACCOUNT_EXT_HAS_UNB_VIRTUALS))
|
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());
|
xact_t::xdata_t& xdata(xact.xdata());
|
||||||
|
|
@ -420,7 +420,7 @@ void subtotal_xacts::operator()(xact_t& xact)
|
||||||
|
|
||||||
if (! xact.has_flags(XACT_VIRTUAL))
|
if (! xact.has_flags(XACT_VIRTUAL))
|
||||||
xact.reported_account()->xdata().add_flags(ACCOUNT_EXT_HAS_NON_VIRTUALS);
|
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);
|
xact.reported_account()->xdata().add_flags(ACCOUNT_EXT_HAS_UNB_VIRTUALS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,7 @@ xact_t * parse_xact(char * line, account_t * account, entry_t * entry = NULL)
|
||||||
"line " << linenum << ": " << "Parsed a virtual account name");
|
"line " << linenum << ": " << "Parsed a virtual account name");
|
||||||
|
|
||||||
if (*b == '[') {
|
if (*b == '[') {
|
||||||
xact->add_flags(XACT_BALANCE);
|
xact->add_flags(XACT_MUST_BALANCE);
|
||||||
DEBUG("ledger.textual.parse",
|
DEBUG("ledger.textual.parse",
|
||||||
"line " << linenum << ": " << "Transaction must balance");
|
"line " << linenum << ": " << "Transaction must balance");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
10
src/xact.h
10
src/xact.h
|
|
@ -45,10 +45,10 @@ typedef std::list<xact_t *> xacts_list;
|
||||||
class xact_t : public item_t
|
class xact_t : public item_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
#define XACT_VIRTUAL 0x0100 // the account was specified with (parens)
|
#define XACT_VIRTUAL 0x0100 // the account was specified with (parens)
|
||||||
#define XACT_BALANCE 0x0200 // the account was specified with [brackets]
|
#define XACT_MUST_BALANCE 0x0200 // the account was specified with [brackets]
|
||||||
#define XACT_AUTO 0x0400 // transaction created by automated entry
|
#define XACT_AUTO 0x0400 // transaction created by automated entry
|
||||||
#define XACT_CALCULATED 0x0800 // transaction's amount was auto-calculated
|
#define XACT_CALCULATED 0x0800 // transaction's amount was auto-calculated
|
||||||
|
|
||||||
entry_t * entry; // only set for xacts of regular entries
|
entry_t * entry; // only set for xacts of regular entries
|
||||||
account_t * account;
|
account_t * account;
|
||||||
|
|
@ -96,7 +96,7 @@ public:
|
||||||
virtual state_t state() const;
|
virtual state_t state() const;
|
||||||
|
|
||||||
bool must_balance() 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);
|
virtual expr_t::ptr_op_t lookup(const string& name);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue