mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 06:57:35 +08:00
support "Add Another" in transaction add page / dialog (#471)
This commit is contained in:
@@ -29,6 +29,7 @@ var ALL_ALLOWED_CLOUD_SYNC_APP_SETTING_KEY_TYPES = map[string]UserApplicationClo
|
||||
"showTotalAmountInTransactionListPage": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,
|
||||
"showTagInTransactionListPage": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,
|
||||
// Transaction Edit Page
|
||||
"quickAddButtonActionInMobileTransactionEditPage": USER_APPLICATION_CLOUD_SETTING_TYPE_NUMBER,
|
||||
"autoSaveTransactionDraft": USER_APPLICATION_CLOUD_SETTING_TYPE_STRING,
|
||||
"autoGetCurrentGeoLocation": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,
|
||||
"alwaysShowTransactionPicturesInMobileTransactionEditPage": USER_APPLICATION_CLOUD_SETTING_TYPE_BOOLEAN,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { type WeekDayValue, WeekDay } from './datetime.ts';
|
||||
import { TimezoneTypeForStatistics } from './timezone.ts';
|
||||
import { CurrencySortingType } from './currency.ts';
|
||||
import { TransactionQuickAddButtonActionType } from './transaction.ts';
|
||||
import {
|
||||
CategoricalChartType,
|
||||
TrendChartType,
|
||||
@@ -43,6 +44,7 @@ export interface ApplicationSettings extends BaseApplicationSetting {
|
||||
overviewAccountFilterInHomePage: Record<string, boolean>;
|
||||
overviewTransactionCategoryFilterInHomePage: Record<string, boolean>;
|
||||
// Transaction List Page
|
||||
quickAddButtonActionInMobileTransactionEditPage: number;
|
||||
itemsCountInTransactionListPage: number;
|
||||
showTotalAmountInTransactionListPage: boolean;
|
||||
showTagInTransactionListPage: boolean;
|
||||
@@ -123,6 +125,7 @@ export const ALL_ALLOWED_CLOUD_SYNC_APP_SETTING_KEY_TYPES: Record<string, UserAp
|
||||
'showTotalAmountInTransactionListPage': UserApplicationCloudSettingType.Boolean,
|
||||
'showTagInTransactionListPage': UserApplicationCloudSettingType.Boolean,
|
||||
// Transaction Edit Page
|
||||
'quickAddButtonActionInMobileTransactionEditPage': UserApplicationCloudSettingType.Number,
|
||||
'autoSaveTransactionDraft': UserApplicationCloudSettingType.String,
|
||||
'autoGetCurrentGeoLocation': UserApplicationCloudSettingType.Boolean,
|
||||
'alwaysShowTransactionPicturesInMobileTransactionEditPage': UserApplicationCloudSettingType.Boolean,
|
||||
@@ -181,6 +184,7 @@ export const DEFAULT_APPLICATION_SETTINGS: ApplicationSettings = {
|
||||
showTotalAmountInTransactionListPage: true,
|
||||
showTagInTransactionListPage: true,
|
||||
// Transaction Edit Page
|
||||
quickAddButtonActionInMobileTransactionEditPage: TransactionQuickAddButtonActionType.Default.type,
|
||||
autoSaveTransactionDraft: 'disabled',
|
||||
autoGetCurrentGeoLocation: false,
|
||||
alwaysShowTransactionPicturesInMobileTransactionEditPage: false,
|
||||
|
||||
@@ -66,3 +66,34 @@ export class TransactionTagFilterType implements TypeAndName {
|
||||
return TransactionTagFilterType.allInstancesByType[type];
|
||||
}
|
||||
}
|
||||
|
||||
export class TransactionQuickAddButtonActionType implements TypeAndName {
|
||||
private static readonly allInstances: TransactionQuickAddButtonActionType[] = [];
|
||||
private static readonly allInstancesByType: Record<number, TransactionQuickAddButtonActionType> = {};
|
||||
|
||||
public static readonly SaveAndGoBack = new TransactionQuickAddButtonActionType(0, 'Save');
|
||||
public static readonly OpenMenu = new TransactionQuickAddButtonActionType(1, 'Open Menu');
|
||||
public static readonly SaveAndAddNewTransaction = new TransactionQuickAddButtonActionType(2, 'Save & New');
|
||||
public static readonly SaveAndKeepCurrentData = new TransactionQuickAddButtonActionType(3, 'Save & Duplicate');
|
||||
|
||||
public static readonly Default = TransactionQuickAddButtonActionType.SaveAndGoBack;
|
||||
|
||||
public readonly type: number;
|
||||
public readonly name: string;
|
||||
|
||||
private constructor(type: number, name: string) {
|
||||
this.type = type;
|
||||
this.name = name;
|
||||
|
||||
TransactionQuickAddButtonActionType.allInstances.push(this);
|
||||
TransactionQuickAddButtonActionType.allInstancesByType[type] = this;
|
||||
}
|
||||
|
||||
public static values(): TransactionQuickAddButtonActionType[] {
|
||||
return TransactionQuickAddButtonActionType.allInstances;
|
||||
}
|
||||
|
||||
public static valueOf(type: number): TransactionQuickAddButtonActionType | undefined {
|
||||
return TransactionQuickAddButtonActionType.allInstancesByType[type];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "Entfernen",
|
||||
"Delete": "Löschen",
|
||||
"Duplicate": "Duplizieren",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "Sortieren",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "Konto tauschen",
|
||||
"Swap Amount": "Betrag tauschen",
|
||||
"Swap Account and Amount": "Konto und Betrag tauschen",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "Duplicate (With Time)",
|
||||
"Duplicate (With Geographic Location)": "Duplicate (With Geographic Location)",
|
||||
"Duplicate (With Time and Geographic Location)": "Duplicate (With Time and Geographic Location)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "Monatlichen Gesamtbetrag anzeigen",
|
||||
"Show Transaction Tags": "Transaktions-Tag anzeigen",
|
||||
"Transaction Edit Page": "Transaktionsbearbeitungsseite",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "Entwurf automatisch speichern",
|
||||
"Always Show Confirmation": "Bestätigung jedes mal anzeigen",
|
||||
"Automatically Add Geolocation": "Geolocation automatisch hinzufügen",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "Remove",
|
||||
"Delete": "Delete",
|
||||
"Duplicate": "Duplicate",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "Sort",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "Swap Account",
|
||||
"Swap Amount": "Swap Amount",
|
||||
"Swap Account and Amount": "Swap Account and Amount",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "Duplicate (With Time)",
|
||||
"Duplicate (With Geographic Location)": "Duplicate (With Geographic Location)",
|
||||
"Duplicate (With Time and Geographic Location)": "Duplicate (With Time and Geographic Location)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "Show Monthly Total Amount",
|
||||
"Show Transaction Tags": "Show Transaction Tags",
|
||||
"Transaction Edit Page": "Transaction Edit Page",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "Automatically Save Draft",
|
||||
"Always Show Confirmation": "Always Show Confirmation",
|
||||
"Automatically Add Geolocation": "Automatically Add Geolocation",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "Eliminar",
|
||||
"Delete": "Borrar",
|
||||
"Duplicate": "Duplicar",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "Ordenar",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "Intercambiar Cuenta",
|
||||
"Swap Amount": "Intercambiar Importe",
|
||||
"Swap Account and Amount": "Intercambiar Cuenta e Importe",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "Duplicar (Con Tiempo)",
|
||||
"Duplicate (With Geographic Location)": "Duplicar (con Ubicación Geográfica)",
|
||||
"Duplicate (With Time and Geographic Location)": "Duplicado (con Hora y Ubicación Geográfica)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "Mostrar Importe Total Mensual",
|
||||
"Show Transaction Tags": "Mostrar Etiqueta de Transacción",
|
||||
"Transaction Edit Page": "Página de Edición de Transacciones",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "Guardar Borrador Automáticamente",
|
||||
"Always Show Confirmation": "Mostrar Confirmación Cada Vez",
|
||||
"Automatically Add Geolocation": "Agregar Geolocalización Automáticamente",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "Supprimer",
|
||||
"Delete": "Supprimer",
|
||||
"Duplicate": "Dupliquer",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "Trier",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "Échanger le compte",
|
||||
"Swap Amount": "Échanger le montant",
|
||||
"Swap Account and Amount": "Échanger le compte et le montant",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "Dupliquer (avec heure)",
|
||||
"Duplicate (With Geographic Location)": "Dupliquer (avec localisation géographique)",
|
||||
"Duplicate (With Time and Geographic Location)": "Dupliquer (avec heure et localisation géographique)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "Afficher le montant total mensuel",
|
||||
"Show Transaction Tags": "Afficher l'étiquette de transaction",
|
||||
"Transaction Edit Page": "Page de modification de transaction",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "Enregistrer automatiquement le brouillon",
|
||||
"Always Show Confirmation": "Afficher la confirmation à chaque fois",
|
||||
"Automatically Add Geolocation": "Ajouter automatiquement la géolocalisation",
|
||||
|
||||
@@ -128,7 +128,8 @@ import {
|
||||
} from '@/core/category.ts';
|
||||
|
||||
import {
|
||||
TransactionEditScopeType
|
||||
TransactionEditScopeType,
|
||||
TransactionQuickAddButtonActionType
|
||||
} from '@/core/transaction.ts';
|
||||
|
||||
import {
|
||||
@@ -2433,6 +2434,7 @@ export function useI18n() {
|
||||
getAllStatisticsDateAggregationTypes: (analysisType: StatisticsAnalysisType) => getLocalizedChartDateAggregationTypeAndDisplayName(analysisType, true),
|
||||
getAllStatisticsDateAggregationTypesWithShortName: (analysisType: StatisticsAnalysisType) => getLocalizedChartDateAggregationTypeAndDisplayName(analysisType, false),
|
||||
getAllTransactionEditScopeTypes: () => getLocalizedDisplayNameAndType(TransactionEditScopeType.values()),
|
||||
getAllTransactionQuickAddButtonActionTypes: () => getLocalizedDisplayNameAndType(TransactionQuickAddButtonActionType.values()),
|
||||
getAllTransactionScheduledFrequencyTypes: () => getLocalizedDisplayNameAndType(ScheduledTemplateFrequencyType.values()),
|
||||
getAllImportTransactionColumnTypes: () => getLocalizedDisplayNameAndType(ImportTransactionColumnType.values()),
|
||||
getAllTransactionDefaultCategories,
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "Rimuovi",
|
||||
"Delete": "Elimina",
|
||||
"Duplicate": "Duplica",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "Ordina",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "Scambia account",
|
||||
"Swap Amount": "Scambia importo",
|
||||
"Swap Account and Amount": "Scambia account e importo",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "Duplica (con ora)",
|
||||
"Duplicate (With Geographic Location)": "Duplica (con posizione geografica)",
|
||||
"Duplicate (With Time and Geographic Location)": "Duplica (con ora e posizione geografica)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "Mostra importo totale mensile",
|
||||
"Show Transaction Tags": "Mostra tag transazione",
|
||||
"Transaction Edit Page": "Pagina modifica transazione",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "Salva automaticamente bozza",
|
||||
"Always Show Confirmation": "Mostra conferma ogni volta",
|
||||
"Automatically Add Geolocation": "Aggiungi automaticamente geolocalizzazione",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "削除",
|
||||
"Delete": "削除",
|
||||
"Duplicate": "複製",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "並べ替え",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "口座のスワップ",
|
||||
"Swap Amount": "金額のスワップ",
|
||||
"Swap Account and Amount": "口座と金額をスワップ",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "複製(時間含む)",
|
||||
"Duplicate (With Geographic Location)": "複製(地理座標を含む)",
|
||||
"Duplicate (With Time and Geographic Location)": "複製(時間と地理座標を含む)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "毎月の合計金額を表示",
|
||||
"Show Transaction Tags": "取引タグを表示",
|
||||
"Transaction Edit Page": "取引編集ページ",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "下書きの自動保存",
|
||||
"Always Show Confirmation": "確認を毎回表示",
|
||||
"Automatically Add Geolocation": "座標を自動的に追加",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "ತೆಗೆದುಹಾಕು",
|
||||
"Delete": "ಅಳಿಸು",
|
||||
"Duplicate": "ನಕಲು ಮಾಡು",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "ವಿಂಗಡಿಸು",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "ಖಾತೆ ಬದಲಾಯಿಸಿ",
|
||||
"Swap Amount": "ಮೊತ್ತ ಬದಲಾಯಿಸಿ",
|
||||
"Swap Account and Amount": "ಖಾತೆ ಮತ್ತು ಮೊತ್ತ ಬದಲಾಯಿಸಿ",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "ನಕಲು (ಸಮಯ ಸಹಿತ)",
|
||||
"Duplicate (With Geographic Location)": "ನಕಲು (ಭೌಗೋಳಿಕ ಸ್ಥಳ ಸಹಿತ)",
|
||||
"Duplicate (With Time and Geographic Location)": "ನಕಲು (ಸಮಯ ಮತ್ತು ಭೌಗೋಳಿಕ ಸ್ಥಳ ಸಹಿತ)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "ಮಾಸಿಕ ಒಟ್ಟು ಮೊತ್ತ ತೋರಿಸಿ",
|
||||
"Show Transaction Tags": "ವಹಿವಾಟು ಟ್ಯಾಗ್ ತೋರಿಸಿ",
|
||||
"Transaction Edit Page": "ವಹಿವಾಟು ಸಂಪಾದನೆ ಪುಟ",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "ಕರಡು ಸ್ವಯಂ ಉಳಿಸಿ",
|
||||
"Always Show Confirmation": "ಪ್ರತಿ ಬಾರಿ ದೃಢೀಕರಣ ತೋರಿಸಿ",
|
||||
"Automatically Add Geolocation": "ಭೌಗೋಳಿಕ ಸ್ಥಾನವನ್ನು ಸ್ವಯಂ ಸೇರಿಸಿ",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "제거",
|
||||
"Delete": "삭제",
|
||||
"Duplicate": "복제",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "정렬",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "계좌 교체",
|
||||
"Swap Amount": "금액 교체",
|
||||
"Swap Account and Amount": "계좌 및 금액 교체",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "복제 (시간 포함)",
|
||||
"Duplicate (With Geographic Location)": "복제 (위치 포함)",
|
||||
"Duplicate (With Time and Geographic Location)": "복제 (시간 및 위치 포함)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "월별 총 금액 표시",
|
||||
"Show Transaction Tags": "거래 태그 표시",
|
||||
"Transaction Edit Page": "거래 편집 페이지",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "초안 자동 저장",
|
||||
"Always Show Confirmation": "매번 확인 표시",
|
||||
"Automatically Add Geolocation": "지리적 위치 자동 추가",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "Verwijderen",
|
||||
"Delete": "Verwijderen",
|
||||
"Duplicate": "Dupliceren",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "Sorteren",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "Rekening omwisselen",
|
||||
"Swap Amount": "Bedrag omwisselen",
|
||||
"Swap Account and Amount": "Rekening en bedrag omwisselen",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "Dupliceren (met tijd)",
|
||||
"Duplicate (With Geographic Location)": "Dupliceren (met geografische locatie)",
|
||||
"Duplicate (With Time and Geographic Location)": "Dupliceren (met tijd en locatie)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "Maandelijks totaalbedrag tonen",
|
||||
"Show Transaction Tags": "Transactietag tonen",
|
||||
"Transaction Edit Page": "Transactiebewerkingspagina",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "Concept automatisch opslaan",
|
||||
"Always Show Confirmation": "Elke keer bevestiging tonen",
|
||||
"Automatically Add Geolocation": "Geolocatie automatisch toevoegen",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "Remover",
|
||||
"Delete": "Excluir",
|
||||
"Duplicate": "Duplicar",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "Classificar",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "Trocar Conta",
|
||||
"Swap Amount": "Trocar Quantia",
|
||||
"Swap Account and Amount": "Trocar Conta e Quantia",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "Duplicar (Com Tempo)",
|
||||
"Duplicate (With Geographic Location)": "Duplicar (Com Localização Geográfica)",
|
||||
"Duplicate (With Time and Geographic Location)": "Duplicar (Com Tempo e Localização Geográfica)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "Mostrar Valor Total Mensal",
|
||||
"Show Transaction Tags": "Mostrar Tag da Transação",
|
||||
"Transaction Edit Page": "Página de Edição de Transação",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "Salvar Rascunho Automaticamente",
|
||||
"Always Show Confirmation": "Mostrar Confirmação Toda Vez",
|
||||
"Automatically Add Geolocation": "Adicionar Geolocalização Automaticamente",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "Удалить",
|
||||
"Delete": "Удалить",
|
||||
"Duplicate": "Дублировать",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "Сортировать",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "Поменять счет",
|
||||
"Swap Amount": "Поменять сумму",
|
||||
"Swap Account and Amount": "Поменять счет и сумму",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "Дублировать (со временем)",
|
||||
"Duplicate (With Geographic Location)": "Дублировать (с местом положения)",
|
||||
"Duplicate (With Time and Geographic Location)": "Дублировать (со временем и местом положения)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "Показать общую сумму за месяц",
|
||||
"Show Transaction Tags": "Показать тег транзакции",
|
||||
"Transaction Edit Page": "Страница редактирования транзакции",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "Автоматически сохранять черновик",
|
||||
"Always Show Confirmation": "Показывать подтверждение каждый раз",
|
||||
"Automatically Add Geolocation": "Автоматически добавлять геолокацию",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "Odstrani",
|
||||
"Delete": "Izbriši",
|
||||
"Duplicate": "Podvoji",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "Razvrsti",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "Zamenjaj račun",
|
||||
"Swap Amount": "Zamenjaj znesek",
|
||||
"Swap Account and Amount": "Zamenjaj račun in znesek",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "Podvoji (s časom)",
|
||||
"Duplicate (With Geographic Location)": "Podvoji (z geografsko lokacijo)",
|
||||
"Duplicate (With Time and Geographic Location)": "Podvoji (s časom in geografsko lokacijo)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "Prikaži mesečni skupni znesek",
|
||||
"Show Transaction Tags": "Prikaži oznako transakcije",
|
||||
"Transaction Edit Page": "Stran za urejanje transakcij",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "Samodejno shrani osnutek",
|
||||
"Always Show Confirmation": "Vsakič prikaži potrditev",
|
||||
"Automatically Add Geolocation": "Samodejno dodaj geolokacijo",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "அகற்று",
|
||||
"Delete": "நீக்கு",
|
||||
"Duplicate": "நகலெடு",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "வரிசைப்படுத்து",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "கணக்கு மாற்று",
|
||||
"Swap Amount": "தொகை மாற்று",
|
||||
"Swap Account and Amount": "கணக்கு மற்றும் தொகை மாற்று",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "நகலெடு (நேரம் உடன்)",
|
||||
"Duplicate (With Geographic Location)": "நகலெடு (புவியியல் இருப்பிடம் உடன்)",
|
||||
"Duplicate (With Time and Geographic Location)": "நகலெடு (நேரம் மற்றும் புவியியல் இருப்பிடம் உடன்)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "மாதாந்திர மொத்தம் தொகை காட்டு",
|
||||
"Show Transaction Tags": "பரிவர்த்தனை குறிச்சொல் காட்டு",
|
||||
"Transaction Edit Page": "பரிவர்த்தனை திருத்தம் பக்கம்",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "வரைவு தானியங்கி சேமி",
|
||||
"Always Show Confirmation": "ஒவ்வொரு முறை அங்கீகாரம் காட்டு",
|
||||
"Automatically Add Geolocation": "புவியியல் நிலையை தானியங்கி சேர்",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "เอาออก",
|
||||
"Delete": "ลบ",
|
||||
"Duplicate": "ทำสำเนา",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "จัดเรียง",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "สลับบัญชี",
|
||||
"Swap Amount": "สลับจำนวน",
|
||||
"Swap Account and Amount": "สลับบัญชีและจำนวน",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "ทำสำเนา (พร้อมเวลา)",
|
||||
"Duplicate (With Geographic Location)": "ทำสำเนา (พร้อมตำแหน่งที่ตั้ง)",
|
||||
"Duplicate (With Time and Geographic Location)": "ทำสำเนา (พร้อมเวลาและตำแหน่งที่ตั้ง)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "แสดงจำนวนเงินรวมรายเดือน",
|
||||
"Show Transaction Tags": "แสดงแท็กรายการ",
|
||||
"Transaction Edit Page": "หน้าการแก้ไขรายการ",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "บันทึกร่างอัตโนมัติ",
|
||||
"Always Show Confirmation": "แสดงการยืนยันทุกครั้ง",
|
||||
"Automatically Add Geolocation": "เพิ่มตำแหน่งทางภูมิศาสตร์อัตโนมัติ",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "Kaldır",
|
||||
"Delete": "Sil",
|
||||
"Duplicate": "Çoğalt",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "Sırala",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "Hesabı Değiştir",
|
||||
"Swap Amount": "Tutarı Değiştir",
|
||||
"Swap Account and Amount": "Hesabı ve Tutarı Değiştir",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "Çoğalt (Zaman ile)",
|
||||
"Duplicate (With Geographic Location)": "Çoğalt (Coğrafi Konum ile)",
|
||||
"Duplicate (With Time and Geographic Location)": "Çoğalt (Zaman ve Coğrafi Konum ile)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "Aylık Toplam Tutarı Göster",
|
||||
"Show Transaction Tags": "İşlem Etiketini Göster",
|
||||
"Transaction Edit Page": "İşlem Düzenleme Sayfası",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "Taslağı Otomatik Kaydet",
|
||||
"Always Show Confirmation": "Her Seferinde Onay Göster",
|
||||
"Automatically Add Geolocation": "Otomatik Olarak Konum Ekle",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "Видалити",
|
||||
"Delete": "Видалити",
|
||||
"Duplicate": "Дублювати",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "Сортувати",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "Поміняти рахунки",
|
||||
"Swap Amount": "Поміняти суми",
|
||||
"Swap Account and Amount": "Поміняти рахунки та суми",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "Дублювати (з часом)",
|
||||
"Duplicate (With Geographic Location)": "Дублювати (з геолокацією)",
|
||||
"Duplicate (With Time and Geographic Location)": "Дублювати (з часом і геолокацією)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "Показати місячну загальну суму",
|
||||
"Show Transaction Tags": "Показати тег транзакції",
|
||||
"Transaction Edit Page": "Сторінка редагування транзакції",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "Автоматично зберігати чернетку",
|
||||
"Always Show Confirmation": "Показувати підтвердження щоразу",
|
||||
"Automatically Add Geolocation": "Автоматично додавати геолокацію",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "Xóa",
|
||||
"Delete": "Xóa",
|
||||
"Duplicate": "Nhân đôi",
|
||||
"Open Menu": "Open Menu",
|
||||
"Sort": "Sắp xếp",
|
||||
"Sort by Name (A to Z)": "Sort by Name (A to Z)",
|
||||
"Sort by Name (Z to A)": "Sort by Name (Z to A)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "Hoán đổi tài khoản",
|
||||
"Swap Amount": "Hoán đổi số tiền",
|
||||
"Swap Account and Amount": "Hoán đổi tài khoản và số tiền",
|
||||
"Save & New": "Save & New",
|
||||
"Save & Duplicate": "Save & Duplicate",
|
||||
"Duplicate (With Time)": "Duplicate (With Time)",
|
||||
"Duplicate (With Geographic Location)": "Duplicate (With Geographic Location)",
|
||||
"Duplicate (With Time and Geographic Location)": "Duplicate (With Time and Geographic Location)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "Hiển thị tổng số tiền hàng tháng",
|
||||
"Show Transaction Tags": "Hiển thị thẻ giao dịch",
|
||||
"Transaction Edit Page": "Trang chỉnh sửa giao dịch",
|
||||
"Quick Add Button Action": "Quick Add Button Action",
|
||||
"Automatically Save Draft": "Tự động lưu bản nháp",
|
||||
"Always Show Confirmation": "Hiển thị xác nhận mỗi lần",
|
||||
"Automatically Add Geolocation": "Tự động thêm vị trí địa lý",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "移除",
|
||||
"Delete": "删除",
|
||||
"Duplicate": "复制",
|
||||
"Open Menu": "打开菜单",
|
||||
"Sort": "排序",
|
||||
"Sort by Name (A to Z)": "按名称排序(正序)",
|
||||
"Sort by Name (Z to A)": "按名称排序(倒序)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "交换账户",
|
||||
"Swap Amount": "交换金额",
|
||||
"Swap Account and Amount": "交换账户和金额",
|
||||
"Save & New": "保存并新建",
|
||||
"Save & Duplicate": "保存并复制",
|
||||
"Duplicate (With Time)": "复制 (含时间)",
|
||||
"Duplicate (With Geographic Location)": "复制 (含地理位置)",
|
||||
"Duplicate (With Time and Geographic Location)": "复制 (含时间和地理位置)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "显示月度总金额",
|
||||
"Show Transaction Tags": "显示交易标签",
|
||||
"Transaction Edit Page": "交易编辑页面",
|
||||
"Quick Add Button Action": "快速添加按钮操作",
|
||||
"Automatically Save Draft": "自动保存草稿",
|
||||
"Always Show Confirmation": "每次提示确认",
|
||||
"Automatically Add Geolocation": "自动添加地理位置",
|
||||
|
||||
@@ -1495,6 +1495,7 @@
|
||||
"Remove": "移除",
|
||||
"Delete": "刪除",
|
||||
"Duplicate": "複製",
|
||||
"Open Menu": "打開選單",
|
||||
"Sort": "排序",
|
||||
"Sort by Name (A to Z)": "依名稱排序(正序)",
|
||||
"Sort by Name (Z to A)": "依名稱排序(倒序)",
|
||||
@@ -1901,6 +1902,8 @@
|
||||
"Swap Account": "交換帳戶",
|
||||
"Swap Amount": "交換金額",
|
||||
"Swap Account and Amount": "交換帳戶和金額",
|
||||
"Save & New": "儲存並新增",
|
||||
"Save & Duplicate": "儲存并複製",
|
||||
"Duplicate (With Time)": "複製 (含時間)",
|
||||
"Duplicate (With Geographic Location)": "複製 (含地理位置)",
|
||||
"Duplicate (With Time and Geographic Location)": "複製 (含時間和地理位置)",
|
||||
@@ -2231,6 +2234,7 @@
|
||||
"Show Monthly Total Amount": "顯示月度總金額",
|
||||
"Show Transaction Tags": "顯示交易標籤",
|
||||
"Transaction Edit Page": "交易編輯頁面",
|
||||
"Quick Add Button Action": "快速新增按鈕動作",
|
||||
"Automatically Save Draft": "自動儲存草稿",
|
||||
"Always Show Confirmation": "每次提示確認",
|
||||
"Automatically Add Geolocation": "自動新增地理位置",
|
||||
|
||||
@@ -234,6 +234,12 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
}
|
||||
|
||||
// Transaction Edit Page
|
||||
function setQuickAddButtonActionInMobileTransactionEditPage(value: number): void {
|
||||
updateApplicationSettingsValue('quickAddButtonActionInMobileTransactionEditPage', value);
|
||||
appSettings.value.quickAddButtonActionInMobileTransactionEditPage = value;
|
||||
updateUserApplicationCloudSettingValue('quickAddButtonActionInMobileTransactionEditPage', value);
|
||||
}
|
||||
|
||||
function setAutoSaveTransactionDraft(value: string): void {
|
||||
updateApplicationSettingsValue('autoSaveTransactionDraft', value);
|
||||
appSettings.value.autoSaveTransactionDraft = value;
|
||||
@@ -531,6 +537,7 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
setShowTotalAmountInTransactionListPage,
|
||||
setShowTagInTransactionListPage,
|
||||
// -- Transaction Edit Page
|
||||
setQuickAddButtonActionInMobileTransactionEditPage,
|
||||
setAutoSaveTransactionDraft,
|
||||
setAutoGetCurrentGeoLocation,
|
||||
setAlwaysShowTransactionPicturesInMobileTransactionEditPage,
|
||||
|
||||
@@ -53,6 +53,7 @@ export const ALL_APPLICATION_CLOUD_SETTINGS: CategorizedApplicationCloudSettingI
|
||||
{
|
||||
categoryName: 'Transaction Edit Page',
|
||||
items: [
|
||||
{ settingKey: 'quickAddButtonActionInMobileTransactionEditPage', settingName: 'Quick Add Button Action', mobile: true, desktop: false },
|
||||
{ settingKey: 'autoSaveTransactionDraft', settingName: 'Automatically Save Draft', mobile: true, desktop: true },
|
||||
{ settingKey: 'autoGetCurrentGeoLocation', settingName: 'Automatically Add Geolocation', mobile: true, desktop: true },
|
||||
{ settingKey: 'alwaysShowTransactionPicturesInMobileTransactionEditPage', settingName: 'Always Show Transaction Pictures', mobile: true, desktop: false }
|
||||
|
||||
@@ -13,7 +13,7 @@ import { useExchangeRatesStore } from '@/stores/exchangeRates.ts';
|
||||
import type { NumeralSystem } from '@/core/numeral.ts';
|
||||
import type { WeekDayValue } from '@/core/datetime.ts';
|
||||
import type { LocalizedTimezoneInfo } from '@/core/timezone.ts';
|
||||
import { TransactionType } from '@/core/transaction.ts';
|
||||
import { TransactionType, TransactionQuickAddButtonActionType } from '@/core/transaction.ts';
|
||||
import { TemplateType } from '@/core/template.ts';
|
||||
import { DISPLAY_HIDDEN_AMOUNT } from '@/consts/numeral.ts';
|
||||
import { TRANSACTION_MAX_PICTURE_COUNT } from '@/consts/transaction.ts';
|
||||
@@ -64,6 +64,12 @@ export enum GeoLocationStatus {
|
||||
Error = 'error'
|
||||
}
|
||||
|
||||
export enum AfterSaveAction {
|
||||
GoBack = 'goBack',
|
||||
StayWithNewTransaction = 'stayWithNewTransaction',
|
||||
StayWithCurrentTransaction = 'stayWithCurrentTransaction'
|
||||
}
|
||||
|
||||
export function useTransactionEditPageBase(type: TransactionEditPageType, initMode?: TransactionEditPageMode, transactionDefaultType?: number) {
|
||||
const {
|
||||
tt,
|
||||
@@ -93,6 +99,7 @@ export function useTransactionEditPageBase(type: TransactionEditPageType, initMo
|
||||
const clientSessionId = ref<string>('');
|
||||
const loading = ref<boolean>(true);
|
||||
const submitting = ref<boolean>(false);
|
||||
const submitted = ref<boolean>(false);
|
||||
const uploadingPicture = ref<boolean>(false);
|
||||
const geoLocationStatus = ref<GeoLocationStatus | null>(null);
|
||||
const setGeoLocationByClickMap = ref<boolean>(false);
|
||||
@@ -170,6 +177,20 @@ export function useTransactionEditPageBase(type: TransactionEditPageType, initMo
|
||||
}
|
||||
});
|
||||
|
||||
const quickSaveButtonTitle = computed<string>(() => {
|
||||
if (mode.value === TransactionEditPageMode.Add) {
|
||||
const quickAddActionType = TransactionQuickAddButtonActionType.valueOf(settingsStore.appSettings.quickAddButtonActionInMobileTransactionEditPage);
|
||||
|
||||
if (quickAddActionType && quickAddActionType.type !== TransactionQuickAddButtonActionType.OpenMenu.type) {
|
||||
return quickAddActionType.name;
|
||||
} else {
|
||||
return 'Add';
|
||||
}
|
||||
} else {
|
||||
return 'Save';
|
||||
}
|
||||
});
|
||||
|
||||
const cancelButtonTitle = computed<string>(() => {
|
||||
if (mode.value === TransactionEditPageMode.View) {
|
||||
return 'Close';
|
||||
@@ -395,6 +416,16 @@ export function useTransactionEditPageBase(type: TransactionEditPageType, initMo
|
||||
);
|
||||
}
|
||||
|
||||
function updateTransactionModelByAfterSaveAction(afterSaveAction: AfterSaveAction, initOptions?: SetTransactionOptions): void {
|
||||
if (afterSaveAction === AfterSaveAction.StayWithNewTransaction) {
|
||||
transaction.value = createNewTransactionModel(transactionDefaultType);
|
||||
setTransactionModel(null, initOptions, true);
|
||||
geoLocationStatus.value = null;
|
||||
} else if (afterSaveAction === AfterSaveAction.StayWithCurrentTransaction) {
|
||||
transaction.value.clearPictures();
|
||||
}
|
||||
}
|
||||
|
||||
function updateTransactionTime(newTime: number): void {
|
||||
transaction.value.time = newTime;
|
||||
updateTransactionTimezone(transaction.value.timeZone ?? '');
|
||||
@@ -489,6 +520,7 @@ export function useTransactionEditPageBase(type: TransactionEditPageType, initMo
|
||||
clientSessionId,
|
||||
loading,
|
||||
submitting,
|
||||
submitted,
|
||||
uploadingPicture,
|
||||
geoLocationStatus,
|
||||
setGeoLocationByClickMap,
|
||||
@@ -516,6 +548,7 @@ export function useTransactionEditPageBase(type: TransactionEditPageType, initMo
|
||||
canAddTransactionPicture,
|
||||
title,
|
||||
saveButtonTitle,
|
||||
quickSaveButtonTitle,
|
||||
cancelButtonTitle,
|
||||
sourceAmountName,
|
||||
sourceAmountTitle,
|
||||
@@ -533,6 +566,7 @@ export function useTransactionEditPageBase(type: TransactionEditPageType, initMo
|
||||
// functions
|
||||
createNewTransactionModel,
|
||||
setTransactionModel,
|
||||
updateTransactionModelByAfterSaveAction,
|
||||
updateTransactionTime,
|
||||
updateTransactionTimezone,
|
||||
swapTransactionData,
|
||||
|
||||
@@ -414,11 +414,25 @@
|
||||
<v-tooltip :disabled="!inputIsEmpty" :text="inputEmptyProblemMessage ? tt(inputEmptyProblemMessage) : ''">
|
||||
<template v-slot:activator="{ props }">
|
||||
<div v-bind="props" class="d-inline-block">
|
||||
<v-btn :disabled="inputIsEmpty || loading || submitting"
|
||||
v-if="mode !== TransactionEditPageMode.View" @click="save">
|
||||
{{ tt(saveButtonTitle) }}
|
||||
<v-progress-circular indeterminate size="22" class="ms-2" v-if="submitting"></v-progress-circular>
|
||||
</v-btn>
|
||||
<v-btn-group density="comfortable" v-if="mode === TransactionEditPageMode.Add || mode === TransactionEditPageMode.Edit">
|
||||
<v-btn color="primary" :disabled="inputIsEmpty || loading || submitting" @click="save(AfterSaveAction.GoBack)">
|
||||
{{ tt(saveButtonTitle) }}
|
||||
<v-progress-circular indeterminate size="22" class="ms-2" v-if="submitting"></v-progress-circular>
|
||||
</v-btn>
|
||||
<v-btn color="primary" density="compact"
|
||||
:disabled="inputIsEmpty || loading || submitting" :icon="true"
|
||||
v-if="type === TransactionEditPageType.Transaction && mode === TransactionEditPageMode.Add">
|
||||
<v-icon :icon="mdiMenuDown" size="24" />
|
||||
<v-menu activator="parent">
|
||||
<v-list>
|
||||
<v-list-item :title="tt(TransactionQuickAddButtonActionType.SaveAndAddNewTransaction.name)"
|
||||
@click="save(AfterSaveAction.StayWithNewTransaction)"></v-list-item>
|
||||
<v-list-item :title="tt(TransactionQuickAddButtonActionType.SaveAndKeepCurrentData.name)"
|
||||
@click="save(AfterSaveAction.StayWithCurrentTransaction)"></v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-btn>
|
||||
</v-btn-group>
|
||||
</div>
|
||||
</template>
|
||||
</v-tooltip>
|
||||
@@ -474,6 +488,7 @@ import {
|
||||
TransactionEditPageMode,
|
||||
TransactionEditPageType,
|
||||
GeoLocationStatus,
|
||||
AfterSaveAction,
|
||||
useTransactionEditPageBase
|
||||
} from '@/views/base/transactions/TransactionEditPageBase.ts';
|
||||
|
||||
@@ -487,7 +502,7 @@ import { useTransactionTemplatesStore } from '@/stores/transactionTemplate.ts';
|
||||
|
||||
import type { Coordinate } from '@/core/coordinate.ts';
|
||||
import { CategoryType } from '@/core/category.ts';
|
||||
import { TransactionType, TransactionEditScopeType } from '@/core/transaction.ts';
|
||||
import { TransactionType, TransactionEditScopeType, TransactionQuickAddButtonActionType } from '@/core/transaction.ts';
|
||||
import { TemplateType, ScheduledTemplateFrequencyType } from '@/core/template.ts';
|
||||
import { KnownErrorCode } from '@/consts/api.ts';
|
||||
import { SUPPORTED_IMAGE_EXTENSIONS } from '@/consts/file.ts';
|
||||
@@ -563,6 +578,7 @@ const {
|
||||
clientSessionId,
|
||||
loading,
|
||||
submitting,
|
||||
submitted,
|
||||
uploadingPicture,
|
||||
geoLocationStatus,
|
||||
setGeoLocationByClickMap,
|
||||
@@ -596,6 +612,7 @@ const {
|
||||
inputIsEmpty,
|
||||
createNewTransactionModel,
|
||||
setTransactionModel,
|
||||
updateTransactionModelByAfterSaveAction,
|
||||
updateTransactionTime,
|
||||
updateTransactionTimezone,
|
||||
swapTransactionData,
|
||||
@@ -656,6 +673,7 @@ function open(options: TransactionEditOptions): Promise<TransactionEditResponse
|
||||
activeTab.value = 'basicInfo';
|
||||
loading.value = true;
|
||||
submitting.value = false;
|
||||
submitted.value = false;
|
||||
geoLocationStatus.value = null;
|
||||
setGeoLocationByClickMap.value = false;
|
||||
originalTransactionEditable.value = false;
|
||||
@@ -791,7 +809,7 @@ function open(options: TransactionEditOptions): Promise<TransactionEditResponse
|
||||
});
|
||||
}
|
||||
|
||||
function save(): void {
|
||||
function save(afterAction: AfterSaveAction): void {
|
||||
const problemMessage = inputEmptyProblemMessage.value;
|
||||
|
||||
if (problemMessage) {
|
||||
@@ -810,24 +828,31 @@ function save(): void {
|
||||
clientSessionId: clientSessionId.value
|
||||
}).then(() => {
|
||||
submitting.value = false;
|
||||
|
||||
if (resolveFunc) {
|
||||
if (mode.value === TransactionEditPageMode.Add) {
|
||||
resolveFunc({
|
||||
message: 'You have added a new transaction'
|
||||
});
|
||||
} else if (mode.value === TransactionEditPageMode.Edit) {
|
||||
resolveFunc({
|
||||
message: 'You have saved this transaction'
|
||||
});
|
||||
}
|
||||
}
|
||||
submitted.value = true;
|
||||
|
||||
if (mode.value === TransactionEditPageMode.Add && !noTransactionDraft.value && !addByTemplateId.value && !duplicateFromId.value) {
|
||||
transactionsStore.clearTransactionDraft();
|
||||
}
|
||||
|
||||
showState.value = false;
|
||||
if (mode.value === TransactionEditPageMode.Add && (afterAction === AfterSaveAction.StayWithNewTransaction || afterAction === AfterSaveAction.StayWithCurrentTransaction)) {
|
||||
snackbar.value?.showMessage('You have added a new transaction');
|
||||
updateTransactionModelByAfterSaveAction(afterAction, initOptions.value);
|
||||
clientSessionId.value = generateRandomUUID();
|
||||
} else {
|
||||
if (resolveFunc) {
|
||||
if (mode.value === TransactionEditPageMode.Add) {
|
||||
resolveFunc({
|
||||
message: 'You have added a new transaction'
|
||||
});
|
||||
} else if (mode.value === TransactionEditPageMode.Edit) {
|
||||
resolveFunc({
|
||||
message: 'You have saved this transaction'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
showState.value = false;
|
||||
}
|
||||
}).catch(error => {
|
||||
submitting.value = false;
|
||||
|
||||
@@ -903,6 +928,7 @@ function duplicate(withTime?: boolean, withGeoLocation?: boolean): void {
|
||||
editId.value = null;
|
||||
duplicateFromId.value = transaction.value.id;
|
||||
clientSessionId.value = generateRandomUUID();
|
||||
submitted.value = false;
|
||||
activeTab.value = 'basicInfo';
|
||||
transaction.value.id = '';
|
||||
|
||||
@@ -958,7 +984,11 @@ function remove(): void {
|
||||
|
||||
function cancel(): void {
|
||||
const doClose = function () {
|
||||
if (rejectFunc) {
|
||||
if (props.type === TransactionEditPageType.Transaction && mode.value === TransactionEditPageMode.Add && submitted.value && resolveFunc) {
|
||||
resolveFunc({
|
||||
message: 'You have added a new transaction'
|
||||
});
|
||||
} else if (rejectFunc) {
|
||||
rejectFunc();
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
</f7-list>
|
||||
|
||||
<f7-block-title>{{ tt('Transaction List Page') }}</f7-block-title>
|
||||
<f7-list strong inset dividers>
|
||||
<f7-list strong inset dividers class="settings-list">
|
||||
<f7-list-item>
|
||||
<template #after-title>
|
||||
{{ tt('Show Monthly Total Amount') }}
|
||||
@@ -91,7 +91,33 @@
|
||||
</f7-list>
|
||||
|
||||
<f7-block-title>{{ tt('Transaction Edit Page') }}</f7-block-title>
|
||||
<f7-list strong inset dividers>
|
||||
<f7-list strong inset dividers class="settings-list">
|
||||
<f7-list-item
|
||||
class="item-truncate-after-text"
|
||||
link="#"
|
||||
@click="showQuickAddButtonActionInMobileTransactionEditPagePopup = true"
|
||||
>
|
||||
<template #after-title>
|
||||
<div class="item-actual-title">
|
||||
<span>{{ tt('Quick Add Button Action') }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #after>
|
||||
{{ findDisplayNameByType(allTransactionQuickAddButtonActionTypes, quickAddButtonActionInMobileTransactionEditPage) }}
|
||||
</template>
|
||||
<list-item-selection-popup value-type="item"
|
||||
key-field="type" value-field="type"
|
||||
title-field="displayName"
|
||||
:title="tt('Quick Add Button Action')"
|
||||
:enable-filter="true"
|
||||
:filter-placeholder="tt('Quick Add Button Action')"
|
||||
:filter-no-items-text="tt('No results')"
|
||||
:items="allTransactionQuickAddButtonActionTypes"
|
||||
v-model:show="showQuickAddButtonActionInMobileTransactionEditPagePopup"
|
||||
v-model="quickAddButtonActionInMobileTransactionEditPage">
|
||||
</list-item-selection-popup>
|
||||
</f7-list-item>
|
||||
|
||||
<f7-list-item
|
||||
class="item-truncate-after-text"
|
||||
link="#"
|
||||
@@ -138,7 +164,7 @@
|
||||
</f7-list>
|
||||
|
||||
<f7-block-title>{{ tt('Account List Page') }}</f7-block-title>
|
||||
<f7-list strong inset dividers>
|
||||
<f7-list strong inset dividers class="settings-list">
|
||||
<f7-list-item
|
||||
class="item-truncate-after-text"
|
||||
link="/settings/filter/account?type=accountListTotalAmount"
|
||||
@@ -168,7 +194,7 @@
|
||||
</f7-list>
|
||||
|
||||
<f7-block-title>{{ tt('Exchange Rates Data Page') }}</f7-block-title>
|
||||
<f7-list strong inset dividers>
|
||||
<f7-list strong inset dividers class="settings-list">
|
||||
<f7-list-item
|
||||
class="item-truncate-after-text"
|
||||
link="#"
|
||||
@@ -209,11 +235,12 @@ import { useSettingsStore } from '@/stores/setting.ts';
|
||||
import { useAccountsStore } from '@/stores/account.ts';
|
||||
import { useTransactionCategoriesStore } from '@/stores/transactionCategory.ts';
|
||||
|
||||
import type { TypeAndDisplayName } from '@/core/base.ts';
|
||||
import { CategoryType } from '@/core/category.ts';
|
||||
|
||||
import { findNameByValue, findDisplayNameByType } from '@/lib/common.ts';
|
||||
|
||||
const { tt } = useI18n();
|
||||
const { tt, getAllTransactionQuickAddButtonActionTypes } = useI18n();
|
||||
const { showToast } = useI18nUIComponents();
|
||||
const {
|
||||
loadingAccounts,
|
||||
@@ -242,9 +269,17 @@ const accountsStore = useAccountsStore();
|
||||
const transactionCategoriesStore = useTransactionCategoriesStore();
|
||||
|
||||
const showTimezoneUsedForStatisticsInHomePagePopup = ref<boolean>(false);
|
||||
const showQuickAddButtonActionInMobileTransactionEditPagePopup = ref<boolean>(false);
|
||||
const showAutoSaveTransactionDraftPopup = ref<boolean>(false);
|
||||
const showCurrencySortByInExchangeRatesPagePopup = ref<boolean>(false);
|
||||
|
||||
const allTransactionQuickAddButtonActionTypes = computed<TypeAndDisplayName[]>(() => getAllTransactionQuickAddButtonActionTypes());
|
||||
|
||||
const quickAddButtonActionInMobileTransactionEditPage = computed<number>({
|
||||
get: () => settingsStore.appSettings.quickAddButtonActionInMobileTransactionEditPage,
|
||||
set: (value) => settingsStore.setQuickAddButtonActionInMobileTransactionEditPage(value)
|
||||
});
|
||||
|
||||
const alwaysShowTransactionPicturesInMobileTransactionEditPage = computed<boolean>({
|
||||
get: () => settingsStore.appSettings.alwaysShowTransactionPicturesInMobileTransactionEditPage,
|
||||
set: (value) => settingsStore.setAlwaysShowTransactionPicturesInMobileTransactionEditPage(value)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<f7-nav-title :title="tt(title)"></f7-nav-title>
|
||||
<f7-nav-right :class="{ 'navbar-compact-icons': true, 'disabled': loading }" v-if="mode !== TransactionEditPageMode.View || transaction.type !== TransactionType.ModifyBalance">
|
||||
<f7-link icon-f7="ellipsis" @click="showMoreActionSheet = true"></f7-link>
|
||||
<f7-link icon-f7="checkmark_alt" :class="{ 'disabled': inputIsEmpty || submitting }" @click="save" v-if="mode !== TransactionEditPageMode.View"></f7-link>
|
||||
<f7-link icon-f7="checkmark_alt" :class="{ 'disabled': inputIsEmpty || submitting }" @click="save(AfterSaveAction.GoBack)" v-if="mode !== TransactionEditPageMode.View"></f7-link>
|
||||
</f7-nav-right>
|
||||
</f7-navbar>
|
||||
|
||||
@@ -470,12 +470,27 @@
|
||||
</f7-actions>
|
||||
|
||||
<template #fixed>
|
||||
<f7-fab position="right-bottom" :class="{ 'disabled': inputIsEmpty || submitting }"
|
||||
:text="tt(saveButtonTitle)"
|
||||
@click="save" v-if="mode !== TransactionEditPageMode.View">
|
||||
<f7-fab id="quick-save-fab" position="right-bottom" :class="{ 'disabled': inputIsEmpty || submitting }"
|
||||
:text="tt(quickSaveButtonTitle)"
|
||||
@click="quickSave" v-if="mode !== TransactionEditPageMode.View">
|
||||
</f7-fab>
|
||||
</template>
|
||||
|
||||
<f7-popover class="quick-save-popover" target-el="#quick-save-fab"
|
||||
v-model:opened="showQuickSavePopover">
|
||||
<f7-list>
|
||||
<f7-list-item link="#" no-chevron popover-close
|
||||
:title="tt(TransactionQuickAddButtonActionType.SaveAndGoBack.name)"
|
||||
@click="save(AfterSaveAction.GoBack)"></f7-list-item>
|
||||
<f7-list-item link="#" no-chevron popover-close
|
||||
:title="tt(TransactionQuickAddButtonActionType.SaveAndAddNewTransaction.name)"
|
||||
@click="save(AfterSaveAction.StayWithNewTransaction)"></f7-list-item>
|
||||
<f7-list-item link="#" no-chevron popover-close
|
||||
:title="tt(TransactionQuickAddButtonActionType.SaveAndKeepCurrentData.name)"
|
||||
@click="save(AfterSaveAction.StayWithCurrentTransaction)"></f7-list-item>
|
||||
</f7-list>
|
||||
</f7-popover>
|
||||
|
||||
<f7-photo-browser ref="pictureBrowser" type="popup" navbar-of-text="/"
|
||||
:navbar-show-count="true" :exposition="false"
|
||||
:photos="transactionPictures" :thumbs="transactionThumbs" />
|
||||
@@ -493,6 +508,7 @@ import {
|
||||
TransactionEditPageMode,
|
||||
TransactionEditPageType,
|
||||
GeoLocationStatus,
|
||||
AfterSaveAction,
|
||||
useTransactionEditPageBase
|
||||
} from '@/views/base/transactions/TransactionEditPageBase.ts';
|
||||
|
||||
@@ -505,7 +521,7 @@ import { useTransactionsStore } from '@/stores/transaction.ts';
|
||||
import { useTransactionTemplatesStore } from '@/stores/transactionTemplate.ts';
|
||||
|
||||
import { CategoryType } from '@/core/category.ts';
|
||||
import { TransactionEditScopeType, TransactionType } from '@/core/transaction.ts';
|
||||
import { TransactionType, TransactionEditScopeType, TransactionQuickAddButtonActionType } from '@/core/transaction.ts';
|
||||
import { ScheduledTemplateFrequencyType, TemplateType } from '@/core/template.ts';
|
||||
import { TRANSACTION_MAX_AMOUNT, TRANSACTION_MIN_AMOUNT } from '@/consts/transaction.ts';
|
||||
import { KnownErrorCode } from '@/consts/api.ts';
|
||||
@@ -523,6 +539,7 @@ import {
|
||||
import { formatCoordinate } from '@/lib/coordinate.ts';
|
||||
import { generateRandomUUID } from '@/lib/misc.ts';
|
||||
import { getTransactionPrimaryCategoryName, getTransactionSecondaryCategoryName } from '@/lib/category.ts';
|
||||
import { type SetTransactionOptions } from '@/lib/transaction.ts';
|
||||
import { getMapProvider, isTransactionPicturesEnabled } from '@/lib/server_settings.ts';
|
||||
import logger from '@/lib/logger.ts';
|
||||
|
||||
@@ -554,6 +571,7 @@ const {
|
||||
clientSessionId,
|
||||
loading,
|
||||
submitting,
|
||||
submitted,
|
||||
uploadingPicture,
|
||||
geoLocationStatus,
|
||||
setGeoLocationByClickMap,
|
||||
@@ -574,7 +592,7 @@ const {
|
||||
hasVisibleTransferCategories,
|
||||
canAddTransactionPicture,
|
||||
title,
|
||||
saveButtonTitle,
|
||||
quickSaveButtonTitle,
|
||||
sourceAmountTitle,
|
||||
sourceAccountTitle,
|
||||
transferInAmountTitle,
|
||||
@@ -588,6 +606,7 @@ const {
|
||||
inputEmptyProblemMessage,
|
||||
inputIsEmpty,
|
||||
setTransactionModel,
|
||||
updateTransactionModelByAfterSaveAction,
|
||||
updateTransactionTime,
|
||||
updateTransactionTimezone,
|
||||
swapTransactionData,
|
||||
@@ -609,10 +628,10 @@ const pictureInput = useTemplateRef<HTMLInputElement>('pictureInput');
|
||||
const isSupportClipboard = !!navigator.clipboard;
|
||||
|
||||
const loadingError = ref<unknown | null>(null);
|
||||
const submitted = ref<boolean>(false);
|
||||
const removingPictureId = ref<string | null>(null);
|
||||
const transactionDateTimeSheetMode = ref<string>('time');
|
||||
const showTimeInDefaultTimezone = ref<boolean>(false);
|
||||
const showQuickSavePopover = ref<boolean>(false);
|
||||
const showTimezonePopup = ref<boolean>(false);
|
||||
const showGeoLocationActionSheet = ref<boolean>(false);
|
||||
const showMoreActionSheet = ref<boolean>(false);
|
||||
@@ -825,6 +844,20 @@ function getFontClassByAmount(amount: number): string {
|
||||
}
|
||||
}
|
||||
|
||||
function getQueryTransactionOptions(): SetTransactionOptions {
|
||||
return {
|
||||
time: query['time'] ? parseInt(query['time']) : undefined,
|
||||
type: query['type'] ? parseInt(query['type']) : 0,
|
||||
categoryId: query['categoryId'],
|
||||
accountId: query['accountId'],
|
||||
destinationAccountId: query['destinationAccountId'],
|
||||
amount: query['amount'] ? parseInt(query['amount']) : undefined,
|
||||
destinationAmount: query['destinationAmount'] ? parseInt(query['destinationAmount']) : undefined,
|
||||
tagIds: query['tagIds'],
|
||||
comment: query['comment']
|
||||
};
|
||||
}
|
||||
|
||||
function init(): void {
|
||||
if (!pageTypeAndMode) {
|
||||
showToast('Parameter Invalid');
|
||||
@@ -875,16 +908,16 @@ function init(): void {
|
||||
}
|
||||
}
|
||||
|
||||
const queryType = query['type'] ? parseInt(query['type']) : 0;
|
||||
const initOptions = getQueryTransactionOptions();
|
||||
|
||||
if (queryType &&
|
||||
queryType >= TransactionType.Income &&
|
||||
queryType <= TransactionType.Transfer) {
|
||||
transaction.value.type = queryType;
|
||||
} else if (queryType === TransactionType.ModifyBalance &&
|
||||
if (initOptions.type &&
|
||||
initOptions.type >= TransactionType.Income &&
|
||||
initOptions.type <= TransactionType.Transfer) {
|
||||
transaction.value.type = initOptions.type;
|
||||
} else if (initOptions.type === TransactionType.ModifyBalance &&
|
||||
pageTypeAndMode.type === TransactionEditPageType.Transaction &&
|
||||
mode.value === TransactionEditPageMode.View) {
|
||||
transaction.value.type = queryType;
|
||||
transaction.value.type = initOptions.type;
|
||||
}
|
||||
|
||||
if (mode.value === TransactionEditPageMode.Add) {
|
||||
@@ -926,17 +959,7 @@ function init(): void {
|
||||
|
||||
setTransactionModel(
|
||||
fromTransaction,
|
||||
{
|
||||
time: query['time'] ? parseInt(query['time']) : undefined,
|
||||
type: queryType,
|
||||
categoryId: query['categoryId'],
|
||||
accountId: query['accountId'],
|
||||
destinationAccountId: query['destinationAccountId'],
|
||||
amount: query['amount'] ? parseInt(query['amount']) : undefined,
|
||||
destinationAmount: query['destinationAmount'] ? parseInt(query['destinationAmount']) : undefined,
|
||||
tagIds: query['tagIds'],
|
||||
comment: query['comment']
|
||||
},
|
||||
initOptions,
|
||||
pageTypeAndMode.type === TransactionEditPageType.Transaction && (mode.value === TransactionEditPageMode.Edit || mode.value === TransactionEditPageMode.View)
|
||||
);
|
||||
|
||||
@@ -974,7 +997,7 @@ function init(): void {
|
||||
});
|
||||
}
|
||||
|
||||
function save(): void {
|
||||
function save(afterAction: AfterSaveAction): void {
|
||||
const router = props.f7router;
|
||||
|
||||
if (mode.value === TransactionEditPageMode.View) {
|
||||
@@ -1000,20 +1023,26 @@ function save(): void {
|
||||
clientSessionId: clientSessionId.value
|
||||
}).then(() => {
|
||||
submitting.value = false;
|
||||
submitted.value = true;
|
||||
hideLoading();
|
||||
|
||||
if (mode.value === TransactionEditPageMode.Add) {
|
||||
showToast('You have added a new transaction');
|
||||
} else if (mode.value === TransactionEditPageMode.Edit) {
|
||||
showToast('You have saved this transaction');
|
||||
}
|
||||
|
||||
if (mode.value === TransactionEditPageMode.Add && query['noTransactionDraft'] !== 'true' && !addByTemplateId.value && !duplicateFromId.value) {
|
||||
transactionsStore.clearTransactionDraft();
|
||||
}
|
||||
|
||||
submitted.value = true;
|
||||
router.back();
|
||||
if (mode.value === TransactionEditPageMode.Add && (afterAction === AfterSaveAction.StayWithNewTransaction || afterAction === AfterSaveAction.StayWithCurrentTransaction)) {
|
||||
showToast('You have added a new transaction');
|
||||
updateTransactionModelByAfterSaveAction(afterAction, getQueryTransactionOptions());
|
||||
clientSessionId.value = generateRandomUUID();
|
||||
} else {
|
||||
if (mode.value === TransactionEditPageMode.Add) {
|
||||
showToast('You have added a new transaction');
|
||||
} else if (mode.value === TransactionEditPageMode.Edit) {
|
||||
showToast('You have saved this transaction');
|
||||
}
|
||||
|
||||
router.back();
|
||||
}
|
||||
}).catch(error => {
|
||||
submitting.value = false;
|
||||
hideLoading();
|
||||
@@ -1062,6 +1091,7 @@ function save(): void {
|
||||
clientSessionId: clientSessionId.value
|
||||
}).then(() => {
|
||||
submitting.value = false;
|
||||
submitted.value = true;
|
||||
hideLoading();
|
||||
|
||||
if (mode.value === TransactionEditPageMode.Add) {
|
||||
@@ -1070,7 +1100,6 @@ function save(): void {
|
||||
showToast('You have saved this template');
|
||||
}
|
||||
|
||||
submitted.value = true;
|
||||
router.back();
|
||||
}).catch(error => {
|
||||
submitting.value = false;
|
||||
@@ -1083,6 +1112,29 @@ function save(): void {
|
||||
}
|
||||
}
|
||||
|
||||
function quickSave(): void {
|
||||
if (mode.value === TransactionEditPageMode.View) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pageTypeAndMode?.type === TransactionEditPageType.Transaction && mode.value === TransactionEditPageMode.Add) {
|
||||
const quickAddActionType = settingsStore.appSettings.quickAddButtonActionInMobileTransactionEditPage;
|
||||
|
||||
if (quickAddActionType === TransactionQuickAddButtonActionType.OpenMenu.type) {
|
||||
showQuickSavePopover.value = true;
|
||||
return;
|
||||
} else if (quickAddActionType === TransactionQuickAddButtonActionType.SaveAndAddNewTransaction.type) {
|
||||
save(AfterSaveAction.StayWithNewTransaction);
|
||||
return;
|
||||
} else if (quickAddActionType === TransactionQuickAddButtonActionType.SaveAndKeepCurrentData.type) {
|
||||
save(AfterSaveAction.StayWithCurrentTransaction);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
save(AfterSaveAction.GoBack);
|
||||
}
|
||||
|
||||
function pasteAmount(type: 'sourceAmount' | 'destinationAmount'): void {
|
||||
if (mode.value === TransactionEditPageMode.View || !isSupportClipboard) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user