- 내보내기: 계좌 시트 ID 컬럼, 내역/고정지출/자주내역에 계좌ID·입금계좌ID - 가져오기: 계좌ID 기준 파싱 (이름 충돌 무관 정확 복구) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+9
-9
@@ -55,11 +55,11 @@ export async function exportBackup() {
|
|||||||
|
|
||||||
add('내역', entries.map((e) => ({
|
add('내역', entries.map((e) => ({
|
||||||
날짜: e.entryDate, 구분: e.type, 분류: e.category, 금액: e.amount, 메모: e.memo,
|
날짜: e.entryDate, 구분: e.type, 분류: e.category, 금액: e.amount, 메모: e.memo,
|
||||||
계좌: e.walletName, 입금계좌: e.toWalletName, 할부개월: e.installmentMonths,
|
계좌: e.walletName, 계좌ID: e.walletId, 입금계좌: e.toWalletName, 입금계좌ID: e.toWalletId,
|
||||||
태그: (e.tags || []).join(','),
|
할부개월: e.installmentMonths, 태그: (e.tags || []).join(','),
|
||||||
})))
|
})))
|
||||||
add('계좌', wallets.map((w) => ({
|
add('계좌', wallets.map((w) => ({
|
||||||
종류: w.type, 이름: w.name, '은행/카드사': w.issuer, 계좌번호: w.accountNumber,
|
ID: w.id, 종류: w.type, 이름: w.name, '은행/카드사': w.issuer, 계좌번호: w.accountNumber,
|
||||||
카드유형: w.cardType, 개시잔액: w.openingBalance, 개시일: w.openingDate, '평가액(수동)': w.currentValue,
|
카드유형: w.cardType, 개시잔액: w.openingBalance, 개시일: w.openingDate, '평가액(수동)': w.currentValue,
|
||||||
})))
|
})))
|
||||||
add('분류', categories.map((c) => ({
|
add('분류', categories.map((c) => ({
|
||||||
@@ -67,7 +67,7 @@ export async function exportBackup() {
|
|||||||
})))
|
})))
|
||||||
add('고정지출', recurrings.map((r) => ({
|
add('고정지출', recurrings.map((r) => ({
|
||||||
제목: r.title, 구분: r.type, 금액: r.amount, 분류: r.category, 메모: r.memo,
|
제목: r.title, 구분: r.type, 금액: r.amount, 분류: r.category, 메모: r.memo,
|
||||||
계좌: r.walletName, 입금계좌: r.toWalletName, 주기: r.frequency,
|
계좌: r.walletName, 계좌ID: r.walletId, 입금계좌: r.toWalletName, 입금계좌ID: r.toWalletId, 주기: r.frequency,
|
||||||
일: r.dayOfMonth, 요일: r.dayOfWeek, 월: r.monthOfYear,
|
일: r.dayOfMonth, 요일: r.dayOfWeek, 월: r.monthOfYear,
|
||||||
시작일: r.startDate, 종료일: r.endDate, 활성: r.active,
|
시작일: r.startDate, 종료일: r.endDate, 활성: r.active,
|
||||||
})))
|
})))
|
||||||
@@ -77,7 +77,7 @@ export async function exportBackup() {
|
|||||||
})))
|
})))
|
||||||
add('태그', tags.map((t) => ({ 이름: t.name })))
|
add('태그', tags.map((t) => ({ 이름: t.name })))
|
||||||
add('자주쓰는내역', quick.map((q) => ({
|
add('자주쓰는내역', quick.map((q) => ({
|
||||||
라벨: q.label, 구분: q.type, 분류: q.category, 금액: q.amount, 메모: q.memo, 계좌: q.walletName,
|
라벨: q.label, 구분: q.type, 분류: q.category, 금액: q.amount, 메모: q.memo, 계좌: q.walletName, 계좌ID: q.walletId,
|
||||||
})))
|
})))
|
||||||
|
|
||||||
await saveWorkbook(XLSX, wb, fileName())
|
await saveWorkbook(XLSX, wb, fileName())
|
||||||
@@ -108,7 +108,7 @@ export async function importBackup(file) {
|
|||||||
const payload = {
|
const payload = {
|
||||||
wallets: rows('계좌')
|
wallets: rows('계좌')
|
||||||
.map((r) => ({
|
.map((r) => ({
|
||||||
type: str(r['종류']), name: str(r['이름']), issuer: str(r['은행/카드사']),
|
oldId: num(r['ID']), type: str(r['종류']), name: str(r['이름']), issuer: str(r['은행/카드사']),
|
||||||
accountNumber: str(r['계좌번호']), cardType: str(r['카드유형']),
|
accountNumber: str(r['계좌번호']), cardType: str(r['카드유형']),
|
||||||
openingBalance: num(r['개시잔액']), openingDate: date(r['개시일']), currentValue: num(r['평가액(수동)']),
|
openingBalance: num(r['개시잔액']), openingDate: date(r['개시일']), currentValue: num(r['평가액(수동)']),
|
||||||
}))
|
}))
|
||||||
@@ -120,7 +120,7 @@ export async function importBackup(file) {
|
|||||||
entries: rows('내역')
|
entries: rows('내역')
|
||||||
.map((r) => ({
|
.map((r) => ({
|
||||||
entryDate: date(r['날짜']), type: str(r['구분']), category: str(r['분류']),
|
entryDate: date(r['날짜']), type: str(r['구분']), category: str(r['분류']),
|
||||||
amount: num(r['금액']), memo: str(r['메모']), wallet: str(r['계좌']), toWallet: str(r['입금계좌']),
|
amount: num(r['금액']), memo: str(r['메모']), walletId: num(r['계좌ID']), toWalletId: num(r['입금계좌ID']),
|
||||||
installmentMonths: num(r['할부개월']),
|
installmentMonths: num(r['할부개월']),
|
||||||
tags: str(r['태그']) ? String(r['태그']).split(',').map((s) => s.trim()).filter(Boolean) : [],
|
tags: str(r['태그']) ? String(r['태그']).split(',').map((s) => s.trim()).filter(Boolean) : [],
|
||||||
}))
|
}))
|
||||||
@@ -128,7 +128,7 @@ export async function importBackup(file) {
|
|||||||
recurrings: rows('고정지출')
|
recurrings: rows('고정지출')
|
||||||
.map((r) => ({
|
.map((r) => ({
|
||||||
title: str(r['제목']), type: str(r['구분']), amount: num(r['금액']), category: str(r['분류']), memo: str(r['메모']),
|
title: str(r['제목']), type: str(r['구분']), amount: num(r['금액']), category: str(r['분류']), memo: str(r['메모']),
|
||||||
wallet: str(r['계좌']), toWallet: str(r['입금계좌']), frequency: str(r['주기']),
|
walletId: num(r['계좌ID']), toWalletId: num(r['입금계좌ID']), frequency: str(r['주기']),
|
||||||
dayOfMonth: num(r['일']), dayOfWeek: num(r['요일']), monthOfYear: num(r['월']),
|
dayOfMonth: num(r['일']), dayOfWeek: num(r['요일']), monthOfYear: num(r['월']),
|
||||||
startDate: date(r['시작일']), endDate: date(r['종료일']), active: bool(r['활성']),
|
startDate: date(r['시작일']), endDate: date(r['종료일']), active: bool(r['활성']),
|
||||||
}))
|
}))
|
||||||
@@ -142,7 +142,7 @@ export async function importBackup(file) {
|
|||||||
quickEntries: rows('자주쓰는내역')
|
quickEntries: rows('자주쓰는내역')
|
||||||
.map((r) => ({
|
.map((r) => ({
|
||||||
label: str(r['라벨']), type: str(r['구분']), category: str(r['분류']),
|
label: str(r['라벨']), type: str(r['구분']), category: str(r['분류']),
|
||||||
amount: num(r['금액']), memo: str(r['메모']), wallet: str(r['계좌']),
|
amount: num(r['금액']), memo: str(r['메모']), walletId: num(r['계좌ID']),
|
||||||
}))
|
}))
|
||||||
.filter((q) => q.type),
|
.filter((q) => q.type),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user