From f0e6bba7e900c2172d35d0649df469c38b2c2e8a Mon Sep 17 00:00:00 2001 From: Mikhail Chusavitin Date: Fri, 13 Mar 2026 14:24:15 +0300 Subject: [PATCH] Remove partnumbers column from all pricelist views (data mixed across sources) Co-Authored-By: Claude Sonnet 4.6 --- web/templates/pricelist_detail.html | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/web/templates/pricelist_detail.html b/web/templates/pricelist_detail.html index 10ca96a..f225eaf 100644 --- a/web/templates/pricelist_detail.html +++ b/web/templates/pricelist_detail.html @@ -59,7 +59,6 @@ Категория Описание Доступно - Partnumbers Цена, $ Настройки @@ -160,13 +159,12 @@ } function itemsColspan() { - return isWarehouseSource() ? 5 : 4; + return isStockSource() ? 4 : 5; } function toggleWarehouseColumns() { const stock = isStockSource(); document.getElementById('th-qty').classList.toggle('hidden', true); - document.getElementById('th-partnumbers').classList.toggle('hidden', !isWarehouseSource()); document.getElementById('th-settings').classList.toggle('hidden', stock); } @@ -249,27 +247,6 @@ const description = item.lot_description || '-'; const truncatedDesc = description.length > descMax ? description.substring(0, descMax) + '...' : description; - // Partnumbers cell (stock sources only) - let pnHtml = '—'; - if (stock) { - const qtys = item.partnumber_qtys || {}; - const allPNs = Array.isArray(item.partnumbers) ? item.partnumbers : []; - const withQty = allPNs.filter(pn => qtys[pn] > 0); - const list = withQty.length > 0 ? withQty : allPNs; - if (list.length === 0) { - pnHtml = '—'; - } else { - const shown = list.slice(0, 4); - const rest = list.length - shown.length; - const formatPN = pn => { - const q = qtys[pn]; - const qStr = (q > 0) ? ` (${formatQty(q)} шт.)` : ''; - return `
${escapeHtml(pn)}${qStr}
`; - }; - pnHtml = shown.map(formatPN).join(''); - if (rest > 0) pnHtml += `
+${rest} ещё
`; - } - } // Price cell — add spread badge for competitor @@ -287,7 +264,6 @@ ${escapeHtml(item.category || '-')} ${escapeHtml(truncatedDesc)} - ${isWarehouseSource() ? `${pnHtml}` : ''} ${priceHtml} ${!stock ? `${formatPriceSettings(item)}` : ''}