Skip to content
Snippets Groups Projects
Commit 1f30607d authored by lowercasedonkey's avatar lowercasedonkey
Browse files

budget

parent 524305ba
No related branches found
No related tags found
1 merge request!8544move content into AssaySlave
......@@ -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:
......
/**
* @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 ``;
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment