fix:부가세 예정 세액 계산 실패 시 방어 처리 (try-catch)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-11 11:35:39 +09:00
parent bc43479d00
commit 3241eee0de

View File

@@ -268,8 +268,13 @@ public function index(Request $request): JsonResponse
// 확정(C) 기간이면 대응하는 예정(P)의 netVat를 계산
if ($period && str_ends_with($period, 'C')) {
$prelimPeriod = substr($period, 0, -1) . 'P';
$stats['preliminaryVat'] = $this->calculatePeriodNetVat($tenantId, $prelimPeriod);
try {
$prelimPeriod = substr($period, 0, -1) . 'P';
$stats['preliminaryVat'] = $this->calculatePeriodNetVat($tenantId, $prelimPeriod);
} catch (\Throwable $e) {
\Log::warning('예정 세액 계산 실패: ' . $e->getMessage());
$stats['preliminaryVat'] = null;
}
}
// 사용 중인 기간 목록