diff --git a/pkg/api/data_managements.go b/pkg/api/data_managements.go index e1c8e91c..0d3c5492 100644 --- a/pkg/api/data_managements.go +++ b/pkg/api/data_managements.go @@ -86,7 +86,7 @@ func (a *DataManagementsApi) DataStatisticsHandler(c *core.Context) (any, *errs. return nil, errs.ErrOperationFailed } - totalTransactionTemplateCount, err := a.templates.GetTotalTemplateCountByUid(c, uid) + totalTransactionTemplateCount, err := a.templates.GetTotalNormalTemplateCountByUid(c, uid) if err != nil { log.ErrorfWithRequestId(c, "[data_managements.DataStatisticsHandler] failed to get total transaction template count for user \"uid:%d\", because %s", uid, err.Error()) diff --git a/pkg/services/transaction_templates.go b/pkg/services/transaction_templates.go index 9b2e8da8..e99c9561 100644 --- a/pkg/services/transaction_templates.go +++ b/pkg/services/transaction_templates.go @@ -29,13 +29,13 @@ var ( } ) -// GetTotalTemplateCountByUid returns total template count of user -func (s *TransactionTemplateService) GetTotalTemplateCountByUid(c *core.Context, uid int64) (int64, error) { +// GetTotalNormalTemplateCountByUid returns total template count of user +func (s *TransactionTemplateService) GetTotalNormalTemplateCountByUid(c *core.Context, uid int64) (int64, error) { if uid <= 0 { return 0, errs.ErrUserIdInvalid } - count, err := s.UserDataDB(uid).NewSession(c).Where("uid=? AND deleted=?", uid, false).Count(&models.TransactionTemplate{}) + count, err := s.UserDataDB(uid).NewSession(c).Where("uid=? AND deleted=? AND template_type=?", uid, false, models.TRANSACTION_TEMPLATE_TYPE_NORMAL).Count(&models.TransactionTemplate{}) return count, err } diff --git a/src/views/desktop/user/settings/tabs/UserDataManagementSettingTab.vue b/src/views/desktop/user/settings/tabs/UserDataManagementSettingTab.vue index 24535c5f..827ffd69 100644 --- a/src/views/desktop/user/settings/tabs/UserDataManagementSettingTab.vue +++ b/src/views/desktop/user/settings/tabs/UserDataManagementSettingTab.vue @@ -18,63 +18,49 @@ - +
- - + +
- {{ $t('Transaction') }} + {{ $t(item.title) }} - {{ displayDataStatistics ? displayDataStatistics.totalTransactionCount : '-' }} -
-
-
- -
-
- - - -
- -
- {{ $t('Accounts') }} - - {{ displayDataStatistics ? displayDataStatistics.totalAccountCount : '-' }} -
-
-
- -
-
- - - -
- -
- {{ $t('Transaction Categories') }} - - {{ displayDataStatistics ? displayDataStatistics.totalTransactionCategoryCount : '-' }} -
-
-
- -
-
- - - -
- -
- {{ $t('Transaction Tags') }} - - {{ displayDataStatistics ? displayDataStatistics.totalTransactionTagCount : '-' }} + {{ item.count }}
@@ -174,6 +160,7 @@ import { mdiCreditCardOutline, mdiViewDashboardOutline, mdiTagOutline, + mdiClipboardTextOutline, mdiAlert } from '@mdi/js'; @@ -191,6 +178,7 @@ export default { accounts: mdiCreditCardOutline, categories: mdiViewDashboardOutline, tags: mdiTagOutline, + templates: mdiClipboardTextOutline, alert: mdiAlert } } @@ -205,10 +193,11 @@ export default { } return { + totalTransactionCount: self.$locale.appendDigitGroupingSymbol(self.userStore, self.dataStatistics.totalTransactionCount), totalAccountCount: self.$locale.appendDigitGroupingSymbol(self.userStore, self.dataStatistics.totalAccountCount), totalTransactionCategoryCount: self.$locale.appendDigitGroupingSymbol(self.userStore, self.dataStatistics.totalTransactionCategoryCount), totalTransactionTagCount: self.$locale.appendDigitGroupingSymbol(self.userStore, self.dataStatistics.totalTransactionTagCount), - totalTransactionCount: self.$locale.appendDigitGroupingSymbol(self.userStore, self.dataStatistics.totalTransactionCount) + totalTransactionTemplateCount: self.$locale.appendDigitGroupingSymbol(self.userStore, self.dataStatistics.totalTransactionTemplateCount) }; }, isDataExportingEnabled() { diff --git a/src/views/mobile/users/DataManagementPage.vue b/src/views/mobile/users/DataManagementPage.vue index 064a4185..fef784ff 100644 --- a/src/views/mobile/users/DataManagementPage.vue +++ b/src/views/mobile/users/DataManagementPage.vue @@ -3,17 +3,19 @@ + - + + - + @@ -103,10 +105,11 @@ export default { } return { + totalTransactionCount: self.$locale.appendDigitGroupingSymbol(self.userStore, self.dataStatistics.totalTransactionCount), totalAccountCount: self.$locale.appendDigitGroupingSymbol(self.userStore, self.dataStatistics.totalAccountCount), totalTransactionCategoryCount: self.$locale.appendDigitGroupingSymbol(self.userStore, self.dataStatistics.totalTransactionCategoryCount), totalTransactionTagCount: self.$locale.appendDigitGroupingSymbol(self.userStore, self.dataStatistics.totalTransactionTagCount), - totalTransactionCount: self.$locale.appendDigitGroupingSymbol(self.userStore, self.dataStatistics.totalTransactionCount) + totalTransactionTemplateCount: self.$locale.appendDigitGroupingSymbol(self.userStore, self.dataStatistics.totalTransactionTemplateCount) }; }, isDataExportingEnabled() {