fix:홈택스 분개수정 모달 금액 입력에 콤마 포맷 적용
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2020,6 +2020,8 @@ className={`px-3 py-1.5 text-xs cursor-pointer ${
|
||||
// ============================================
|
||||
const JournalEntryModal = ({ isOpen, onClose, onSave, onDelete, invoice, accountCodes = [] }) => {
|
||||
const formatCurrency = (val) => new Intl.NumberFormat('ko-KR').format(val || 0);
|
||||
const formatAmountInput = (val) => { const n = String(val).replace(/[^\d]/g, ''); return n ? Number(n).toLocaleString() : ''; };
|
||||
const parseAmountInput = (val) => parseInt(String(val).replace(/[^\d]/g, ''), 10) || 0;
|
||||
const isSales = invoice.invoiceType === 'sales' || invoice.invoice_type === 'sales';
|
||||
const supplyAmount = parseFloat(invoice.supplyAmount || invoice.supply_amount || 0);
|
||||
const taxAmount = parseFloat(invoice.taxAmount || invoice.tax_amount || 0);
|
||||
@@ -2178,17 +2180,17 @@ className={`px-2 py-0.5 rounded text-xs font-medium cursor-pointer hover:opacity
|
||||
</td>
|
||||
<td className="px-3 py-2">
|
||||
<input
|
||||
type="number"
|
||||
value={line.debit_amount}
|
||||
onChange={(e) => updateLine(idx, 'debit_amount', parseFloat(e.target.value) || 0)}
|
||||
type="text"
|
||||
value={formatAmountInput(line.debit_amount)}
|
||||
onChange={(e) => updateLine(idx, 'debit_amount', parseAmountInput(e.target.value))}
|
||||
className="w-full px-2 py-1 border border-stone-200 rounded text-sm text-right focus:ring-1 focus:ring-violet-500 outline-none"
|
||||
/>
|
||||
</td>
|
||||
<td className="px-3 py-2">
|
||||
<input
|
||||
type="number"
|
||||
value={line.credit_amount}
|
||||
onChange={(e) => updateLine(idx, 'credit_amount', parseFloat(e.target.value) || 0)}
|
||||
type="text"
|
||||
value={formatAmountInput(line.credit_amount)}
|
||||
onChange={(e) => updateLine(idx, 'credit_amount', parseAmountInput(e.target.value))}
|
||||
className="w-full px-2 py-1 border border-stone-200 rounded text-sm text-right focus:ring-1 focus:ring-violet-500 outline-none"
|
||||
/>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user