applyParsed 가 TRANSFER 처리: type=이체, 분류 비움, wallet→출금(walletId)/toWallet→입금(toWalletId) 매칭. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -825,13 +825,14 @@ const pasteText = ref('')
|
||||
const pasteError = ref('')
|
||||
function applyParsed(p) {
|
||||
if (!p || !p.recognized) return
|
||||
form.type = p.type === 'INCOME' ? 'INCOME' : 'EXPENSE'
|
||||
const transfer = p.type === 'TRANSFER'
|
||||
form.type = p.type === 'INCOME' ? 'INCOME' : transfer ? 'TRANSFER' : 'EXPENSE'
|
||||
if (p.amount) form.amount = Number(p.amount)
|
||||
if (p.merchant) form.memo = p.merchant
|
||||
if (p.date) form.entryDate = p.date
|
||||
// AI 추천 분류(후보 목록 중에서 선택된 값). 없으면 사용자가 직접 선택
|
||||
form.category = p.category || ''
|
||||
// AI 추천 결제수단(계좌) — 이름으로 실제 계좌를 찾아 종류·계좌 자동 선택
|
||||
// 이체는 분류 없음. 그 외엔 AI 추천 분류(후보 중). 없으면 사용자가 선택
|
||||
form.category = transfer ? '' : p.category || ''
|
||||
// AI 추천 계좌 매칭 — 지출/수입=결제수단(walletId), 이체=보내는(walletId)/받는(toWalletId) 계좌
|
||||
if (p.wallet) {
|
||||
const w = wallets.value.find((x) => x.name === p.wallet)
|
||||
if (w) {
|
||||
@@ -839,6 +840,13 @@ function applyParsed(p) {
|
||||
form.walletId = w.id
|
||||
}
|
||||
}
|
||||
if (transfer && p.toWallet) {
|
||||
const tw = wallets.value.find((x) => x.name === p.toWallet)
|
||||
if (tw) {
|
||||
form.toWalletKind = tw.type
|
||||
form.toWalletId = tw.id
|
||||
}
|
||||
}
|
||||
pasteDetected.value = null
|
||||
pasteModalOpen.value = false
|
||||
pasteText.value = ''
|
||||
|
||||
Reference in New Issue
Block a user