fix(accounting): Banana export is now a tab-separated .txt (actually importable)

Banana's "Text file with column headers" import (Actions → Import into
accounting) requires a TAB-separated .txt with unquoted values — picpeak was
emitting a comma-separated, quoted .csv, which won't even show in Banana's
*.txt file picker, let alone parse into columns.

- ledgerService.exportPostings: the `banana` format now serialises TAB-separated
  with no quoting, .txt extension, text/plain content-type. generic + bexio stay
  comma-CSV (RFC 4180). Tab/newline chars in a cell are collapsed to spaces.
- Frontend ledger.service: download filename uses .txt for banana.
- Tests updated for the new banana shape (tab header, .txt, text/plain).

The column names already matched Banana's NameXml; only the serialisation was
wrong. bexio left as comma-CSV (verify against bexio's import spec separately).
This commit is contained in:
Luca
2026-06-15 22:28:10 +02:00
parent b584aaf7a6
commit a19506749a
3 changed files with 32 additions and 10 deletions
+4 -1
View File
@@ -92,7 +92,10 @@ export const ledgerService = {
const usp = new URLSearchParams({ from: params.from, to: params.to, currency: params.currency, format: params.format });
const res = await api.get(`/admin/ledger/export?${usp.toString()}`, { responseType: 'blob' });
const url = URL.createObjectURL(res.data);
const filename = `journal_${params.from}_to_${params.to}_${params.currency}_${params.format}.csv`;
// Banana wants a tab-separated .txt (its "Text file with column headers"
// import); generic / bexio stay .csv. Matches the backend's extension.
const ext = params.format === 'banana' ? 'txt' : 'csv';
const filename = `journal_${params.from}_to_${params.to}_${params.currency}_${params.format}.${ext}`;
return { url, filename };
},
};