[매뉴얼] - 영어/기술용어/환경변수 코드 노출 제거 - 초등학생 수준 친절한 설명체로 전면 재작성 - 역할별 시나리오 박스 + 화면 도식 + FAQ 한글 위주 - URL/코드 참조 최소화 [ExtraRow 버그] - 거래명세표에서 [+ 택배/용차 추가] 클릭해도 인풋 칸의 수량이 화면에 안 바뀌던 문제 - 같은 OBJID 라서 컴포넌트가 unmount 안 되어 useState 초기값 무시되던 케이스 - useEffect 로 line prop 변경 시 인풋 state 동기화 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+608
-291
File diff suppressed because it is too large
Load Diff
@@ -547,6 +547,14 @@ function ExtraRow({ line, displaySeq, onSave, onDelete }: {
|
||||
const [label, setLabel] = useState(line.EXTRA_LABEL || line.ITEM_NAME);
|
||||
const [unitPrice, setUnitPrice] = useState(Number(line.UNIT_PRICE) || 0);
|
||||
const [qty, setQty] = useState(Number(line.QTY) || 1);
|
||||
|
||||
// 외부에서 line 이 갱신되면(예: + 택배 추가 → 서버 재조회) 인풋도 동기화.
|
||||
// 같은 OBJID 라서 컴포넌트가 unmount 되지 않아 useState 초기값이 무시되는 문제 방지.
|
||||
useEffect(() => {
|
||||
setLabel(line.EXTRA_LABEL || line.ITEM_NAME);
|
||||
setUnitPrice(Number(line.UNIT_PRICE) || 0);
|
||||
setQty(Number(line.QTY) || 1);
|
||||
}, [line.OBJID, line.EXTRA_LABEL, line.ITEM_NAME, line.UNIT_PRICE, line.QTY]);
|
||||
const total = Math.round(unitPrice * qty);
|
||||
const supply = Math.round(total / 1.1);
|
||||
const vat = total - supply;
|
||||
|
||||
Reference in New Issue
Block a user