Merge branch 'sub_laptop_3' of C:/Aislo_wt/sub_laptop_3 into main_laptop_1
This commit is contained in:
@@ -145,10 +145,15 @@ def defaults_of(doc: dict, vals: dict) -> dict:
|
||||
return {"값": values, "조종원": crew, "잡품": misc}
|
||||
|
||||
|
||||
_LABEL = ("이름", "단위") # 화면 글 — 원본 대조 안 봄
|
||||
|
||||
|
||||
def _canon(v) -> str:
|
||||
def norm(x):
|
||||
if isinstance(x, dict):
|
||||
return {k: norm(y) for k, y in sorted(x.items()) if y not in (None, "")}
|
||||
return {
|
||||
k: norm(y) for k, y in sorted(x.items()) if y not in (None, "") and k not in _LABEL
|
||||
}
|
||||
if isinstance(x, list):
|
||||
return [norm(y) for y in x]
|
||||
if _num(x) is not None:
|
||||
@@ -209,7 +214,8 @@ def _crew_lines(doc: dict, rows: list) -> list[dict]:
|
||||
)
|
||||
doc.setdefault("식", []).append(dict(_HOUR_LINE))
|
||||
return [
|
||||
{"이름": "조종원", "단위": "인", "비목": "노무비", "수량": f"{_plain(r['인'])} × {HOUR}",
|
||||
{"이름": "조종원", **({"규격": r["이름"]} if r.get("이름") else {}), "단위": "인",
|
||||
"비목": "노무비", "수량": f"{_plain(r['인'])} × {HOUR}",
|
||||
"단가": _add_var(doc, "w", "조종원", "조종원 노임", r["키"])}
|
||||
for r in rows
|
||||
] # fmt: skip
|
||||
|
||||
@@ -229,7 +229,7 @@ def _same(a, b, where=""):
|
||||
COVERS = [
|
||||
None,
|
||||
{"값": {"가격": 150000, "주연료종류": "휘발유"}},
|
||||
{"조종원": [{"키": "LB:1048", "인": 2}, {"키": "LB:1002", "인": 0.5}]},
|
||||
{"조종원": [{"키": "LB:1048", "인": 2, "이름": "운전사"}, {"키": "LB:1002", "인": 0.5}]},
|
||||
{"조종원": []},
|
||||
{"잡품": [{"줄": "주연료", "율": 30}, {"키": "LB:1048", "이름": "시험", "수량": 2, "율": 5}]},
|
||||
{"잡품": [{"줄": "주연료", "수량": 10, "율": 22}]},
|
||||
@@ -334,3 +334,8 @@ def test_저장_다시_열기_되돌리면_덮음_없음(world):
|
||||
doc[mcv.COVER] = {NO: {"값": {"가격": -5}}}
|
||||
with pytest.raises(store.StoreError):
|
||||
at(path.save, key, {"문서": doc, "판": back["판"]})
|
||||
|
||||
|
||||
def test_이름_단위는_원본_대조_안_봄():
|
||||
base = {"값": {}, "조종원": [{"키": "LB:1048", "인": 1}], "잡품": []}
|
||||
assert mcv.prune({"조종원": [{"키": "LB:1048", "인": 1, "이름": "운전사"}]}, base) is None
|
||||
|
||||
Reference in New Issue
Block a user