Got changed_value_xacts working again.
This commit is contained in:
parent
ce49245667
commit
ad9a469a2a
2 changed files with 9 additions and 20 deletions
|
|
@ -310,15 +310,7 @@ void changed_value_xacts::output_diff(const date_t& date)
|
||||||
value_t cur_bal;
|
value_t cur_bal;
|
||||||
|
|
||||||
last_xact->xdata().date = date;
|
last_xact->xdata().date = date;
|
||||||
#if 0
|
cur_bal = total_expr.calc(*last_xact).round();
|
||||||
compute_total(cur_bal, details_t(*last_xact));
|
|
||||||
#endif
|
|
||||||
cur_bal.round();
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
// jww (2008-04-24): What does this do?
|
|
||||||
last_xact->xdata().date = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (value_t diff = cur_bal - last_balance) {
|
if (value_t diff = cur_bal - last_balance) {
|
||||||
entry_temps.push_back(entry_t());
|
entry_temps.push_back(entry_t());
|
||||||
|
|
@ -341,12 +333,8 @@ void changed_value_xacts::operator()(xact_t& xact)
|
||||||
|
|
||||||
item_handler<xact_t>::operator()(xact);
|
item_handler<xact_t>::operator()(xact);
|
||||||
|
|
||||||
#if 0
|
last_balance = total_expr.calc(xact).round();
|
||||||
compute_total(last_balance, details_t(xact));
|
last_xact = &xact;
|
||||||
#endif
|
|
||||||
last_balance.round();
|
|
||||||
|
|
||||||
last_xact = &xact;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void component_xacts::operator()(xact_t& xact)
|
void component_xacts::operator()(xact_t& xact)
|
||||||
|
|
@ -355,10 +343,9 @@ void component_xacts::operator()(xact_t& xact)
|
||||||
if (xact.has_xdata() &&
|
if (xact.has_xdata() &&
|
||||||
xact.xdata().has_component_xacts())
|
xact.xdata().has_component_xacts())
|
||||||
#if 0
|
#if 0
|
||||||
xact.xdata().walk_component_xacts(*handler);
|
xact.xdata().walk_component_xacts(*handler)
|
||||||
#else
|
|
||||||
;
|
|
||||||
#endif
|
#endif
|
||||||
|
;
|
||||||
else
|
else
|
||||||
(*handler)(xact);
|
(*handler)(xact);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -366,6 +366,7 @@ class changed_value_xacts : public item_handler<xact_t>
|
||||||
// This filter requires that calc_xacts be used at some point
|
// This filter requires that calc_xacts be used at some point
|
||||||
// later in the chain.
|
// later in the chain.
|
||||||
|
|
||||||
|
expr_t total_expr;
|
||||||
bool changed_values_only;
|
bool changed_values_only;
|
||||||
xact_t * last_xact;
|
xact_t * last_xact;
|
||||||
value_t last_balance;
|
value_t last_balance;
|
||||||
|
|
@ -377,8 +378,9 @@ class changed_value_xacts : public item_handler<xact_t>
|
||||||
|
|
||||||
public:
|
public:
|
||||||
changed_value_xacts(xact_handler_ptr handler,
|
changed_value_xacts(xact_handler_ptr handler,
|
||||||
bool _changed_values_only)
|
const expr_t& _total_expr,
|
||||||
: item_handler<xact_t>(handler),
|
bool _changed_values_only)
|
||||||
|
: item_handler<xact_t>(handler), total_expr(_total_expr),
|
||||||
changed_values_only(_changed_values_only), last_xact(NULL) {
|
changed_values_only(_changed_values_only), last_xact(NULL) {
|
||||||
TRACE_CTOR(changed_value_xacts,
|
TRACE_CTOR(changed_value_xacts,
|
||||||
"xact_handler_ptr, bool");
|
"xact_handler_ptr, bool");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue