Initial build: SimpleScan Solo v0.1.0 - Freelancer receipt capture Chrome extension

This commit is contained in:
Bun Bun
2026-06-16 18:27:31 +00:00
commit df4d26c049
33 changed files with 3962 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
import { getCategoryLabel } from './categories.js';
export function exportToCsv(receipts) {
const headers = ['Date', 'Vendor', 'Title', 'Category', 'Amount', 'Currency', 'Notes', 'Source'];
const rows = receipts.map((r) => [
r.date,
r.vendor,
r.title,
getCategoryLabel(r.category),
r.amount.toFixed(2),
r.currency,
r.notes,
r.source,
]);
const csv = [headers, ...rows]
.map((row) => row
.map((cell) => {
const str = String(cell).replace(/"/g, '""');
return `"${str}"`;
})
.join(','))
.join('\n');
return csv;
}
export function downloadBlob(content, filename, mimeType) {
const blob = new Blob([content], { type: mimeType });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
a.click();
URL.revokeObjectURL(url);
}