Skip to content

Open source personal finance application

refactor: incomes -> income, expenses -> expense

ilkomee164bd0641db
diff --git a/assets/stylus/base/notifications.styl b/assets/stylus/base/notifications.styl
index 8542ddaa..b4433aed 100644
--- a/assets/stylus/base/notifications.styl
+++ b/assets/stylus/base/notifications.styl
@@ -34,11 +34,11 @@
&.success
color var(--c-font-2)
- background var(--c-incomes-1)
+ background var(--c-income-1)
&.error
color var(--c-font-2)
- background var(--c-expenses-1)
+ background var(--c-expense-1)
.notification-title
display block
diff --git a/assets/stylus/colors-dark.styl b/assets/stylus/colors-dark.styl
index 21693725..29181b92 100644
--- a/assets/stylus/colors-dark.styl
+++ b/assets/stylus/colors-dark.styl
@@ -32,8 +32,8 @@ html.dark
--c-red-1 #b81414
--c-blue-1 #3a7dff
--c-blue-3 #2c74ff
- --c-incomes-1 #2cad22
- --c-expenses-1 #f92134
+ --c-income-1 #2cad22
+ --c-expense-1 #f92134
--c-bg-1 #0a0a0afc
--c-bg-2 #111111
diff --git a/assets/stylus/colors-light.styl b/assets/stylus/colors-light.styl
index 9b374af4..60254122 100644
--- a/assets/stylus/colors-light.styl
+++ b/assets/stylus/colors-light.styl
@@ -32,8 +32,8 @@ html
--c-red-1 #b81414
--c-blue-1 #3a7dff
--c-blue-3 #2c74ff
- --c-incomes-1 rgba(44, 173, 34, 1)
- --c-expenses-1 rgba(249, 33, 52, 1)
+ --c-income-1 rgba(44, 173, 34, 1)
+ --c-expense-1 rgba(249, 33, 52, 1)
// backgrounds
// --------------------------------------------
diff --git a/assets/stylus/index.styl b/assets/stylus/index.styl
index 0a3fccda..7563ff69 100644
--- a/assets/stylus/index.styl
+++ b/assets/stylus/index.styl
@@ -6,5 +6,5 @@
@import '../../components/**/*'
html
- --c-incomes-opacity rgba(44, 173, 34, .5)
- --c-expenses-opacity rgba(249, 33, 52, .5)
+ --c-income-opacity rgba(44, 173, 34, .5)
+ --c-expense-opacity rgba(249, 33, 52, .5)
diff --git a/components/modal/ModalBottomConfirm.vue b/components/modal/ModalBottomConfirm.vue
index 3a7c078a..82484039 100644
--- a/components/modal/ModalBottomConfirm.vue
+++ b/components/modal/ModalBottomConfirm.vue
@@ -44,6 +44,6 @@ Portal(
.descError
padding-bottom $m8
- color var(--c-expenses-1)
+ color var(--c-expense-1)
text-align center
</style>
diff --git a/components/stat/Chart.vue b/components/stat/Chart.vue
index 2e08707a..3cee13e3 100644
--- a/components/stat/Chart.vue
+++ b/components/stat/Chart.vue
@@ -20,11 +20,11 @@ const chartType = computed(() => {
</script>
<template lang="pug">
-.h-48(v-if="chartState.show.expenses || chartState.show.incomes")
+.h-48(v-if="chartState.show.expense || chartState.show.income")
LazyStatChartLines(
:categoryId="filter.categoryId"
:chartType="chartType"
- :isShowExpenses="chartState.show.expenses"
- :isShowIncomes="chartState.show.incomes"
+ :isShowExpense="chartState.show.expense"
+ :isShowIncome="chartState.show.income"
)
</template>
diff --git a/components/stat/ChartConfig.vue b/components/stat/ChartConfig.vue
index 8b56e2c0..b1a96132 100644
--- a/components/stat/ChartConfig.vue
+++ b/components/stat/ChartConfig.vue
@@ -22,13 +22,13 @@ const { isShowDataLabels, toggleChartsView } = useChart()
<template lang="pug">
.flex-center(v-if="!isEmptyStat")
.cursor-pointer.w-10.py-2.px-3.flex-center.rounded-md.hocus_bg-skin-item-main-hover(
- :class="{ 'text-skin-item-base-up': chartState.show.incomes }"
- @click="toggleChart('incomes')"
+ :class="{ 'text-skin-item-base-up': chartState.show.income }"
+ @click="toggleChart('income')"
): .mdi.mdi-arrow-down-thin-circle-outline
.cursor-pointer.w-10.py-2.px-3.flex-center.rounded-md.hocus_bg-skin-item-main-hover(
- :class="{ 'text-skin-item-base-up': chartState.show.expenses }"
- @click="toggleChart('expenses')"
+ :class="{ 'text-skin-item-base-up': chartState.show.expense }"
+ @click="toggleChart('expense')"
): .mdi.mdi-arrow-up-thin-circle-outline
.cursor-pointer.w-10.py-2.px-3.flex-center.rounded-md.hocus_bg-skin-item-main-hover(
diff --git a/components/stat/ChartLines.vue b/components/stat/ChartLines.vue
index 5f216c6c..ad60c197 100644
--- a/components/stat/ChartLines.vue
+++ b/components/stat/ChartLines.vue
@@ -13,8 +13,8 @@ export default defineComponent({
props: {
amountType: { type: String, default: null },
categoryId: { type: String, default: null },
- isShowExpenses: { type: Boolean, default: true },
- isShowIncomes: { type: Boolean, default: true },
+ isShowExpense: { type: Boolean, default: true },
+ isShowIncome: { type: Boolean, default: true },
},
setup() {
@@ -99,8 +99,8 @@ export default defineComponent({
periodsToShow = periodsWantToShow >= periodsToShow ? periodsToShow : periodsWantToShow
const categories = []
- const incomesData = []
- const expensesData = []
+ const incomeData = []
+ const expenseData = []
const totalData = []
for (let index = 0; index < periodsToShow; index++) {
@@ -135,13 +135,13 @@ export default defineComponent({
format = 'YYYY'
const name = this.$day().startOf(periodName).subtract(index, periodName).format(format)
- // Incomes
- incomesData.unshift({
+ // Income
+ incomeData.unshift({
date: periodDate,
y: incomeTransactions,
})
- // Expenses
- expensesData.unshift({
+ // Expense
+ expenseData.unshift({
date: periodDate,
y: expenseTransactions,
})
@@ -156,46 +156,46 @@ export default defineComponent({
}
let periods = 0
- let periodsTotalIncomes = 0
- for (const iterator of incomesData) {
+ let periodsTotalIncome = 0
+ for (const iterator of incomeData) {
if (iterator.y !== 0) {
periods = periods + 1
- periodsTotalIncomes = periodsTotalIncomes + iterator.y
+ periodsTotalIncome = periodsTotalIncome + iterator.y
}
}
- let periodsExpenses = 0
- let periodsTotalExpenses = 0
- for (const iterator of expensesData) {
+ let periodsExpense = 0
+ let periodsTotalExpense = 0
+ for (const iterator of expenseData) {
if (iterator.y !== 0) {
- periodsExpenses = periodsExpenses + 1
- periodsTotalExpenses = periodsTotalExpenses + iterator.y
+ periodsExpense = periodsExpense + 1
+ periodsTotalExpense = periodsTotalExpense + iterator.y
}
}
- const fakeLineDate = expensesData.map(i => ({ date: i.date, y: periodsTotalIncomes / periods || periodsTotalExpenses / periodsExpenses }))
+ const fakeLineDate = expenseData.map(i => ({ date: i.date, y: periodsTotalIncome / periods || periodsTotalExpense / periodsExpense }))
const data = {
series: [{
// Income
zIndex: 3,
- visible: periodsTotalIncomes > 0 && this.isShowIncomes,
+ visible: periodsTotalIncome > 0 && this.isShowIncome,
type: this.chartType,
- name: this.$t('money.incomes'),
- color: 'var(--c-incomes-1)',
- data: incomesData,
+ name: this.$t('money.income'),
+ color: 'var(--c-income-1)',
+ data: incomeData,
marker: {
- lineColor: 'var(--c-incomes-1)',
+ lineColor: 'var(--c-income-1)',
},
}, {
// Expense
zIndex: 2,
- visible: periodsTotalExpenses > 0 && this.isShowExpenses,
+ visible: periodsTotalExpense > 0 && this.isShowExpense,
type: this.chartType,
- name: this.$t('money.expenses'),
- color: 'var(--c-expenses-1)',
- data: expensesData,
+ name: this.$t('money.expense'),
+ color: 'var(--c-expense-1)',
+ data: expenseData,
marker: {
- lineColor: 'var(--c-expenses-1)',
+ lineColor: 'var(--c-expense-1)',
},
}, {
// Fake data to make good hover on bar chart
@@ -223,30 +223,30 @@ export default defineComponent({
},
}],
categories,
- averageIncomes: periodsTotalIncomes / periods,
- averageExpenses: periodsTotalExpenses / periodsExpenses,
+ averageIncome: periodsTotalIncome / periods,
+ averageExpense: periodsTotalExpense / periodsExpense,
}
const tooltip = this.$store.state.ui.pc ? { ...chartOptions.tooltip } : { enabled: false }
const plotLines = []
// Expense
- if (periodsTotalExpenses > 0 && this.isShowExpenses) {
+ if (periodsTotalExpense > 0 && this.isShowExpense) {
plotLines.push({
opacity: 0.5,
- color: 'var(--c-expenses-opacity)',
- value: data.averageExpenses,
+ color: 'var(--c-expense-opacity)',
+ value: data.averageExpense,
width: '2',
zIndex: 1,
})
}
// Income
- if (periodsTotalIncomes > 0 && this.isShowIncomes) {
+ if (periodsTotalIncome > 0 && this.isShowIncome) {
plotLines.push({
opacity: 0.5,
- color: 'var(--c-incomes-opacity)',
- value: data.averageIncomes,
+ color: 'var(--c-income-opacity)',
+ value: data.averageIncome,
width: '2',
zIndex: 1,
})
diff --git a/components/stat/Laptop.vue b/components/stat/Laptop.vue
index baba285b..380618f5 100644
--- a/components/stat/Laptop.vue
+++ b/components/stat/Laptop.vue
@@ -17,8 +17,8 @@ onWatch()
const isShowGroup = (type) => {
const p1 = statPage.activeTab === 'details'
|| statPage.activeTab === 'balance'
- || (statPage.activeTab === 'incomes' && type === 'incomes')
- || (statPage.activeTab === 'expenses' && type === 'expenses')
+ || (statPage.activeTab === 'income' && type === 'income')
+ || (statPage.activeTab === 'expense' && type === 'expense')
const p2 = statPage.current[type].total > 0
|| (statPage.average && statPage.average[type] !== 0)
|| $store.state.filter.period === 'all'
@@ -33,7 +33,7 @@ const isShowTrns = computed(() => {
})
const isShowGroupTrns = computed(() => {
- const p1 = statPage.activeTab === 'incomes' || statPage.activeTab === 'expenses'
+ const p1 = statPage.activeTab === 'income' || statPage.activeTab === 'expense'
const p2 = statPage.average.sum === 0
return (p1 || p2) && statPage.activeTab !== 'history'
})
@@ -82,7 +82,7 @@ onDeactivated(async () => {
StatMenuLaptop
template(v-if="statPage.activeTab !== 'trns' && statPage.activeTab !== 'history'")
- //- Loop throw incomes / expenses
+ //- Loop throw income / expense
.mb-8.md_mb-4.px-2
.grid.grid-cols-1.gap-y-5(class="md_grid-cols-2 md_gap-x-20")
div(
@@ -107,8 +107,8 @@ onDeactivated(async () => {
LazyStatGroupTrns(
v-if="isShowGroupTrns && !isEmptyStat"
- :isShowExpenses="statPage.activeTab === 'expenses'"
- :isShowIncomes="statPage.activeTab === 'incomes'"
+ :isShowExpense="statPage.activeTab === 'expense'"
+ :isShowIncome="statPage.activeTab === 'income'"
)
.px-2
diff --git a/components/stat/MenuLaptop.vue b/components/stat/MenuLaptop.vue
index 98bb338d..db399998 100644
--- a/components/stat/MenuLaptop.vue
+++ b/components/stat/MenuLaptop.vue
@@ -15,14 +15,14 @@ UiTabs
) {{ $t('stat.periods') }}
UiTabsItem(
- :isActive="activeTabStat === 'expenses'"
- @click="onClickStatMenu('expenses')"
- ) {{ $t('money.expenses') }}
+ :isActive="activeTabStat === 'expense'"
+ @click="onClickStatMenu('expense')"
+ ) {{ $t('money.expense') }}
UiTabsItem(
- :isActive="activeTabStat === 'incomes'"
- @click="onClickStatMenu('incomes')"
- ) {{ $t('money.incomes') }}
+ :isActive="activeTabStat === 'income'"
+ @click="onClickStatMenu('income')"
+ ) {{ $t('money.income') }}
UiTabsItem(
:isActive="activeTabStat === 'trns'"
diff --git a/components/stat/MenuMobile.vue b/components/stat/MenuMobile.vue
index 8552854f..69f3eb45 100644
--- a/components/stat/MenuMobile.vue
+++ b/components/stat/MenuMobile.vue
@@ -15,10 +15,10 @@ const menu = computed(() => [{
name: i18n.t('stat.periods'),
}, {
idx: 1,
- name: i18n.t('money.expenses'),
+ name: i18n.t('money.expense'),
}, {
idx: 2,
- name: i18n.t('money.incomes'),
+ name: i18n.t('money.income'),
}, {
idx: 3,
name: i18n.t('trns.shortTitle'),
diff --git a/components/stat/Mobile.vue b/components/stat/Mobile.vue
index 8aec9fc4..fc152465 100644
--- a/components/stat/Mobile.vue
+++ b/components/stat/Mobile.vue
@@ -72,8 +72,8 @@ onDeactivated(async () => {
StatMobileSlide
.my-4.px-2
StatSumTotal
- StatSumGroup(typeText="incomes")
- StatSumGroup(typeText="expenses")
+ StatSumGroup(typeText="income")
+ StatSumGroup(typeText="expense")
.my-6.mx-2.rounded-lg.bg-skin-item-main-bg.border.dark_border-neutral-800
LazyStatChart(
@@ -87,14 +87,14 @@ onDeactivated(async () => {
//- Expense
StatMobileSlide
.px-2
- StatGroupItem(typeText="expenses")
- LazyStatGroupTrns(isShowExpenses)
+ StatGroupItem(typeText="expense")
+ LazyStatGroupTrns(isShowExpense)
//- Income
StatMobileSlide
.px-2
- StatGroupItem(typeText="incomes")
- LazyStatGroupTrns(isShowIncomes)
+ StatGroupItem(typeText="income")
+ LazyStatGroupTrns(isShowIncome)
//- Transactions
StatMobileSlide
diff --git a/components/stat/StatItem.vue b/components/stat/StatItem.vue
index f00f4c68..1a9609a3 100644
--- a/components/stat/StatItem.vue
+++ b/components/stat/StatItem.vue
@@ -114,8 +114,8 @@ export default {
template(v-else)
.statItem__trns
TrnsList(
- :incomes="type === 1"
- :expenses="type === 0"
+ :income="type === 1"
+ :expense="type === 0"
:categoryId="categoryId"
ui="stat"
)
diff --git a/components/stat/StatItemChildCats.vue b/components/stat/StatItemChildCats.vue
index 5b09bb1c..0c643e82 100644
--- a/components/stat/StatItemChildCats.vue
+++ b/components/stat/StatItemChildCats.vue
@@ -38,7 +38,7 @@ export default {
},
typeName() {
- return this.type === 1 ? 'incomes' : 'expenses'
+ return this.type === 1 ? 'income' : 'expense'
},
},
diff --git a/components/stat/StatItemChildCatsItem.vue b/components/stat/StatItemChildCatsItem.vue
index 4df51844..63b8ce1d 100644
--- a/components/stat/StatItemChildCatsItem.vue
+++ b/components/stat/StatItemChildCatsItem.vue
@@ -71,8 +71,8 @@ export default {
@click.stop=""
)
TrnsList(
- :incomes="type === 1"
- :expenses="type === 0"
+ :income="type === 1"
+ :expense="type === 0"
:categoryId="categoryId"
ui="stat"
)
diff --git a/components/stat/SummaryRowItemView.vue b/components/stat/SummaryRowItemView.vue
index 74e6f18c..e355fd51 100644
--- a/components/stat/SummaryRowItemView.vue
+++ b/components/stat/SummaryRowItemView.vue
@@ -9,8 +9,8 @@ export default {
computed: {
className() {
return {
- _expenses: this.type === 0,
- _incomes: this.type === 1,
+ _expense: this.type === 0,
+ _income: this.type === 1,
}
},
},
@@ -40,11 +40,11 @@ export default {
display flex
flex-flow column
- &._expenses
- color var(--c-expenses-1)
+ &._expense
+ color var(--c-expense-1)
- &._incomes
- color var(--c-incomes-1)
+ &._income
+ color var(--c-income-1)
&__title
color var(--c-font-4)
diff --git a/components/stat/cats/PeriodCatsChart.vue b/components/stat/cats/PeriodCatsChart.vue
index 7e1017af..c2115f3a 100644
--- a/components/stat/cats/PeriodCatsChart.vue
+++ b/components/stat/cats/PeriodCatsChart.vue
@@ -5,7 +5,7 @@ export default {
type: String,
required: true,
validator(value) {
- return value === 'incomes' || value === 'expenses'
+ return value === 'income' || value === 'expense'
},
},
},
diff --git a/components/stat/chartOptions.js b/components/stat/chartOptions.js
index 0e32d413..11becfd5 100644
--- a/components/stat/chartOptions.js
+++ b/components/stat/chartOptions.js
@@ -75,7 +75,7 @@ export default {
radius: 3,
fillColor: 'var(--c-bg-4)',
lineWidth: 2,
- lineColor: 'var(--c-incomes-1)',
+ lineColor: 'var(--c-income-1)',
symbol: 'circle',
},
diff --git a/components/stat/group/Round.vue b/components/stat/group/Round.vue
index fd65f460..27e2876e 100644
--- a/components/stat/group/Round.vue
+++ b/components/stat/group/Round.vue
@@ -13,8 +13,8 @@ export default defineComponent({
const { statPage } = useStatPage()
const { moneyTypes } = useStat()
const { ui } = useUIView()
- const incomesRef = ref(null)
- const expensesRef = ref(null)
+ const incomeRef = ref(null)
+ const expenseRef = ref(null)
const isShow = computed(() => ui.showRoundCats && statPage.current[typeText.value]?.categoriesIds?.length)
const typeNumber = moneyTypes.find(t => t.id === typeText.value)?.type
@@ -22,15 +22,15 @@ export default defineComponent({
/**
* Watch for changes in categories
* Get max width from child elements name or amount
- * Set different width for incomes and expenses
+ * Set different width for income and expense
*/
function updateWidth() {
setTimeout(() => {
let minWidth = 60
let childs
- typeText.value === 'incomes'
- ? childs = incomesRef.value?.querySelectorAll('.js-getWidth')
- : childs = expensesRef.value?.querySelectorAll('.js-getWidth')
+ typeText.value === 'income'
+ ? childs = incomeRef.value?.querySelectorAll('.js-getWidth')
+ : childs = expenseRef.value?.querySelectorAll('.js-getWidth')
if (!childs)
return
@@ -39,9 +39,9 @@ export default defineComponent({
if (childs[key].clientWidth > minWidth)
minWidth = childs[key].clientWidth
}
- typeText.value === 'incomes'
- ? incomesRef.value.style.setProperty('--minWidth', `${minWidth + 12}px`)
- : expensesRef.value.style.setProperty('--minWidth', `${minWidth + 12}px`)
+ typeText.value === 'income'
+ ? incomeRef.value.style.setProperty('--minWidth', `${minWidth + 12}px`)
+ : expenseRef.value.style.setProperty('--minWidth', `${minWidth + 12}px`)
}, 100)
}
watch(statPage.current[typeText.value]?.categoriesIds, updateWidth, { immediate: true })
@@ -51,8 +51,8 @@ export default defineComponent({
statPage,
isShow,
typeNumber,
- incomesRef,
- expensesRef,
+ incomeRef,
+ expenseRef,
}
},
})
diff --git a/components/stat/group/Trns.vue b/components/stat/group/Trns.vue
index 01c6a84c..2894bd86 100644
--- a/components/stat/group/Trns.vue
+++ b/components/stat/group/Trns.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
defineProps<{
- isShowIncomes: Boolean
- isShowExpenses: Boolean
+ isShowIncome: Boolean
+ isShowExpense: Boolean
}>()
</script>
@@ -10,8 +10,8 @@ defineProps<{
.pb-2.text-lg.leading-none.font-nunito.font-semibold.text-skin-item-base {{ $t('trns.inPeriodTitle') }}
TrnsList(
- :expenses="isShowExpenses"
- :incomes="isShowIncomes"
+ :expense="isShowExpense"
+ :income="isShowIncome"
:size="12"
classNames="md_grid-cols-1"
)
diff --git a/components/stat/sum/Group.vue b/components/stat/sum/Group.vue
index 7cf9cbc4..8d92fda1 100644
--- a/components/stat/sum/Group.vue
+++ b/components/stat/sum/Group.vue
@@ -3,7 +3,7 @@ import useStatPage from '~/components/stat/useStatPage'
import useStat from '~/modules/stat/useStat'
const props = defineProps<{
- typeText: 'incomes' | 'expenses'
+ typeText: 'income' | 'expense'
}>()
const { statPage } = useStatPage()
@@ -30,7 +30,7 @@ const typeNumber = computed(() => moneyTypes.find(t => t.id === `${props.typeTex
//- TODO: change everything to expense and income
LazyStatSummaryRowItemView(
v-if="statPage.average[typeText] !== 0"
- :amount="statPage.average[typeText === 'expenses' ? 'expense' : 'income']"
+ :amount="statPage.average[typeText === 'expense' ? 'expense' : 'income']"
:title="$t(`money.average.${typeText}`)"
:type="typeNumber"
)
diff --git a/components/stat/sum/Total.vue b/components/stat/sum/Total.vue
index 4b41d2a6..5042a268 100644
--- a/components/stat/sum/Total.vue
+++ b/components/stat/sum/Total.vue
@@ -12,12 +12,12 @@ const statAverage = computed(() => $store.getters['stat/statAverage'])
//- Total
.pr-6.text-4xl
Amount(
- :amount="statCurrentPeriod.incomes.total - statCurrentPeriod.expenses.total"
- :colorize="(statCurrentPeriod.incomes.total - statCurrentPeriod.expenses.total) > 0 ? 'income' : 'expense'"
+ :amount="statCurrentPeriod.income.total - statCurrentPeriod.expense.total"
+ :colorize="(statCurrentPeriod.income.total - statCurrentPeriod.expense.total) > 0 ? 'income' : 'expense'"
:currency="$store.state.currencies.base"
:isShowBaseRate="false"
:isShowSign="false"
- :type="(statCurrentPeriod.incomes.total - statCurrentPeriod.expenses.total) > 0 ? 1 : 0"
+ :type="(statCurrentPeriod.income.total - statCurrentPeriod.expense.total) > 0 ? 1 : 0"
)
LazyStatSummaryRowItemView(
diff --git a/components/stat/useStatChart.ts b/components/stat/useStatChart.ts
index bf6e46cd..6a008398 100644
--- a/components/stat/useStatChart.ts
+++ b/components/stat/useStatChart.ts
@@ -1,9 +1,9 @@
-type MoneyType = 'incomes' | 'expenses'
+type MoneyType = 'income' | 'expense'
const state = reactive({
show: {
- incomes: true,
- expenses: true,
+ income: true,
+ expense: true,
},
})
@@ -22,17 +22,17 @@ export default function useStatChart() {
function onWatch() {
watch(activeTabStat, () => {
switch (activeTabStat.value) {
- case 'incomes':
- setChart('incomes', true)
- setChart('expenses', false)
+ case 'income':
+ setChart('income', true)
+ setChart('expense', false)
break
- case 'expenses':
- setChart('incomes', false)
- setChart('expenses', true)
+ case 'expense':
+ setChart('income', false)
+ setChart('expense', true)
break
case 'details':
- setChart('incomes', true)
- setChart('expenses', true)
+ setChart('income', true)
+ setChart('expense', true)
break
}
})
diff --git a/components/trnForm/Amount.vue b/components/trnForm/Amount.vue
index 7f2d6a0c..e8e8904b 100644
--- a/components/trnForm/Amount.vue
+++ b/components/trnForm/Amount.vue
@@ -13,8 +13,8 @@ export default {
getResult,
expression,
className: computed(() => ({
- _expenses: amountType.value === 0,
- _incomes: amountType.value === 1,
+ _expense: amountType.value === 0,
+ _income: amountType.value === 1,
})),
}
},
@@ -54,10 +54,10 @@ export default {
<style lang="stylus" scoped>
.trnFormAmount
&__wrap
- ^[0]._expenses &
- color var(--c-expenses-1)
- ^[0]._incomes &
- color var(--c-incomes-1)
+ ^[0]._expense &
+ color var(--c-expense-1)
+ ^[0]._income &
+ color var(--c-income-1)
&__value
typo-money()
@@ -69,11 +69,11 @@ export default {
background none
border none
- ^[0]._expenses &
- color var(--c-expenses-1)
+ ^[0]._expense &
+ color var(--c-expense-1)
- ^[0]._incomes &
- color var(--c-incomes-1)
+ ^[0]._income &
+ color var(--c-income-1)
&__evaluation
opacity .8
diff --git a/components/trnForm/Types.vue b/components/trnForm/Types.vue
index 504277f5..8739cd19 100644
--- a/components/trnForm/Types.vue
+++ b/components/trnForm/Types.vue
@@ -25,12 +25,12 @@ export default {
.cursor-pointer.px-5.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
:class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': amountType === 0 }"
@click="() => setAmountType(0)"
- ) {{ $t('money.expenses') }}
+ ) {{ $t('money.expense') }}
.cursor-pointer.px-5.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
:class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': amountType === 1 }"
@click="() => setAmountType(1)"
- ) {{ $t('money.incomes') }}
+ ) {{ $t('money.income') }}
.cursor-pointer.px-5.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
v-if="$store.getters['wallets/walletsSortedIds'].length > 1"
diff --git a/components/trns/History.vue b/components/trns/History.vue
index eb334e2c..271fcf2d 100644
--- a/components/trns/History.vue
+++ b/components/trns/History.vue
@@ -35,12 +35,12 @@ div
.cursor-pointer.px-5.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
:class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': props.trnType === 0 }"
@click="setTrnType(0)"
- ) {{ $t('money.expenses') }}
+ ) {{ $t('money.expense') }}
.cursor-pointer.px-5.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
:class="{ '_active cursor-default text-blue3 dark_text-blue1 bg-gray-100 dark_bg-232323': props.trnType === 1 }"
@click="setTrnType(1)"
- ) {{ $t('money.incomes') }}
+ ) {{ $t('money.income') }}
.cursor-pointer.px-5.py-3.grow.hocus_bg-gray-200.dark_hocus_bg-neutral-800(
v-if="!hideTransfers"
diff --git a/components/trns/item/History.vue b/components/trns/item/History.vue
index d4c60464..2d6e80e5 100644
--- a/components/trns/item/History.vue
+++ b/components/trns/item/History.vue
@@ -93,7 +93,7 @@ const actions = {
:currency="trnItem.expenseWallet.currency"
:type="0"
verti
- colorize="expenses"
+ colorize="expense"
)
//- Income
@@ -109,7 +109,7 @@ const actions = {
:amount="trnItem.incomeAmount || trnItem.amount"
:currency="trnItem.incomeWallet.currency"
:type="1"
- colorize="incomes"
+ colorize="income"
)
//- Amount
@@ -121,7 +121,7 @@ const actions = {
:amount="trnItem.amount"
:currency="trnItem.wallet.currency"
:type="trnItem.type"
- colorize="incomes"
+ colorize="income"
)
//- Description
diff --git a/components/trns/item/WithoutCat.vue b/components/trns/item/WithoutCat.vue
index a995b0fa..1ba422c2 100644
--- a/components/trns/item/WithoutCat.vue
+++ b/components/trns/item/WithoutCat.vue
@@ -58,7 +58,7 @@ export default defineComponent({
:amount="trnItem.amount"
:currency="trnItem.wallet.currency"
:type="trnItem.type"
- colorize="incomes"
+ colorize="income"
@click="onOpenEdit"
)
diff --git a/components/trns/list/TrnsList.vue b/components/trns/list/TrnsList.vue
index b8f846bf..b89321d3 100644
--- a/components/trns/list/TrnsList.vue
+++ b/components/trns/list/TrnsList.vue
@@ -5,8 +5,8 @@ import useFilter from '~/modules/filter/useFilter'
export default defineComponent({
props: {
categoryId: { type: String, default: null },
- expenses: { type: Boolean, default: false },
- incomes: { type: Boolean, default: false },
+ expense: { type: Boolean, default: false },
+ income: { type: Boolean, default: false },
isShowFilter: { type: Boolean, default: false },
limit: { type: Number, default: 0 },
size: { type: Number, required: false, default: 30 },
@@ -65,9 +65,9 @@ export default defineComponent({
trnsIds = trnsIds.filter(trnId => trns[trnId].categoryId === this.categoryId)
// filter type
- if (this.incomes)
+ if (this.income)
trnsIds = trnsIds.filter(id => trns[id].type === 1)
- if (this.expenses)
+ if (this.expense)
trnsIds = trnsIds.filter(id => trns[id].type === 0)
return trnsIds
diff --git a/locales/en-US.js b/locales/en-US.js
index f5ea256e..9870040b 100644
--- a/locales/en-US.js
+++ b/locales/en-US.js
@@ -259,8 +259,8 @@ export default {
},
money: {
- incomes: 'Income',
- expenses: 'Expense',
+ income: 'Income',
+ expense: 'Expense',
total: 'Net income',
income: 'Income',
@@ -270,8 +270,8 @@ export default {
transfer: 'Transfer',
average: {
base: 'Average',
- incomes: 'Average',
- expenses: 'Average',
+ income: 'Average',
+ expense: 'Average',
},
averageTotal: 'Average',
also: 'Also',
diff --git a/locales/ru-RU.js b/locales/ru-RU.js
index 5be019f4..990d8387 100644
--- a/locales/ru-RU.js
+++ b/locales/ru-RU.js
@@ -260,8 +260,8 @@ export default {
},
money: {
- incomes: 'Доход',
- expenses: 'Расход',
+ income: 'Доход',
+ expense: 'Расход',
total: 'Баланс',
income: 'Доход',
@@ -271,8 +271,8 @@ export default {
transfer: 'Перевод',
average: {
base: 'Обычно',
- incomes: 'Обычно',
- expenses: 'Обычно',
+ income: 'Обычно',
+ expense: 'Обычно',
},
averageTotal: 'Обычно',
also: 'Еще',
diff --git a/modules/stat/useStat.ts b/modules/stat/useStat.ts
index 3993cc5b..d6c1b9d0 100644
--- a/modules/stat/useStat.ts
+++ b/modules/stat/useStat.ts
@@ -1,8 +1,8 @@
const moneyTypes = [{
- id: 'expenses',
+ id: 'expense',
type: 0,
}, {
- id: 'incomes',
+ id: 'income',
type: 1,
}]
@@ -13,10 +13,10 @@ export default function useStat() {
const statCurrentPeriod = $store.getters['stat/statCurrentPeriod']
if ($store.state.ui.activeTabStat === 'details')
return statCurrentPeriod.total === 0
- else if ($store.state.ui.activeTabStat === 'incomes')
- return statCurrentPeriod.incomes.total === 0
- else if ($store.state.ui.activeTabStat === 'expenses')
- return statCurrentPeriod.expenses.total === 0
+ else if ($store.state.ui.activeTabStat === 'income')
+ return statCurrentPeriod.income.total === 0
+ else if ($store.state.ui.activeTabStat === 'expense')
+ return statCurrentPeriod.expense.total === 0
})
return {
diff --git a/store/stat/getters.ts b/store/stat/getters.ts
index 359704f2..67e13c4e 100644
--- a/store/stat/getters.ts
+++ b/store/stat/getters.ts
@@ -172,20 +172,20 @@ export default {
// totalInCategory
categoriesTotal[categoryId] = {
- incomes: totalInCategory.incomeTransactions,
- expenses: totalInCategory.expenseTransactions,
+ income: totalInCategory.incomeTransactions,
+ expense: totalInCategory.expenseTransactions,
}
}
- // separate categories by incomes and expenses
- const statIncomes = {}
- const statExpenses = {}
+ // separate categories by income and expense
+ const statIncome = {}
+ const statExpense = {}
for (const categoryId in categoriesWithTrnsIds) {
const total = categoriesTotal[categoryId]
- if (total.incomes > 0)
- statIncomes[categoryId] = total
- if (total.expenses > 0)
- statExpenses[categoryId] = total
+ if (total.income > 0)
+ statIncome[categoryId] = total
+ if (total.expense > 0)
+ statExpense[categoryId] = total
}
// sort categories amount
@@ -207,8 +207,8 @@ export default {
}
// sorted
- const incomesCategoriesIds = sortCategoriesByTotal(statIncomes, 'incomes')
- const expensesCategoriesIds = sortCategoriesByTotal(statExpenses, 'expenses')
+ const incomeCategoriesIds = sortCategoriesByTotal(statIncome, 'income')
+ const expenseCategoriesIds = sortCategoriesByTotal(statExpense, 'expense')
// get first item in sorted categories
function getBiggestAmount(categoriesTotal, categoriesIds, typeName) {
@@ -217,20 +217,20 @@ export default {
}
// biggest
- const expensesBiggest = getBiggestAmount(categoriesTotal, expensesCategoriesIds, 'expenses')
- const incomesBiggest = getBiggestAmount(categoriesTotal, incomesCategoriesIds, 'incomes')
+ const expenseBiggest = getBiggestAmount(categoriesTotal, expenseCategoriesIds, 'expense')
+ const incomeBiggest = getBiggestAmount(categoriesTotal, incomeCategoriesIds, 'income')
const stat = {
categories: categoriesTotal,
total: total.sumTransactions,
- expenses: {
- biggest: expensesBiggest,
- categoriesIds: expensesCategoriesIds,
+ expense: {
+ biggest: expenseBiggest,
+ categoriesIds: expenseCategoriesIds,
total: total.expenseTransactions,
},
- incomes: {
- biggest: incomesBiggest,
- categoriesIds: incomesCategoriesIds,
+ income: {
+ biggest: incomeBiggest,
+ categoriesIds: incomeCategoriesIds,
total: total.incomeTransactions,
},
}