From 7de0f359b6e23850a0a2aea52a8cc41d22f27bf9 Mon Sep 17 00:00:00 2001 From: Mikhail Chusavitin Date: Tue, 17 Mar 2026 23:53:32 +0300 Subject: [PATCH] Pricing tab: per-LOT row expansion with rowspan grouping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Reorder columns: PN вендора / Описание / LOT / Кол-во / Estimate / Склад / Конкуренты / Ручная цена - Explode multi-LOT BOM rows into individual LOT sub-rows; PN вендора + Описание use rowspan to span the group - Rename "Своя цена" → "Ручная цена", "Проставить цены BOM" → "BOM Цена" - CSV export reads PN/Desc/LOT from data attributes to handle rowspan offset correctly - Document pricing tab layout contract in bible-local/02-architecture.md Co-Authored-By: Claude Sonnet 4.6 --- bible-local/02-architecture.md | 26 +++++ web/templates/index.html | 168 ++++++++++++++++++++++----------- 2 files changed, 139 insertions(+), 55 deletions(-) diff --git a/bible-local/02-architecture.md b/bible-local/02-architecture.md index 5af8428..a71e29e 100644 --- a/bible-local/02-architecture.md +++ b/bible-local/02-architecture.md @@ -48,6 +48,32 @@ Rules: - latest pricelist selection ignores snapshots without items; - auto pricelist mode stays auto and must not be persisted as an explicit resolved ID. +## Pricing tab layout + +The Pricing tab (Ценообразование) has two tables: Buy (Цена покупки) and Sale (Цена продажи). + +Column order (both tables): + +``` +PN вендора | Описание | LOT | Кол-во | Estimate | Склад | Конкуренты | Ручная цена +``` + +Per-LOT row expansion rules: +- each `lot_mappings` entry in a BOM row becomes its own table row with its own quantity and prices; +- `baseLot` (resolved LOT without an explicit mapping) is treated as the first sub-row with `quantity_per_pn` from `_getRowLotQtyPerPN`; +- when one vendor PN expands into N LOT sub-rows, PN вендора and Описание cells use `rowspan="N"` and appear only on the first sub-row; +- a visual top border (`border-t border-gray-200`) separates each vendor PN group. + +Vendor price attachment: +- `vendorOrig` and `vendorOrigUnit` (BOM unit/total price) are attached to the first LOT sub-row only; +- subsequent sub-rows carry empty `data-vendor-orig` so `setPricingCustomPriceFromVendor` counts each vendor PN exactly once. + +Controls terminology: +- custom price input is labeled **Ручная цена** (not "Своя цена"); +- the button that fills custom price from BOM totals is labeled **BOM Цена** (not "Проставить цены BOM"). + +CSV export reads PN вендора, Описание, and LOT from `data-vendor-pn`, `data-desc`, `data-lot` row attributes to bypass the rowspan cell offset problem. + ## Configuration versioning Configuration revisions are append-only snapshots stored in `local_configuration_versions`. diff --git a/web/templates/index.html b/web/templates/index.html index 70f2484..fc58cb1 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -211,9 +211,9 @@ - + @@ -236,12 +236,12 @@
LOT PN вендора ОписаниеLOT Кол-во Estimate Склад
- +