Merge remote-tracking branch 'origin/sub_desktop_1' into sub_laptop_1

This commit is contained in:
2026-09-14 23:16:10 +09:00
2 changed files with 92 additions and 20 deletions
+39
View File
@@ -231,3 +231,42 @@ def test_하도급대금_지급보증은_기본_꺼짐() -> None:
)
> 0
)
#: 실무 거창 2025 꼴 — 안전관리비 한 줄만 서고 관급이 큰 모양. 총공사비 끝자리가
#: **건너뛰는** 자리가 생긴다(이윤 1원이 총공사비 1~2원이라 어떤 배수는 못 밟는다).
_SKIPPING = CostInput(
direct_material_krw=Decimal(80_165_010),
direct_labor_krw=Decimal(243_648_150),
direct_expense_krw=Decimal(0),
owner_supplied_material_krw=Decimal(74_634_214),
enabled_items=("safety_management_cost",),
cut_basis="grand_total",
cut_unit_krw=1000,
)
@pytest.mark.parametrize("delta", [0, 1, 6, 13, 18, 24, 26, 31, 38, 39])
def test_절사는_끝자리를_건너뛰는_자리에서도_앉는다(delta) -> None:
"""⭐ 이윤 1원을 깎으면 총공사비는 **1원이나 2원** 줄어 어떤 1,000 배수는 못 밟는다.
종전엔 ÷1.1 어림이 한 칸 아래로 지나친 뒤 3걸음 안에 못 돌아와 끝자리 999 가 남았다
(거창 꼴 40 자리 중 16). 못 밟는 배수면 **한 칸 아래 배수로 내려가** 앉아야 한다.
"""
result = calculate_cost(replace(_SKIPPING, direct_labor_krw=Decimal(243_648_150 + delta)))
assert result.totals["grand_total"] % 1000 == 0, delta
assert not [n for n in result.notes if "안 앉음" in n], result.notes
@pytest.mark.parametrize("delta", [0, 1, 6, 13, 18, 24, 26, 31, 38, 39])
def test_절사는_깎을_수_있는_가장_적은_몫만_깎는다(delta) -> None:
"""버림이므로 깎인 몫은 **한 칸(1,000원) 안쪽**이어야 한다.
⚠ 이 줄이 깨지면 「못 밟는 배수를 만나 한 칸 내려갔다」는 뜻이다 — 실측(거창 꼴 40 자리)에서는
한 칸도 안 내려갔다. 깨지는 자리가 생기면 그 자체가 봐야 할 소식이다.
"""
data = replace(_SKIPPING, direct_labor_krw=Decimal(243_648_150 + delta))
plain = calculate_cost(replace(data, cut_basis="none"))
cut = calculate_cost(data)
drop = plain.totals["grand_total"] - cut.totals["grand_total"]
assert 0 <= drop < 1000, (delta, drop)