fix:홈택스 분개 차/대 토글 기능 추가 및 저장 오류 수정
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1677,13 +1677,22 @@ public function createJournalEntry(Request $request): JsonResponse
|
||||
'message' => "전표 {$result->entry_no}가 생성되었습니다.",
|
||||
'data' => $result->load('lines'),
|
||||
]);
|
||||
} catch (\Illuminate\Validation\ValidationException $e) {
|
||||
$errors = $e->errors();
|
||||
$firstError = collect($errors)->flatten()->first() ?? '입력 데이터가 올바르지 않습니다.';
|
||||
Log::error('분개 생성 검증 오류', ['errors' => $errors]);
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'error' => $firstError,
|
||||
'errors' => $errors,
|
||||
], 422);
|
||||
} catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'error' => '해당 세금계산서를 찾을 수 없습니다.',
|
||||
], 404);
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('분개 생성 오류: ' . $e->getMessage());
|
||||
Log::error('분개 생성 오류: ' . $e->getMessage(), ['trace' => $e->getTraceAsString()]);
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'error' => '분개 생성 오류: ' . $e->getMessage(),
|
||||
|
||||
Reference in New Issue
Block a user