feat(859-4): 일위대가 두 판 셈 — 문서 본뜬.단가기준 엑셀 = 고정 줄 줄 단가 그대로 · 우리 = 이은 비목 단가 책 값

- Labor_Fixed.line 판 받음 · basis_of(본뜬.단가기준 엑셀 | 우리 · 없음 = 지금 셈)
- Labor_Doc.calc · Labor_Expand = 판을 고정 줄 · 하위 SC · 가져온 식 SK 참조에 넘김(부르는 쪽 › SC 자기 판)
- 판 없는 문서 = 그대로(아직 판을 다는 길 없음 · 다음 묶음)
- 새 지킴 test_859_4_hopyo_basis(엑셀 판 = 줄 단가 · 우리 판 = 단가 책 · 펼침 판 차례)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 21:38:56 +09:00
co-authored by Claude Opus 5.5
parent 47d2fe7192
commit d9e6ec9ca1
4 changed files with 91 additions and 8 deletions
+10 -4
View File
@@ -37,6 +37,7 @@ class Expand:
hands: bool | None = None,
) -> None:
self.whole, self.read, self.memo = whole, read, {}
self.basis: str | None = None # 판(859-4) — 부르는 쪽 · 없으면 SC 자기 `본뜬.단가기준`
self.given = given or {}
self.hands = (
read is not refs.read_ref if hands is None else hands
@@ -58,7 +59,8 @@ class Expand:
def __call__(
self, ref: Ref, trail: tuple[str, ...] = (), basis: str | None = None
) -> dict[str, Any]:
"""`basis` = 가져온 식 SK(797-1 산근 속 산근)를 부르는 쪽 단가기준(엑셀 | 우리)으로 셈."""
"""`basis` = 가져온 식 SK(797-1 산근 속 산근) · SC 고정 줄(859-4)을 부르는 쪽 단가기준(엑셀 | 우리)으로 셈."""
basis = basis or self.basis
rid = refs.ref_id(ref)
if rid in trail:
keys = [t.rsplit("|", 1)[-1] for t in (*trail, rid)]
@@ -78,8 +80,12 @@ class Expand:
if basis and imp.is_imported(doc):
doc = {**doc, "가져온": {**doc["가져온"], "단가기준": basis}}
self.memo[memo] = calc.unit(doc, self.whole, self, (*trail, rid))
else: # 사전조합 = 그 SC 로직 사본(795-2)
self.memo[memo] = lc.combo(self, doc, (*trail, rid))
else: # 사전조합 = 그 SC 로직 사본(795-2) · 판 = 부르는 쪽 › 자기 것(859-4)
was, self.basis = self.basis, basis or fixed.basis_of(doc)
try:
self.memo[memo] = lc.combo(self, doc, (*trail, rid))
finally:
self.basis = was
return self.memo[memo]
@staticmethod
@@ -163,7 +169,7 @@ class Expand:
elif one.get("로직"): # 로직 줄(51-11) = 1 단위 값(기준 ÷ 배 · 승격과 같음) · 덮개 있음
head, sub = {"로직": one["로직"]}, self._logic(one, by_logic.get(one["로직"]), doc)
elif fixed.is_fixed(one): # 고정 줄(705-3) = 줄 단가 · 비율 줄 = 끝에(`ratio_row`)
head, sub = {"고정": one["고정"]}, fixed.line(self.whole, one["고정"])
head, sub = {"고정": one["고정"]}, fixed.line(self.whole, one["고정"], self.basis)
else:
continue
qty = self._qty(one, f"{rid}#{at}")