mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-14 06:57:35 +08:00
support exporting statistics & analysis result, reconciliation statement and import check result to SSV (semicolon separated values) file
This commit is contained in:
@@ -4,6 +4,7 @@ export class KnownFileType {
|
||||
public static readonly JSON = new KnownFileType('json', 'application/json');
|
||||
public static readonly CSV = new KnownFileType('csv', 'text/csv');
|
||||
public static readonly TSV = new KnownFileType('tsv', 'text/tab-separated-values');
|
||||
public static readonly SSV = new KnownFileType('txt', 'text/plain');
|
||||
public static readonly TXT = new KnownFileType('txt', 'text/plain');
|
||||
public static readonly MARKDOWN = new KnownFileType('md', 'text/markdown');
|
||||
public static readonly JS = new KnownFileType('js', 'application/javascript');
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export const extendMdiSemicolon: string = 'M15.6,2.4H8V10H15.6V6.6Z M5.6,12.4H15.56V18.368L12.368,21.752 H8.4L11.576,18.368H8V12.4Z';
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (Semicolon-separated values) File",
|
||||
"Export to CSV (Comma-separated values) File": "Export to CSV (Comma-separated values) File",
|
||||
"Export to TSV (Tab-separated values) File": "Export to TSV (Tab-separated values) File",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "Markdown File",
|
||||
"Clear User Data": "Benutzerdaten löschen",
|
||||
"Clear All Transactions": "Clear All Transactions",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (Semicolon-separated values) File",
|
||||
"Export to CSV (Comma-separated values) File": "Export to CSV (Comma-separated values) File",
|
||||
"Export to TSV (Tab-separated values) File": "Export to TSV (Tab-separated values) File",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "Markdown File",
|
||||
"Clear User Data": "Clear User Data",
|
||||
"Clear All Transactions": "Clear All Transactions",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (Semicolon-separated values) File",
|
||||
"Export to CSV (Comma-separated values) File": "Exportar a archivo CSV (Valores Separados por Comas)",
|
||||
"Export to TSV (Tab-separated values) File": "Exportar a archivo TSV (Valores Separados por Tabulaciones)",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "Archivo Markdown",
|
||||
"Clear User Data": "Borrar Datos de Usuario",
|
||||
"Clear All Transactions": "Eliminar Todas las Transacciones",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (Semicolon-separated values) File",
|
||||
"Export to CSV (Comma-separated values) File": "Exporter vers un fichier CSV (valeurs séparées par virgules)",
|
||||
"Export to TSV (Tab-separated values) File": "Exporter vers un fichier TSV (valeurs séparées par tabulations)",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "Fichier Markdown",
|
||||
"Clear User Data": "Effacer les données utilisateur",
|
||||
"Clear All Transactions": "Effacer toutes les transactions",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (Semicolon-separated values) File",
|
||||
"Export to CSV (Comma-separated values) File": "Export to CSV (Comma-separated values) File",
|
||||
"Export to TSV (Tab-separated values) File": "Export to TSV (Tab-separated values) File",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "Markdown File",
|
||||
"Clear User Data": "Cancella dati utente",
|
||||
"Clear All Transactions": "Clear All Transactions",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (Semicolon-separated values) File",
|
||||
"Export to CSV (Comma-separated values) File": "Export to CSV (Comma-separated values) File",
|
||||
"Export to TSV (Tab-separated values) File": "Export to TSV (Tab-separated values) File",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "Markdown File",
|
||||
"Clear User Data": "ユーザーデータをクリア",
|
||||
"Clear All Transactions": "Clear All Transactions",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (Semicolon-separated values) File",
|
||||
"Export to CSV (Comma-separated values) File": "CSV (ಕಾಮಾ-ಪ್ರತ್ಯೇಕಿತ ಮೌಲ್ಯಗಳು) ಫೈಲ್ಗೆ ರಫ್ತು ಮಾಡಿ",
|
||||
"Export to TSV (Tab-separated values) File": "TSV (ಟ್ಯಾಬ್-ಪ್ರತ್ಯೇಕಿತ ಮೌಲ್ಯಗಳು) ಫೈಲ್ಗೆ ರಫ್ತು ಮಾಡಿ",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "Markdown ಫೈಲ್",
|
||||
"Clear User Data": "ಬಳಕೆದಾರ ಡೇಟಾ ತೆರವುಗೊಳಿಸಿ",
|
||||
"Clear All Transactions": "ಎಲ್ಲಾ ವಹಿವಾಟುಗಳನ್ನು ತೆರವುಗೊಳಿಸಿ",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (세미콜론으로 구분된 값) 파일",
|
||||
"Export to CSV (Comma-separated values) File": "CSV (쉼표로 구분된 값) 파일로 내보내기",
|
||||
"Export to TSV (Tab-separated values) File": "TSV (탭으로 구분된 값) 파일로 내보내기",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "Markdown 파일",
|
||||
"Clear User Data": "사용자 데이터 지우기",
|
||||
"Clear All Transactions": "모든 거래 지우기",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (Semicolon-separated values) File",
|
||||
"Export to CSV (Comma-separated values) File": "Exporteren naar CSV-bestand (komma-gescheiden waarden)",
|
||||
"Export to TSV (Tab-separated values) File": "Exporteren naar TSV-bestand (tab-gescheiden waarden)",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "Markdown-bestand",
|
||||
"Clear User Data": "Gebruikersgegevens wissen",
|
||||
"Clear All Transactions": "Clear All Transactions",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (Semicolon-separated values) File",
|
||||
"Export to CSV (Comma-separated values) File": "Export to CSV (Comma-separated values) File",
|
||||
"Export to TSV (Tab-separated values) File": "Export to TSV (Tab-separated values) File",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "Arquivo Markdown",
|
||||
"Clear User Data": "Limpar Dados do Usuário",
|
||||
"Clear All Transactions": "Clear All Transactions",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (Значения, разделенные точкой с запятой) File",
|
||||
"Export to CSV (Comma-separated values) File": "Экспорт в файл CSV (значения, разделенные запятыми)",
|
||||
"Export to TSV (Tab-separated values) File": "Экспорт в файл TSV (значения, разделенные табуляцией)",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "Файл Markdown",
|
||||
"Clear User Data": "Очистить данные пользователя",
|
||||
"Clear All Transactions": "Отчистить все транзакции",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (Semicolon-separated values) File",
|
||||
"Export to CSV (Comma-separated values) File": "Izvozi v CSV datoteko",
|
||||
"Export to TSV (Tab-separated values) File": "Izvozi v TSV datoteko",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "Markdown datoteka",
|
||||
"Clear User Data": "Počisti uporabniške podatke",
|
||||
"Clear All Transactions": "Počisti vse transakcije",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (Semicolon-separated values) File",
|
||||
"Export to CSV (Comma-separated values) File": "CSV (காற்புள்ளி-தனிப்பட்ட மதிப்புகள்) கோப்புக்கு ஏற்றுமதி செய்",
|
||||
"Export to TSV (Tab-separated values) File": "TSV (தாவல்-தனிப்பட்ட மதிப்புகள்) கோப்புக்கு ஏற்றுமதி செய்",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "Markdown கோப்பு",
|
||||
"Clear User Data": "பயனர் தரவை அழி",
|
||||
"Clear All Transactions": "அனைத்தும் பரிவர்த்தனைகளை அழி",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (Semicolon-separated values) File",
|
||||
"Export to CSV (Comma-separated values) File": "ส่งออกเป็นไฟล์ CSV (คั่นด้วยเครื่องหมายจุลภาค)",
|
||||
"Export to TSV (Tab-separated values) File": "ส่งออกเป็นไฟล์ TSV (คั่นด้วยแท็บ)",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "ไฟล์ Markdown",
|
||||
"Clear User Data": "ลบข้อมูลผู้ใช้",
|
||||
"Clear All Transactions": "ลบรายการทั้งหมด",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (Semicolon-separated values) File",
|
||||
"Export to CSV (Comma-separated values) File": "CSV (Virgülle ayrılmış değerler) Dosyasına Dışa Aktar",
|
||||
"Export to TSV (Tab-separated values) File": "TSV (Sekmeyle ayrılmış değerler) Dosyasına Dışa Aktar",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "Markdown Dosyası",
|
||||
"Clear User Data": "Kullanıcı Verilerini Temizle",
|
||||
"Clear All Transactions": "Tüm İşlemleri Temizle",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (Semicolon-separated values) File",
|
||||
"Export to CSV (Comma-separated values) File": "Export to CSV (Comma-separated values) File",
|
||||
"Export to TSV (Tab-separated values) File": "Export to TSV (Tab-separated values) File",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "Markdown File",
|
||||
"Clear User Data": "Очистити дані користувача",
|
||||
"Clear All Transactions": "Clear All Transactions",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (Semicolon-separated values) File",
|
||||
"Export to CSV (Comma-separated values) File": "Export to CSV (Comma-separated values) File",
|
||||
"Export to TSV (Tab-separated values) File": "Export to TSV (Tab-separated values) File",
|
||||
"Export to SSV (Semicolon-separated values) File": "Export to SSV (Semicolon-separated values) File",
|
||||
"Markdown File": "Markdown File",
|
||||
"Clear User Data": "Xóa dữ liệu người dùng",
|
||||
"Clear All Transactions": "Clear All Transactions",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (分号分隔的值) 文件",
|
||||
"Export to CSV (Comma-separated values) File": "导出到 CSV (逗号分隔的值) 文件",
|
||||
"Export to TSV (Tab-separated values) File": "导出到 TSV (制表符分隔的值) 文件",
|
||||
"Export to SSV (Semicolon-separated values) File": "导出到 SSV (分号分隔的值) 文件",
|
||||
"Markdown File": "Markdown 文件",
|
||||
"Clear User Data": "清除用户数据",
|
||||
"Clear All Transactions": "清除所有交易",
|
||||
|
||||
@@ -2298,6 +2298,7 @@
|
||||
"SSV (Semicolon-separated values) File": "SSV (分號分隔的值) 檔案",
|
||||
"Export to CSV (Comma-separated values) File": "匯出為 CSV (逗號分隔的值) 檔案",
|
||||
"Export to TSV (Tab-separated values) File": "匯出為 TSV (定位點分隔的值) 檔案",
|
||||
"Export to SSV (Semicolon-separated values) File": "匯出為 SSV (分號分隔的值) 檔案",
|
||||
"Markdown File": "Markdown 檔案",
|
||||
"Clear User Data": "清除使用者資料",
|
||||
"Clear All Transactions": "清除所有交易",
|
||||
|
||||
@@ -234,6 +234,8 @@ export function useReconciliationStatementPageBase() {
|
||||
|
||||
if (fileType === KnownFileType.TSV) {
|
||||
separator = '\t';
|
||||
} else if (fileType === KnownFileType.SSV) {
|
||||
separator = ';';
|
||||
}
|
||||
|
||||
const accountBalanceName = isCurrentLiabilityAccount.value ? 'Account Outstanding Balance' : 'Account Balance';
|
||||
@@ -252,9 +254,9 @@ export function useReconciliationStatementPageBase() {
|
||||
const rows = transactions.map(transaction => {
|
||||
const transactionTime = parseDateTimeFromUnixTimeWithTimezoneOffset(transaction.time, transaction.utcOffset);
|
||||
const type = getDisplayTransactionType(transaction);
|
||||
let categoryName = transaction.categoryName;
|
||||
let categoryName = replaceAll(transaction.categoryName, separator, ' ');
|
||||
let displayAmount = formatAmountToWesternArabicNumeralsWithoutDigitGrouping(transaction.sourceAmount);
|
||||
let displayAccountName = transaction.sourceAccountName;
|
||||
let displayAccountName = replaceAll(transaction.sourceAccountName, separator, ' ');
|
||||
|
||||
if (transaction.type === TransactionType.ModifyBalance) {
|
||||
categoryName = tt('Modify Balance');
|
||||
@@ -263,7 +265,7 @@ export function useReconciliationStatementPageBase() {
|
||||
}
|
||||
|
||||
if (transaction.type === TransactionType.Transfer && transaction.destinationAccount) {
|
||||
displayAccountName = displayAccountName + ' → ' + (transaction.destinationAccount?.name || '');
|
||||
displayAccountName = replaceAll(displayAccountName + ' → ' + (transaction.destinationAccount?.name || ''), separator, ' ');
|
||||
}
|
||||
|
||||
let displayAccountBalance = '';
|
||||
|
||||
@@ -77,6 +77,11 @@
|
||||
@click="exportReconciliationStatements(KnownFileType.TSV)">
|
||||
<v-list-item-title>{{ tt('Export to TSV (Tab-separated values) File') }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item :prepend-icon="extendMdiSemicolon"
|
||||
:disabled="!reconciliationStatements || !reconciliationStatements.transactions || reconciliationStatements.transactions.length < 1"
|
||||
@click="exportReconciliationStatements(KnownFileType.SSV)">
|
||||
<v-list-item-title>{{ tt('Export to SSV (Semicolon-separated values) File') }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-btn>
|
||||
@@ -301,6 +306,9 @@ import { isEquals } from '@/lib/common.ts';
|
||||
import { getCurrentUnixTime } from '@/lib/datetime.ts';
|
||||
import { startDownloadFile } from '@/lib/ui/common.ts';
|
||||
|
||||
import {
|
||||
extendMdiSemicolon
|
||||
} from '@/icons/desktop/extend_mdi_icons.ts';
|
||||
import {
|
||||
mdiRefresh,
|
||||
mdiArrowRight,
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
:append-icon="fileFormat === KnownFileType.TSV.extension ? mdiCheck : undefined"
|
||||
:title="tt('TSV (Tab-separated values) File')"
|
||||
@click="fileFormat = KnownFileType.TSV.extension"></v-list-item>
|
||||
<v-list-item :prepend-icon="extendMdiSemicolon"
|
||||
:append-icon="fileFormat === KnownFileType.SSV.extension ? mdiCheck : undefined"
|
||||
:title="tt('SSV (Semicolon-separated values) File')"
|
||||
@click="fileFormat = KnownFileType.SSV.extension"></v-list-item>
|
||||
<v-list-item :prepend-icon="mdiLanguageMarkdownOutline"
|
||||
:append-icon="fileFormat === KnownFileType.MARKDOWN.extension ? mdiCheck : undefined"
|
||||
:title="tt('Markdown File')"
|
||||
@@ -91,6 +95,9 @@ import { KnownFileType } from '@/core/file.ts';
|
||||
import { replaceAll } from '@/lib/common.ts';
|
||||
import { copyTextToClipboard, startDownloadFile } from '@/lib/ui/common.ts';
|
||||
|
||||
import {
|
||||
extendMdiSemicolon
|
||||
} from '@/icons/desktop/extend_mdi_icons.ts';
|
||||
import {
|
||||
mdiDotsVertical,
|
||||
mdiCheck,
|
||||
@@ -152,11 +159,13 @@ const dataTableItems = computed<object[]>(() => {
|
||||
const exportedData = computed<string>(() => {
|
||||
let ret = '';
|
||||
|
||||
if (fileFormat.value === KnownFileType.CSV.extension || fileFormat.value === KnownFileType.TSV.extension) {
|
||||
if (fileFormat.value === KnownFileType.CSV.extension || fileFormat.value === KnownFileType.TSV.extension || fileFormat.value === KnownFileType.SSV.extension) {
|
||||
let separator = ',';
|
||||
|
||||
if (fileFormat.value === KnownFileType.TSV.extension) {
|
||||
separator = '\t';
|
||||
} else if (fileFormat.value === KnownFileType.SSV.extension) {
|
||||
separator = ';';
|
||||
}
|
||||
|
||||
if (headers.value.length > 0) {
|
||||
|
||||
@@ -449,6 +449,9 @@ import {
|
||||
} from '@/lib/category.ts';
|
||||
import { startDownloadFile } from '@/lib/ui/common.ts';
|
||||
|
||||
import {
|
||||
extendMdiSemicolon
|
||||
} from '@/icons/desktop/extend_mdi_icons.ts';
|
||||
import {
|
||||
mdiCheck,
|
||||
mdiArrowRight,
|
||||
@@ -956,6 +959,12 @@ const toolMenus = computed<ImportTransactionCheckDataMenu[]>(() => [
|
||||
title: tt('Export to TSV (Tab-separated values) File'),
|
||||
disabled: isEditing.value || selectedImportTransactionCount.value < 1,
|
||||
onClick: () => exportData(KnownFileType.TSV)
|
||||
},
|
||||
{
|
||||
prependIcon: extendMdiSemicolon,
|
||||
title: tt('Export to SSV (Semicolon-separated values) File'),
|
||||
disabled: isEditing.value || selectedImportTransactionCount.value < 1,
|
||||
onClick: () => exportData(KnownFileType.SSV)
|
||||
}
|
||||
]);
|
||||
|
||||
@@ -2147,9 +2156,13 @@ function exportData(fileType: KnownFileType): void {
|
||||
}
|
||||
|
||||
let separator = ',';
|
||||
let tagSeparator = ';';
|
||||
|
||||
if (fileType === KnownFileType.TSV) {
|
||||
separator = '\t';
|
||||
} else if (fileType === KnownFileType.SSV) {
|
||||
separator = ';';
|
||||
tagSeparator = ',';
|
||||
}
|
||||
|
||||
const header = [
|
||||
@@ -2203,7 +2216,7 @@ function exportData(fileType: KnownFileType): void {
|
||||
|
||||
if (tagName) {
|
||||
tagName = replaceAll(tagName, separator, ' ');
|
||||
tagName = replaceAll(tagName, ';', ' ');
|
||||
tagName = replaceAll(tagName, tagSeparator, ' ');
|
||||
tagNames.push(tagName);
|
||||
}
|
||||
}
|
||||
@@ -2221,7 +2234,7 @@ function exportData(fileType: KnownFileType): void {
|
||||
relatedAccountCurrency ?? '',
|
||||
relatedAmount ?? '',
|
||||
geographicLocation,
|
||||
tagNames.join(';'),
|
||||
tagNames.join(tagSeparator),
|
||||
replaceAll(transaction.comment || '', separator, ' ')
|
||||
].join(separator);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user