Implement basic budgeting input #39

Merged
jacob1123 merged 16 commits from budgeting into master 2022-03-05 22:12:15 +01:00
Showing only changes of commit 244333adbc - Show all commits

View File

@ -61,8 +61,15 @@ export const useAccountStore = defineStore("budget/account", {
}, },
GetIncomeAvailable(state) { GetIncomeAvailable(state) {
return (year: number, month: number) => { return (year: number, month: number) => {
const IncomeCategoryID = this.GetIncomeCategoryID;
if(IncomeCategoryID == null)
return 0;
const categories = this.AllCategoriesForMonth(year, month); const categories = this.AllCategoriesForMonth(year, month);
return categories.filter(x => x.ID == this.GetIncomeCategoryID)[0].AvailableLastMonth; const category = categories.filter(x => x.ID == IncomeCategoryID)[0];
if (category == null)
return 0;
return category.AvailableLastMonth;
} }
}, },
CategoryGroupsForMonth(state) { CategoryGroupsForMonth(state) {