From e2635df90b31089bb48028991e32f40d3864cb7f Mon Sep 17 00:00:00 2001 From: anor Date: Wed, 6 May 2026 16:50:37 +1000 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=BF=D1=80=D0=B8=20=D0=B4=D1=83=D0=B1?= =?UTF-8?q?=D0=BB=D0=B8=D0=BA=D0=B0=D1=82=D0=B0=D1=85=20=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=BA=20=D0=BE=D0=B4=D0=BD=D0=BE=D0=B9=20=D1=81=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D1=8B=20=D0=B7=D0=B0=D0=BF=D0=BE=D0=BB=D0=BD=D1=8F?= =?UTF-8?q?=D1=82=D1=8C=20=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=B2=D1=83=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Если в РеестрСМ одна и та же смета встречается несколько раз подряд (например R2/R3/R4 для ЛСР-04-01-0-00-01), пункт замечания пишем только в первую строку; нижние дубликаты оставляем D=None. Co-Authored-By: Claude Opus 4.7 (1M context) --- complaints.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/complaints.py b/complaints.py index 7317106..baa5c6d 100644 --- a/complaints.py +++ b/complaints.py @@ -126,14 +126,16 @@ def apply_to_registry(path: str | Path, out_path: str | Path) -> dict: ws = _open_registry_sheet(wb) cells_filled = 0 - smety_matched = set() + smety_matched: set[str] = set() for r_idx in range(2, ws.max_row + 1): code_cell = ws.cell(row=r_idx, column=REGISTRY_CODE_COL) code = code_cell.value if not code: continue code = str(code).strip() - if code in by_smeta_str: + # one смета → пишем только в первую её строку; дубликаты ниже + # (R3/R4 для одного и того же кода) оставляем пустыми + if code in by_smeta_str and code not in smety_matched: ws.cell(row=r_idx, column=REGISTRY_TARGET_COL, value=by_smeta_str[code]) cells_filled += 1 smety_matched.add(code)