feat: official KS-2 Excel/Word forms with template markers and single-table flow

Replace the simplified KS-2 exports with the official unified form:

- Excel: official blank as working template, merge-safe row insertion,
  compact layout, header/signer polish, 0.00 money format
- Word: official blank via named template markers (DOC-C4), one dynamic
  works table with repeating header rows, separate closing totals block
  (Итого / Всего по акту), system group rows merged across 8 columns
- Word money formatter (space thousands, comma decimals) and split
  contract date day/month/year boxes
- Issue persists both xlsx and docx artifacts; UI keeps Excel and adds
  Word download
- Daily reports: multi-system item selection in the form

Regression tests for renderers, artifacts and layout; docs/tasks +
docs/implementation for the DOC-C* series.
This commit is contained in:
Арсентьев Александр
2026-10-03 19:48:29 +03:00
parent 79c7d4f335
commit bd64bb6307
49 changed files with 6917 additions and 353 deletions
+11 -10
View File
@@ -138,16 +138,15 @@ def test_ks2_excel_export_key_values(tmp_path):
resp = client.get(f"/projects/{data['pid']}/ks2/{data['ks2_id']}/export/excel")
assert resp.status_code == 200
_, _, text = _excel_text(resp)
assert "КС-2 № 7" in text
assert "Export polish" in text
assert "К2-7" in text or "Унифицированная форма" in text
assert "Заказчик ООО" in text
assert "DOG-2026-7" in text
assert "15.01.2026" in text
assert "RUB" in text
assert "01.03.2026 — 31.03.2026" in text
assert "01.03.2026" in text
assert "31.03.2026" in text
assert "Монтаж трубопровода" in text
assert "500" in text
assert "Итого:" in text
assert "ВСЕГО" in text
finally:
_clear()
engine.dispose()
@@ -162,12 +161,14 @@ def test_ks2_word_export_key_values(tmp_path):
resp = client.get(f"/projects/{data['pid']}/ks2/{data['ks2_id']}/export/word")
assert resp.status_code == 200
_, text = _word_text(resp)
assert "Акт КС-2 №7" in text
# Official form (DOC-C3): template-based KS-2 Word
assert "Унифицированная форма № КС-2" in text
assert "0322005" in text
assert "DOG-2026-7" in text
assert "15.01.2026" in text
assert "RUB" in text
assert "Итого:" in text
assert "500.00" in text
# contract date is split into day / month / year boxes
assert "15" in text and "2026" in text
assert "Итого" in text
assert "500,00" in text
finally:
_clear()
engine.dispose()