fix:홈택스 수동입력 세액 필수 제거, 미입력시 0 처리

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-06 19:42:52 +09:00
parent f24287cafa
commit 3f2c8a013b

View File

@@ -1423,7 +1423,7 @@ public function manualStore(Request $request): JsonResponse
'invoicee_corp_name' => 'nullable|string|max:200',
'invoicee_corp_num' => 'nullable|string|max:20',
'supply_amount' => 'required|numeric|min:0',
'tax_amount' => 'required|numeric|min:0',
'tax_amount' => 'nullable|numeric|min:0',
'item_name' => 'nullable|string|max:200',
'remark' => 'nullable|string|max:500',
'tax_type' => 'nullable|integer|in:1,2,3',
@@ -1436,7 +1436,6 @@ public function manualStore(Request $request): JsonResponse
'supply_amount.required' => '공급가액은 필수입니다.',
'supply_amount.numeric' => '공급가액은 숫자여야 합니다.',
'supply_amount.min' => '공급가액은 0 이상이어야 합니다.',
'tax_amount.required' => '세액은 필수입니다.',
'tax_amount.numeric' => '세액은 숫자여야 합니다.',
'tax_amount.min' => '세액은 0 이상이어야 합니다.',
]);
@@ -1455,7 +1454,8 @@ public function manualStore(Request $request): JsonResponse
}
$ntsConfirmNum = sprintf('MAN-%s-%03d', $dateStr, $seq);
$totalAmount = (float)$validated['supply_amount'] + (float)$validated['tax_amount'];
$taxAmount = (float)($validated['tax_amount'] ?? 0);
$totalAmount = (float)$validated['supply_amount'] + $taxAmount;
$invoice = HometaxInvoice::create([
'tenant_id' => $tenantId,
@@ -1468,7 +1468,7 @@ public function manualStore(Request $request): JsonResponse
'invoicee_corp_name' => $validated['invoicee_corp_name'] ?? '',
'invoicee_corp_num' => $validated['invoicee_corp_num'] ?? '',
'supply_amount' => $validated['supply_amount'],
'tax_amount' => $validated['tax_amount'],
'tax_amount' => $taxAmount,
'total_amount' => $totalAmount,
'item_name' => $validated['item_name'] ?? '',
'remark' => $validated['remark'] ?? '',