diff --git a/src/js/utilsFC.js b/src/js/utilsFC.js index 2e21bd32214e1f6ec37813b5e1f7fdccfcd9c64a..b73cfd0182477d34e26b9ba7a25ccf96f651e47a 100644 --- a/src/js/utilsFC.js +++ b/src/js/utilsFC.js @@ -34,43 +34,6 @@ globalThis.Categorizer = class { } }; -/** - * @param {string} category - * @param {string} title - * @returns {string} - */ -globalThis.budgetLine = function(category, title) { - let income; - let expenses; - - if (passage() === "Rep Budget") { - income = "lastWeeksRepIncome"; - expenses = "lastWeeksRepExpenses"; - - if (V[income][category] || V[expenses][category] || V.showAllEntries.repBudget) { - return `<tr>\ - <td>${title}</td>\ - <td>${repFormat(V[income][category])}</td>\ - <td>${repFormat(V[expenses][category])}</td>\ - <td>${repFormat(V[income][category] + V[expenses][category])}</td>\ - </tr>`; - } - } else if (passage() === "Costs Budget") { - income = "lastWeeksCashIncome"; - expenses = "lastWeeksCashExpenses"; - - if (V[income][category] || V[expenses][category] || V.showAllEntries.costsBudget) { - return `<tr>\ - <td>${title}</td>\ - <td>${cashFormatColor(V[income][category])}</td>\ - <td>${cashFormatColor(-Math.abs(V[expenses][category]))}</td>\ - <td>${cashFormatColor(V[income][category] + V[expenses][category])}</td>\ - </tr>`; - } - } - return ``; -}; - /* Make everything waiting for this execute. Usage: diff --git a/src/uncategorized/repBudget.js b/src/uncategorized/repBudget.js new file mode 100644 index 0000000000000000000000000000000000000000..dbdc715633d06773cb7ba87f766e9fd105f1c354 --- /dev/null +++ b/src/uncategorized/repBudget.js @@ -0,0 +1,36 @@ +/** + * @param {string} category + * @param {string} title + * @returns {string} + */ +globalThis.budgetLine = function(category, title) { + let income; + let expenses; + + if (passage() === "Rep Budget") { + income = "lastWeeksRepIncome"; + expenses = "lastWeeksRepExpenses"; + + if (V[income][category] || V[expenses][category] || V.showAllEntries.repBudget) { + return `<tr>\ + <td>${title}</td>\ + <td>${repFormat(V[income][category])}</td>\ + <td>${repFormat(V[expenses][category])}</td>\ + <td>${repFormat(V[income][category] + V[expenses][category])}</td>\ + </tr>`; + } + } else if (passage() === "Costs Budget") { + income = "lastWeeksCashIncome"; + expenses = "lastWeeksCashExpenses"; + + if (V[income][category] || V[expenses][category] || V.showAllEntries.costsBudget) { + return `<tr>\ + <td>${title}</td>\ + <td>${cashFormatColor(V[income][category])}</td>\ + <td>${cashFormatColor(-Math.abs(V[expenses][category]))}</td>\ + <td>${cashFormatColor(V[income][category] + V[expenses][category])}</td>\ + </tr>`; + } + } + return ``; +};