fix: 견적관리 공과 품목 API 파라미터 및 MES 기능 개선

- 공과 상세 셀렉트 박스 API 파라미터 수정 (type → item_type)
- VendorManagement 목록 컴포넌트 개선
- 작업지시/작업실적 타입 및 UI 개선
- 검사관리 actions 수정
This commit is contained in:
2026-01-15 08:52:40 +09:00
parent 6dc91daaca
commit 0f8f40fc7b
25 changed files with 720 additions and 77 deletions

BIN
.serena/.DS_Store vendored Normal file

Binary file not shown.

1
.serena/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/cache

View File

@@ -0,0 +1,81 @@
# 견적 등록/수정 FormField type="custom" 수정 작업
## 📅 작업일: 2026-01-06
## 🎯 문제 요약
견적 등록/수정 페이지에서 **수량(quantity) 변경이 총합계에 반영되지 않는 버그**
### 증상
- 수량 1 → 자동견적산출 → 합계 1,711,225원
- 수량 3으로 변경 → 자동견적산출 → 합계가 여전히 1,711,225원 (3배인 ~5,133,675원이어야 함)
## 🔍 근본 원인
**FormField 컴포넌트의 `type="custom"` 누락**
FormField 컴포넌트 (`src/components/molecules/FormField.tsx`)는 `type` prop에 따라 다르게 동작:
- `type="custom"` → children(자식 요소)을 렌더링
- 그 외 → 자체 내부 Input을 렌더링 (value/onChange 연결 안됨)
```tsx
// FormField.tsx 내부 renderInput() 함수
case 'custom':
return children; // ← children 렌더링
default:
return <Input value={value} onChange={...} /> // ← 자체 Input 렌더링 (value=undefined)
```
**결과**: `type="custom"` 없이 FormField 안에 Input을 넣으면, 해당 Input은 렌더링되지 않고 FormField 자체 Input이 렌더링됨 → state와 연결 끊김
## ✅ 수정 완료 (8개 FormField)
### 파일: `src/components/quotes/QuoteRegistration.tsx`
**기본정보 섹션** (3개):
1. 등록일 (line 581) - `type="custom"` 추가
2. 현장명 (line 627) - `type="custom"` 추가 (datalist 자동완성 포함)
3. 납기일 (line 662) - `type="custom"` 추가
**견적 항목 섹션** (5개):
4. 층수 (line 733) - `type="custom"` 추가
5. 부호 (line 744) - `type="custom"` 추가
6. **수량 (line 926)** - `type="custom"` 추가 ⭐ 핵심 버그 원인
7. 마구리 날개치수 (line 944) - `type="custom"` 추가
8. 검사비 (line 959) - `type="custom"` 추가
## 추가 수정사항
### 1. useMemo로 calculatedGrandTotal 추가 (line 194-201)
```tsx
const calculatedGrandTotal = useMemo(() => {
if (!calculationResults?.items) return 0;
return calculationResults.items.reduce((sum, itemResult) => {
const formItem = formData.items[itemResult.index];
return sum + (itemResult.result.grand_total * (formItem?.quantity || 1));
}, 0);
}, [calculationResults, formData.items]);
```
### 2. Toast 메시지 수정 (line 493-498)
`updatedItems` 사용하여 최신 상태 반영
### 3. Badge 및 하단 총합계
`calculatedGrandTotal` 사용 (line 1019, 1131)
## ⚠️ 남은 이슈
사용자가 "견적 산출 결과에는 왜 반영이 안되는거지?"라고 질문 → 확인 필요:
1. 수정된 코드로 테스트했는지 (브라우저 새로고침)
2. 수량 변경 후 즉시 반영되는지 vs 버튼 클릭 필요한지
3. 현재 코드에서 수량 변경 시 합계는 실시간 업데이트되어야 함 (useMemo + React 재렌더링)
## 📁 관련 파일
- `src/components/quotes/QuoteRegistration.tsx` - 메인 수정 파일
- `src/components/molecules/FormField.tsx` - FormField 컴포넌트 (참조)
- `src/app/[locale]/(protected)/sales/quote-management/[id]/edit/page.tsx` - 수정 페이지
## 🔑 핵심 교훈
**FormField에 커스텀 children(Input, Select, datalist 등)을 넣을 때는 반드시 `type="custom"` 필요!**
## 🚀 새 세션에서 이어서 작업하려면
1. 프로젝트 활성화: Serena `activate_project` → "react"
2. 메모리 읽기: `read_memory("quote-registration-formfield-fix.md")`
3. 확인 필요: 수량 변경 시 견적 산출 결과가 실시간으로 업데이트되는지 테스트

View File

@@ -0,0 +1,70 @@
# 채권현황 동적월 지원 및 year=0 파라미터 버그 수정
## 작업 일시
2026-01-02
## 문제 상황
"최근 1년" 필터가 제대로 동작하지 않는 3가지 버그:
1. 2026년 조회 후 "최근 1년" 선택 시 2026년 기준 데이터 표시
2. 2025년 조회 후 "최근 1년" 선택 시 2025년 기준 데이터 표시
3. 초기 페이지 로드 시 "최근 1년" 기본값인데 데이터 없음
## 원인 분석
### 프론트엔드 (이전 세션에서 수정됨)
- JavaScript에서 `year === 0` 체크가 falsy 값 문제로 제대로 동작하지 않음
- `if (year)` 같은 조건문에서 0이 false로 처리됨
### 백엔드 (이번 세션에서 수정)
- Laravel의 `'nullable|boolean'` 검증이 쿼리 파라미터로 전달된 문자열 "true"를 거부
- HTTP 쿼리 파라미터는 항상 문자열로 전달됨
## 수정 내용
### 1. ReceivablesController.php
```php
// 변경 전
'recent_year' => 'nullable|boolean',
// 변경 후
'recent_year' => 'nullable|string|in:true,false,1,0',
// 검증 후 boolean 변환
if (isset($params['recent_year'])) {
$params['recent_year'] = filter_var($params['recent_year'], FILTER_VALIDATE_BOOLEAN);
}
\Log::info('[Receivables] index params', $params);
```
### 2. actions.ts (이전 세션 수정, 검증됨)
```typescript
const yearValue = params?.year;
if (typeof yearValue === 'number') {
if (yearValue === 0) {
searchParams.set('recent_year', 'true');
} else {
searchParams.set('year', String(yearValue));
}
}
```
## 핵심 포인트
1. **명시적 타입 체크**: `typeof yearValue === 'number'`로 undefined와 0을 구분
2. **문자열 boolean 검증**: Laravel에서 `'in:true,false,1,0'` 사용 후 `filter_var()` 변환
3. **디버그 로깅**: 개발 중 파라미터 확인을 위한 로그 추가 (테스트 후 제거 필요)
## Git 커밋
- API: `4fa38e3` - feat(API): 채권현황 동적월 지원 및 year=0 파라미터 버그 수정
- React: `672b1b4` - feat(WEB): 채권현황 동적월 지원 및 year=0 파라미터 버그 수정
- React: `1f32b04` - docs: 채권현황 동적월 지원 작업 현황 업데이트
## 관련 파일
- `/api/app/Http/Controllers/Api/V1/ReceivablesController.php`
- `/api/app/Services/ReceivablesService.php`
- `/react/src/components/accounting/ReceivablesStatus/actions.ts`
- `/react/src/components/accounting/ReceivablesStatus/index.tsx`
## 후속 작업
- [ ] 테스트 완료 후 디버그 로그 제거
- [ ] 추가 UI 개선 (사용자 확인 필요)

84
.serena/project.yml Normal file
View File

@@ -0,0 +1,84 @@
# list of languages for which language servers are started; choose from:
# al bash clojure cpp csharp csharp_omnisharp
# dart elixir elm erlang fortran go
# haskell java julia kotlin lua markdown
# nix perl php python python_jedi r
# rego ruby ruby_solargraph rust scala swift
# terraform typescript typescript_vts yaml zig
# Note:
# - For C, use cpp
# - For JavaScript, use typescript
# Special requirements:
# - csharp: Requires the presence of a .sln file in the project folder.
# When using multiple languages, the first language server that supports a given file will be used for that file.
# The first language is the default language and the respective language server will be used as a fallback.
# Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored.
languages:
- typescript
# the encoding used by text files in the project
# For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings
encoding: "utf-8"
# whether to use the project's gitignore file to ignore files
# Added on 2025-04-07
ignore_all_files_in_gitignore: true
# list of additional paths to ignore
# same syntax as gitignore, so you can use * and **
# Was previously called `ignored_dirs`, please update your config if you are using that.
# Added (renamed) on 2025-04-07
ignored_paths: []
# whether the project is in read-only mode
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
# Added on 2025-04-18
read_only: false
# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
# Below is the complete list of tools for convenience.
# To make sure you have the latest list of tools, and to view their descriptions,
# execute `uv run scripts/print_tool_overview.py`.
#
# * `activate_project`: Activates a project by name.
# * `check_onboarding_performed`: Checks whether project onboarding was already performed.
# * `create_text_file`: Creates/overwrites a file in the project directory.
# * `delete_lines`: Deletes a range of lines within a file.
# * `delete_memory`: Deletes a memory from Serena's project-specific memory store.
# * `execute_shell_command`: Executes a shell command.
# * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced.
# * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type).
# * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type).
# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file.
# * `initial_instructions`: Gets the initial instructions for the current project.
# Should only be used in settings where the system prompt cannot be set,
# e.g. in clients you have no control over, like Claude Desktop.
# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
# * `insert_at_line`: Inserts content at a given line in a file.
# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
# * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
# * `list_memories`: Lists memories in Serena's project-specific memory store.
# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
# * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context).
# * `read_file`: Reads a file within the project directory.
# * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store.
# * `remove_project`: Removes a project from the Serena configuration.
# * `replace_lines`: Replaces a range of lines within a file with new content.
# * `replace_symbol_body`: Replaces the full definition of a symbol.
# * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen.
# * `search_for_pattern`: Performs a search for a pattern in the project.
# * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase.
# * `switch_modes`: Activates modes by providing a list of their names
# * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information.
# * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task.
# * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed.
# * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
excluded_tools: []
# initial prompt for the project. It will always be given to the LLM upon activating the project
# (contrary to the memories, which are loaded on demand).
initial_prompt: ""
project_name: "react"
included_optional_tools: []