Close the KS-2 -> KS-3 -> Payment -> allocation -> aggregates chain for V1.
Two real defects fixed:
- NaN/Infinity payment or allocation amounts raised InvalidOperation (500)
or were silently stored; they are now finite-value validation errors (400)
via _parse_money / is_finite checks.
- Editing an allocation to the same KS-3 hit uq_payment_ks3 because
clear() deferred the DELETE past the new INSERT; allocations are now
updated in place.
Financial semantics unchanged: full active payment counts as received,
storno keeps historical allocations while excluding the payment from
active aggregates. Decimal arithmetic preserved.
Split the Daily Report form into a top position picker (system filter,
live search) and a bottom added-items list grouped by system, with
quantity edit and remove. Switching systems no longer drops the added
list; A1->B1->A2 keeps all three.
Quantity can be entered in the picker before pressing Добавить and is
carried into the selected list; removing a position returns it to the
picker with the typed quantity intact. Draft quantities of never-added
positions stay out of POST via a submit guard, so they never become
Daily Report facts. Server rows are always rendered client-filtered;
POST contract and apply_quantities unchanged.
UI cleanup after the Word print forms became the only export path:
remove КС-2 (Excel) from the KS-2 page and Официальная форма (Word)
from the KS-3 page. Keep КС-2 (Word), КС-3 (Word) and the red
СТОРНИРОВАН badge on cancelled KS-2. Excel renderer and export
endpoints stay as legacy fallbacks; no DB, model or business-logic
changes.
Rewrite the KS-3 print renderer on the DOC-C4–DOC-C7 architecture:
- working marker template ks3_ru_markers.docx from the official blank;
static fields via named markers, values only from KS3ExportHeader/Item
- one dynamic works table with w:tblHeader page-break repetition, no
page/subtable split; final Итого block once at the end, VAT rows left
empty (unsupported by the DTO)
- unified money formatter (space thousands, comma decimals)
- UI keeps only КС-3 (Word); Excel endpoint remains for internal tests
- DB, KS3↔KS2 links, issue/cancel, payments and KS-2 untouched
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.