total outflows / inflows do not include transfer transactions between unfiltered accounts

This commit is contained in:
MaysWind
2025-10-27 22:33:44 +08:00
parent 5d1480cabc
commit f93610b5e0
+15 -3
View File
@@ -585,10 +585,22 @@ export const useStatisticsStore = defineStore('statistics', () => {
}; };
} }
totalAmount += item.amountInDefaultCurrency; let includeInTotal: boolean = true;
if (item.amountInDefaultCurrency > 0) { // total outflows / inflows do not include transfer transactions between unfiltered accounts
totalNonNegativeAmount += item.amountInDefaultCurrency; if (transactionStatisticsFilter.chartDataType === ChartDataType.OutflowsByAccount.type ||
transactionStatisticsFilter.chartDataType === ChartDataType.InflowsByAccount.type) {
if (item.relatedAccount && (!transactionStatisticsFilter.filterAccountIds || !transactionStatisticsFilter.filterAccountIds[item.relatedAccount.id])) {
includeInTotal = false;
}
}
if (includeInTotal) {
totalAmount += item.amountInDefaultCurrency;
if (item.amountInDefaultCurrency > 0) {
totalNonNegativeAmount += item.amountInDefaultCurrency;
}
} }
allDataItems[item.account.id] = data; allDataItems[item.account.id] = data;