Calculate available balance locally
This commit is contained in:
@ -31,7 +31,6 @@ export interface Category {
|
||||
AvailableLastMonth: number
|
||||
Assigned: number
|
||||
Activity: number
|
||||
Available: number
|
||||
}
|
||||
|
||||
export const useAccountStore = defineStore("budget/account", {
|
||||
@ -51,6 +50,11 @@ export const useAccountStore = defineStore("budget/account", {
|
||||
const monthMap = yearMap?.get(month);
|
||||
return [...monthMap?.values() || []];
|
||||
},
|
||||
GetCategoryAvailable(state) {
|
||||
return (category : Category) : number => {
|
||||
return category.AvailableLastMonth + Number(category.Assigned) + category.Activity;
|
||||
}
|
||||
},
|
||||
CategoryGroupsForMonth(state) {
|
||||
return (year: number, month: number) => {
|
||||
const categories = this.AllCategoriesForMonth(year, month);
|
||||
|
Reference in New Issue
Block a user