Files
Aislo/resources/master_data/scripts/master_bundle.py
T
eomsangdonandClaude Opus 5.5 dd8759edc5 refactor(855-E 2-E4 ㉯-4 ⑥): 옛 계산 엔진 몸 지움 — master_formula 무리 아홉 · 계산기 하나
- git rm(부르는 곳 0 다시 셈 — import · import_module 글 · getattr 별칭 cm.mf · store.mau · mtx 포함): master_formula · master_formula_check · master_formula_sum · master_text · master_text_item · master_sheet_line · master_gate · master_auto · master_copy(−2,625 줄)
- master_cut = down · row · sums 만(일위대가 반영 끝수 · TS 짝) — engine · settle · plain · _line · _sub · kept(손님 0) 지움 · 바탕 = master_base
- master_bundle = BUNDLES · BY_ITEM · BY_KIND · is_machine(M01 목록 묶음) — called · bundle · tag 지움 · master_combo = 조합 칸만(run 지움)
- check_master · check_master_body · compare_estx: import master_formula → master_base(바탕 이름만) · compare_estx 기계 · 일위대가 대조 = 수식 문서 셈(옛 mf.run · 로직 줄 고르기 덧붙임 걷음 · 일위대가 28 · 기계 207 건 그대로 나옴)
- M01 Store: 다시 내보냄 mau · mtx 지움(부르는 곳 0) · cm.mf = master_base
- 죽은 주석: master_material · master_pick · master_base · Item_Prices · San_Emit · check_master
- test_855_sk_layers: 옛 엔진 안 돎 = 엔진 모듈 없음 확인
- 검증: 관련 146 파일 1,135 통과 · test_855_golden 전수 지문 같음 · 모든 제품 · scripts 모듈 읽기 깨짐 0 · typecheck 0 · 8008 health 200 · 로그 오류 0 · 서버 길 469 → 469

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 16:02:20 +09:00

25 lines
1.1 KiB
Python

# -*- coding: utf-8 -*-
"""인력 · 재료 · 경비 묶음 — **셈 때 파생**(정본에 칸 없음 · PLAN 712-1 · 요구서 원칙 5).
규칙 한 줄:
- 호표 · 덧줄 = `비목` 따라(노무비 → 인력 · 재료비 → 재료 · 경비 → 경비).
- 부르는 문서가 기계경비(`is_machine`)면 경비 · 아니면 하위(M01 목록 묶음 셈 `M01_MasterData_Store_List`).
기계경비 판별 = `is_machine` 한 곳. 옛 엔진 줄 꼬리표(`called` · `bundle` · `tag`)는 855-E 2-E4 에서 걷음.
"""
from __future__ import annotations
import re
BUNDLES = ("인력", "재료", "경비", "하위")
BY_ITEM = {"노무비": "인력", "재료비": "재료", "경비": "경비"}
BY_KIND = {"인력": "인력", "재료": "재료", "기계": "경비"} # 비목 빈 옛 줄 받침
def is_machine(row: dict | None) -> bool:
"""기계경비 로직 — 돈 로직이고 결과단위 「원/시간」(작업량 「㎥/시간」 · 이름 「시간당」 아님)."""
if not row or "결과" in row or isinstance(row.get("흐름"), dict):
return False
return re.sub(r"\s", "", str(row.get("결과단위") or "")) == "원/시간"