fix(842-1): B09 고정 줄 이은 자재 별도 · 관급 = 자재대에 한 번 — 거창 안내판 줄 사라진 50,000 되살림
- 고정 줄 이은 자재가 별도 · 관급이면 대가 안 0 원 + 그 몫 `aside` → 집계 `aside` 줄(자재대 수량) (`Calc_Labor` py · ts 짝 `_fixed_apart` · `Summary._fixed_lines`) — 기본 표시는 M02 자재표시 그대로 - 거창 직접비 합 = 엑셀(384,916,227) · 견본 넷 사라진 재료 0 · 겹쳐 셈 0 - 지킴 시험 `test_842_1_b09_fixed_aside`(재료 · 고정 · 관급 · 기계 겸 · 거울) + `test_707_7` 전수 시험 - `test_707_7` 낡은 기대(거창 gap 50000 · 다시 부르기 384866227) 고침 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -139,14 +139,18 @@ def _none() -> dict[str, float | None]:
|
||||
def _fixed(line: dict[str, Any], books: dict[str, Any]) -> dict[str, float | None]:
|
||||
"""고정 줄 단가(705-1) — 줄 단가 그대로 · 이은 자재가 관급 · 별도계상이면 재료 0(841-1 단가 책
|
||||
값으로 다시 안 덮음)."""
|
||||
own, link = line.get("own") or {}, line.get("link") or {}
|
||||
out = {part: num(own.get(part)) or 0.0 for part in PARTS}
|
||||
row = books["material"].get(link.get("material")) if link.get("material") else None
|
||||
if row and row.get("supply") in SUPPLY:
|
||||
out = {part: num((line.get("own") or {}).get(part)) or 0.0 for part in PARTS}
|
||||
if _fixed_apart(line, books):
|
||||
out["material"] = 0.0
|
||||
return out
|
||||
|
||||
|
||||
def _fixed_apart(line: dict[str, Any], books: dict[str, Any]) -> bool:
|
||||
"""고정 줄이 이은 자재가 관급 · 별도(842-1) — 대가 안 0 · 그 몫은 자재대(`aside`)로."""
|
||||
key = (line.get("link") or {}).get("material")
|
||||
return bool(key) and (books["material"].get(key) or {}).get("supply") in SUPPLY
|
||||
|
||||
|
||||
def _base(spec: str, lines: list[dict[str, Any]], src: list) -> float | None:
|
||||
"""% 줄 밑수 — `part:비목` 그 비목 줄 금액 합 · `lines:labor` 노무 줄 금액 합 ·
|
||||
`line:이름` 그 줄 · `bundle:labor|material|machine` 그 종류 줄(+ 그 이음 고정 줄) 합 ·
|
||||
@@ -212,6 +216,9 @@ def _block(
|
||||
}
|
||||
if line["kind"] == "material" and _apart(line, books): # 관급 · 별도계상 = 대가 안 0원
|
||||
extra["aside"], prices["material"], amounts["material"] = amounts["material"], 0.0, 0.0
|
||||
if line["kind"] == "fixed" and _fixed_apart(line, books): # 842-1 이은 자재 = 자재대 몫
|
||||
mat = num((line.get("own") or {}).get("material")) or 0.0
|
||||
extra["aside"] = None if qty is None else cut(mat * qty, line.get("place"))
|
||||
ref = {"ref": {"key": line["key"]}} if line.get("key") else {} # 집계표(145-5) 이음
|
||||
ask = {"why": line["ask"]} if qty is None and line.get("ask") else {} # 723-4
|
||||
lines.append(
|
||||
|
||||
@@ -121,14 +121,18 @@ function linePrices(line: Row, books: Row, sums: Record<string, Row>): Parts {
|
||||
/** 고정 줄 단가(705-1) — 줄 단가 그대로 · 이은 자재가 관급 · 별도계상이면 재료 0(짝 `_fixed`) */
|
||||
function fixedPrices(line: Row, books: Row): Parts {
|
||||
const own: Row = line.own || {};
|
||||
const link: Row = line.link || {};
|
||||
const out = zeros();
|
||||
for (const part of PARTS) out[part] = num(own[part]) ?? 0;
|
||||
const row: Row | undefined = link.material ? books.material[link.material] : undefined;
|
||||
if (row && (SUPPLY as readonly string[]).includes(row.supply)) out.material = 0;
|
||||
if (fixedApart(line, books)) out.material = 0;
|
||||
return out;
|
||||
}
|
||||
|
||||
/** 고정 줄이 이은 자재가 관급 · 별도(842-1) — 대가 안 0 · 그 몫은 자재대(`aside`)로(짝 `_fixed_apart`) */
|
||||
function fixedApart(line: Row, books: Row): boolean {
|
||||
const key: string | undefined = (line.link || {}).material;
|
||||
return !!key && (SUPPLY as readonly string[]).includes((books.material[key] || {}).supply);
|
||||
}
|
||||
|
||||
/** % 줄 밑수 — part:비목 그 비목 줄 금액 합 · lines:labor 노무 줄 금액 합 · line:이름 그 줄 ·
|
||||
* bundle:labor|material|machine 그 종류 줄(+ 그 이음 고정 줄) 합 · rows:0,2 블록 그 차례 줄(src cid) 합
|
||||
* (778-4 · 짝 `.py` `_base`) */
|
||||
@@ -204,6 +208,11 @@ function block(b: Row, books: Row, sums: Record<string, Row>, gaps: Gap[], own:
|
||||
prices.material = 0;
|
||||
amounts.material = 0;
|
||||
}
|
||||
if (line.kind === "fixed" && fixedApart(line, books)) {
|
||||
// 842-1 이은 자재 = 자재대 몫(짝 `_block`)
|
||||
extra.aside =
|
||||
qty === null ? null : cut((num((line.own || {}).material) ?? 0) * qty, line.place);
|
||||
}
|
||||
const ref = line.key ? { ref: { key: line.key } } : {}; // 집계표(145-5) 이음
|
||||
const ask: Row = qty === null && line.ask ? { why: line.ask } : {}; // 723-4
|
||||
lines.push({ ...line, ...ref, ...ask, qty, prices, amounts, ...extra });
|
||||
|
||||
@@ -168,6 +168,8 @@ def _fixed_lines(block: dict[str, Any], line: dict[str, Any]) -> list[dict[str,
|
||||
link = line.get("link") or {}
|
||||
pairs = [("machine", link.get("machine"))] if link.get("machine") else []
|
||||
pairs = pairs or [(k, link.get(k)) for k in ("labor", "material") if link.get(k)]
|
||||
if "aside" in line and link.get("material"): # 842-1 이은 자재 별도 · 관급 = 자재대 몫
|
||||
pairs = [(k, v) for k, v in pairs if k != "material"] + [("aside", link["material"])]
|
||||
if not pairs:
|
||||
pairs = [("fixed", f"{block['key']}|{line.get('cid') or line.get('name')}")]
|
||||
return [{"kind": k, "key": str(v), "qty": line["qty"]} for k, v in pairs]
|
||||
|
||||
Reference in New Issue
Block a user