fix:전자세금계산서 작성일자/전송일자 필드 수정

- 공급일자 → 작성일자로 명칭 변경
- 전송일자 컬럼 추가 (목록 및 상세 모달)
- sendToNts 메서드에서 sentAt 타임스탬프 기록

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
pro
2026-01-28 15:31:40 +09:00
parent 1682dd3d9e
commit 8ea2b7e754
2 changed files with 16 additions and 6 deletions

View File

@@ -255,6 +255,7 @@ public function sendToNts(Request $request): JsonResponse
if ($result['success']) {
$data['invoices'][$invoiceIndex]['status'] = 'sent';
$data['invoices'][$invoiceIndex]['ntsReceiptNo'] = 'NTS-' . date('YmdHis');
$data['invoices'][$invoiceIndex]['sentAt'] = date('Y-m-d');
file_put_contents($dataFile, json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
return response()->json([
@@ -271,6 +272,7 @@ public function sendToNts(Request $request): JsonResponse
// 시뮬레이션
$data['invoices'][$invoiceIndex]['status'] = 'sent';
$data['invoices'][$invoiceIndex]['ntsReceiptNo'] = 'NTS-SIM-' . date('YmdHis');
$data['invoices'][$invoiceIndex]['sentAt'] = date('Y-m-d');
file_put_contents($dataFile, json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
return response()->json([

View File

@@ -230,7 +230,7 @@
<input type="email" className="w-full rounded-lg border-stone-200 border p-3 focus:ring-2 focus:ring-blue-500 outline-none" value={formData.recipientEmail} onChange={(e) => setFormData({ ...formData, recipientEmail: e.target.value })} required />
</div>
<div>
<label className="block text-sm font-medium text-stone-700 mb-2">공급일자</label>
<label className="block text-sm font-medium text-stone-700 mb-2">작성일자</label>
<input type="date" className="w-full rounded-lg border-stone-200 border p-3 focus:ring-2 focus:ring-blue-500 outline-none" value={formData.supplyDate} onChange={(e) => setFormData({ ...formData, supplyDate: e.target.value })} required />
</div>
</div>
@@ -364,7 +364,8 @@ className="px-3 py-1.5 text-sm bg-stone-100 text-stone-600 rounded-lg hover:bg-s
<tr>
<th className="px-6 py-4 bg-stone-50">발행번호</th>
<th className="px-6 py-4 bg-stone-50">공급받는자</th>
<th className="px-6 py-4 bg-stone-50">공급일자</th>
<th className="px-6 py-4 bg-stone-50">작성일자</th>
<th className="px-6 py-4 bg-stone-50">전송일자</th>
<th className="px-6 py-4 bg-stone-50">공급가액</th>
<th className="px-6 py-4 bg-stone-50">부가세</th>
<th className="px-6 py-4 bg-stone-50">합계</th>
@@ -374,13 +375,14 @@ className="px-3 py-1.5 text-sm bg-stone-100 text-stone-600 rounded-lg hover:bg-s
</thead>
<tbody className="divide-y divide-stone-100">
{invoices.length === 0 ? (
<tr><td colSpan="8" className="px-6 py-8 text-center text-stone-400">해당 기간에 발행된 세금계산서가 없습니다.</td></tr>
<tr><td colSpan="9" className="px-6 py-8 text-center text-stone-400">해당 기간에 발행된 세금계산서가 없습니다.</td></tr>
) : (
invoices.map((invoice) => (
<tr key={invoice.id} className="hover:bg-stone-50 transition-colors cursor-pointer" onClick={() => onViewDetail(invoice)}>
<td className="px-6 py-4 font-medium text-stone-900">{invoice.issueKey || invoice.id}</td>
<td className="px-6 py-4">{invoice.recipientName}</td>
<td className="px-6 py-4">{formatDate(invoice.supplyDate)}</td>
<td className="px-6 py-4">{invoice.sentAt ? formatDate(invoice.sentAt) : <span className="text-stone-300">-</span>}</td>
<td className="px-6 py-4">{formatCurrency(invoice.totalSupplyAmt)}</td>
<td className="px-6 py-4">{formatCurrency(invoice.totalVat)}</td>
<td className="px-6 py-4 font-bold text-stone-900">{formatCurrency(invoice.total)}</td>
@@ -436,9 +438,15 @@ className="px-3 py-1.5 text-sm bg-stone-100 text-stone-600 rounded-lg hover:bg-s
<div className="text-sm text-stone-500">{invoice.recipientBizno}</div>
</div>
</div>
<div>
<label className="text-xs text-stone-500 mb-1 block">공급일자</label>
<div className="font-medium text-stone-900">{formatDate(invoice.supplyDate)}</div>
<div className="grid grid-cols-2 gap-4">
<div>
<label className="text-xs text-stone-500 mb-1 block">작성일자</label>
<div className="font-medium text-stone-900">{formatDate(invoice.supplyDate)}</div>
</div>
<div>
<label className="text-xs text-stone-500 mb-1 block">전송일자</label>
<div className="font-medium text-stone-900">{invoice.sentAt ? formatDate(invoice.sentAt) : <span className="text-stone-400">미전송</span>}</div>
</div>
</div>
<div>
<label className="text-xs text-stone-500 mb-2 block">품목 내역</label>