- Drop `expected_discount_pct`, add `price_uplift DECIMAL(8,4) DEFAULT 1.3` to `qt_competitors` (migration 040); formula: effective_price = price / uplift - Extend `LoadLotMetrics` to return per-PN qty map (`pnQtysByLot`) - Add virtual fields `CompetitorNames`, `PriceSpreadPct`, `PartnumberQtys` to `PricelistItem`; populate via `enrichWarehouseItems` / `enrichCompetitorItems` - Competitor quotes filtered to qty > 0 before lot resolution - New "stock layout" on pricelist detail page for warehouse/competitor: Partnumbers column (PN + qty, only qty>0), Поставщик column, no Настройки/Доступно - Spread badge ±N% shown next to price for competitor rows - Bible updated: pricelist.md, history.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9 lines
457 B
SQL
9 lines
457 B
SQL
-- Replace expected_discount_pct with price_uplift.
|
|
-- price_uplift is a divisor applied to the competitor's price to get the ex-VAT price:
|
|
-- effective_price = price / price_uplift
|
|
-- Default 1.3 represents a typical VAT+margin uplift.
|
|
ALTER TABLE qt_competitors
|
|
ADD COLUMN price_uplift DECIMAL(8,4) NOT NULL DEFAULT 1.3000
|
|
COMMENT 'Price divisor: effective_price = price / price_uplift. Default 1.3.',
|
|
DROP COLUMN expected_discount_pct;
|