code refactor

This commit is contained in:
MaysWind
2023-06-04 13:03:31 +08:00
parent f9a14581e1
commit e31014dde4
21 changed files with 1283 additions and 1181 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
import services from '../lib/services.js';
import logger from '../lib/logger.js';
import utils from '../lib/utils.js';
import utilities from '../lib/utilities/index.js';
import { getExchangedAmount } from './exchangeRates.js';
@@ -55,13 +55,13 @@ export function loadTransactionOverview(context, { defaultCurrency, dateRange, f
const incomeAmount = getExchangedAmount(context.state)(amount.incomeAmount, amount.currency, defaultCurrency);
const expenseAmount = getExchangedAmount(context.state)(amount.expenseAmount, amount.currency, defaultCurrency);
if (utils.isNumber(incomeAmount)) {
if (utilities.isNumber(incomeAmount)) {
totalIncomeAmount += Math.floor(incomeAmount);
} else {
hasUnCalculatedTotalIncome = true;
}
if (utils.isNumber(expenseAmount)) {
if (utilities.isNumber(expenseAmount)) {
totalExpenseAmount += Math.floor(expenseAmount);
} else {
hasUnCalculatedTotalExpense = true;