mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 16:07:33 +08:00
chart data source supports expense and income by primary category
This commit is contained in:
+11
-1
@@ -771,8 +771,18 @@ const stores = {
|
||||
item.category = state.allTransactionCategoriesMap[item.categoryId];
|
||||
}
|
||||
|
||||
if (item.category && item.category.parentId !== '0') {
|
||||
item.primaryCategory = state.allTransactionCategoriesMap[item.category.parentId];
|
||||
} else {
|
||||
item.primaryCategory = item.category;
|
||||
}
|
||||
|
||||
if (item.account && item.account.currency !== defaultCurrency) {
|
||||
item.amountInDefaultCurrency = getExchangedAmount(state)(item.amount, item.account.currency, defaultCurrency);
|
||||
const amount = getExchangedAmount(state)(item.amount, item.account.currency, defaultCurrency);
|
||||
|
||||
if (utils.isNumber(amount)) {
|
||||
item.amountInDefaultCurrency = Math.floor(amount);
|
||||
}
|
||||
} else if (item.account && item.account.currency === defaultCurrency) {
|
||||
item.amountInDefaultCurrency = item.amount;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user