feat:전자세금계산서 공급자 기초정보 설정 모달 구현
- EtaxController에 getSupplier/updateSupplier 메서드 추가 - etax 라우트 그룹에 GET/POST /supplier 라우트 추가 - SupplierSettingsModal React 컴포넌트 구현 (톱니바퀴 아이콘) - IssueForm이 supplier state를 props로 참조하도록 변경 - manager_phone → manager_hp 필드명 버그 수정 - FIXED_SUPPLIER → INITIAL_SUPPLIER 상수 리네이밍 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -339,6 +339,82 @@ public function sendToNts(Request $request): JsonResponse
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 공급자 기초정보 조회
|
||||
*/
|
||||
public function getSupplier(): JsonResponse
|
||||
{
|
||||
$tenantId = session('selected_tenant_id');
|
||||
if (!$tenantId) {
|
||||
return response()->json(['success' => false, 'error' => '테넌트가 선택되지 않았습니다.'], 400);
|
||||
}
|
||||
|
||||
$member = BarobillMember::where('tenant_id', $tenantId)->first();
|
||||
if (!$member) {
|
||||
return response()->json(['success' => false, 'error' => '바로빌 회원사 정보가 없습니다.'], 404);
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'supplier' => [
|
||||
'bizno' => $member->biz_no,
|
||||
'name' => $member->corp_name ?? '',
|
||||
'ceo' => $member->ceo_name ?? '',
|
||||
'addr' => $member->addr ?? '',
|
||||
'bizType' => $member->biz_type ?? '',
|
||||
'bizClass' => $member->biz_class ?? '',
|
||||
'contact' => $member->manager_name ?? '',
|
||||
'contactPhone' => $member->manager_hp ?? '',
|
||||
'email' => $member->manager_email ?? '',
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 공급자 기초정보 수정
|
||||
*/
|
||||
public function updateSupplier(Request $request): JsonResponse
|
||||
{
|
||||
$tenantId = session('selected_tenant_id');
|
||||
if (!$tenantId) {
|
||||
return response()->json(['success' => false, 'error' => '테넌트가 선택되지 않았습니다.'], 400);
|
||||
}
|
||||
|
||||
$member = BarobillMember::where('tenant_id', $tenantId)->first();
|
||||
if (!$member) {
|
||||
return response()->json(['success' => false, 'error' => '바로빌 회원사 정보가 없습니다.'], 404);
|
||||
}
|
||||
|
||||
$validated = $request->validate([
|
||||
'corp_name' => 'required|string|max:100',
|
||||
'ceo_name' => 'required|string|max:50',
|
||||
'addr' => 'nullable|string|max:255',
|
||||
'biz_type' => 'nullable|string|max:100',
|
||||
'biz_class' => 'nullable|string|max:100',
|
||||
'manager_name' => 'nullable|string|max:50',
|
||||
'manager_email' => 'nullable|email|max:100',
|
||||
'manager_hp' => 'nullable|string|max:20',
|
||||
]);
|
||||
|
||||
$member->update($validated);
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => '공급자 정보가 수정되었습니다.',
|
||||
'supplier' => [
|
||||
'bizno' => $member->biz_no,
|
||||
'name' => $member->corp_name ?? '',
|
||||
'ceo' => $member->ceo_name ?? '',
|
||||
'addr' => $member->addr ?? '',
|
||||
'bizType' => $member->biz_type ?? '',
|
||||
'bizClass' => $member->biz_class ?? '',
|
||||
'contact' => $member->manager_name ?? '',
|
||||
'contactPhone' => $member->manager_hp ?? '',
|
||||
'email' => $member->manager_email ?? '',
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 세금계산서 삭제
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user