diff --git a/src/uncategorized/costsBudget.js b/src/uncategorized/costsBudget.js index 933341ccb4510075d4b3300c6f13a1c1fd1777fb..d2b977ec523eef23d3e2484b0107fbf7d14aee91 100644 --- a/src/uncategorized/costsBudget.js +++ b/src/uncategorized/costsBudget.js @@ -871,27 +871,32 @@ App.UI.Budget.Cost = function() { headline.textContent = title; cell.append(headline); cell = row.insertCell(); - cell.append(cashFormatColorDOM(F[group].income)); + cell.append(cashFormatColorDOM(F[group].income, null, true)); cell = row.insertCell(); - cell.append(cashFormatColorDOM(F[group].expenses)); + cell.append(cashFormatColorDOM(F[group].expenses, null, true)); cell = row.insertCell(); - cell.append(cashFormatColorDOM(F[group].profits)); + cell.append(cashFormatColorDOM(F[group].profits, null, true)); } } - function cashFormatColorDOM(s, invert = false) { + function cashFormatColorDOM(s, invert = false, temp) { if (invert) { s = -1 * s; } let el = document.createElement('span'); el.textContent = cashFormat(s); - // Display red if the value is negative, unless invert is true - if (s < 0) { - el.className = "red"; - // Yellow for positive - } else if (s > 0) { - el.className = "yellowgreen"; - // White for exactly zero + if (temp === true) { + // Gray display for totals when expanded + el.className = "gray"; + } else { + // Display red if the value is negative, unless invert is true + if (s < 0) { + el.className = "red"; + // Yellow for positive + } else if (s > 0) { + el.className = "yellowgreen"; + // White for exactly zero + } } return el; }