Extract with_totals from renderSubTotals

This commit is contained in:
Thomas Lauf 2018-12-28 00:12:40 +01:00
parent 551605a8ba
commit 9294fae712

View file

@ -217,8 +217,9 @@ int renderChart (
const auto with_summary = rules.getBoolean ("reports." + type + ".summary"); const auto with_summary = rules.getBoolean ("reports." + type + ".summary");
const auto with_holidays = rules.getBoolean ("reports." + type + ".holidays"); const auto with_holidays = rules.getBoolean ("reports." + type + ".holidays");
const auto with_totals = rules.getBoolean ("reports." + type + ".totals");
std::cout << renderSubTotal (type, rules, first_hour, last_hour, total_work) std::cout << (with_totals ? renderSubTotal (type, rules, first_hour, last_hour, total_work) : "")
<< (with_holidays ? renderHolidays (rules, filter, rules.all ("holidays.")) : "") << (with_holidays ? renderHolidays (rules, filter, rules.all ("holidays.")) : "")
<< (with_summary ? renderSummary (indent, filter, exclusions, tracked, blank) : ""); << (with_summary ? renderSummary (indent, filter, exclusions, tracked, blank) : "");
@ -415,8 +416,6 @@ static std::string renderSubTotal (
time_t total_work) time_t total_work)
{ {
std::stringstream out; std::stringstream out;
if (rules.getBoolean ("reports." + type + ".totals"))
{
auto indent = getIndentSize (type, rules); auto indent = getIndentSize (type, rules);
int spacing = rules.getInteger ("reports." + type + ".spacing"); int spacing = rules.getInteger ("reports." + type + ".spacing");
@ -439,7 +438,6 @@ static std::string renderSubTotal (
<< ':' << ':'
<< std::setw (2) << std::setfill ('0') << minutes << std::setw (2) << std::setfill ('0') << minutes
<< '\n'; << '\n';
}
return out.str (); return out.str ();
} }