diff --git a/bible-local/02-architecture.md b/bible-local/02-architecture.md index 91d0ee0..e69e3ee 100644 --- a/bible-local/02-architecture.md +++ b/bible-local/02-architecture.md @@ -107,6 +107,8 @@ Sale per-row pricing (`_saleRowPrice`/`recomputeSalePrices` in `index.html`, `minimal_sale_columns: true` + `sale_row_markups`, which collapses `POST /api/configs/:uuid/export/pricing` output to exactly `LOT;Описание;Кол-во;Цена` (`ProjectPricingExportOptions.MinimalSaleColumns` in `internal/services/export.go`). + The minimal CSV expands vendor BOM rows even when the BOM column is hidden, so each + vendor PN and LOT pair receives its own markup. This is scoped to that one request: Buy export and the project-level bulk export never set it and are unaffected. diff --git a/internal/services/export.go b/internal/services/export.go index 3b78cec..70cf542 100644 --- a/internal/services/export.go +++ b/internal/services/export.go @@ -415,6 +415,9 @@ func (s *ExportService) buildPricingExportBlock(cfg *models.Configuration, opts Estimate: floatPtr(item.UnitPrice * float64(item.Quantity)), }) } + if opts.MinimalSaleColumns { + applySalePricing(block.Rows, cfg, opts) + } return block, nil } @@ -423,9 +426,10 @@ func (s *ExportService) buildPricingExportBlock(cfg *models.Configuration, opts localCfg = nil } - priceMap := s.resolvePricingTotals(cfg, localCfg, opts) + includeVendorRows := opts.IncludeBOM || opts.MinimalSaleColumns + priceMap := s.resolvePricingTotals(cfg, localCfg, includeVendorRows) componentDescriptions := s.resolveLotDescriptions(cfg, localCfg) - if opts.IncludeBOM && localCfg != nil && len(localCfg.VendorSpec) > 0 { + if includeVendorRows && localCfg != nil && len(localCfg.VendorSpec) > 0 { coveredLots := make(map[string]struct{}) for _, row := range localCfg.VendorSpec { rowMappings := localdb.NormalizeLotMappings(row.LotMappings) @@ -716,9 +720,9 @@ type pricingLevels struct { CompetitorWorld bool } -func (s *ExportService) resolvePricingTotals(cfg *models.Configuration, localCfg *localdb.LocalConfiguration, opts ProjectPricingExportOptions) map[string]pricingLevels { +func (s *ExportService) resolvePricingTotals(cfg *models.Configuration, localCfg *localdb.LocalConfiguration, includeVendorRows bool) map[string]pricingLevels { result := map[string]pricingLevels{} - lots := collectPricingLots(cfg, localCfg, opts.IncludeBOM) + lots := collectPricingLots(cfg, localCfg, includeVendorRows) if len(lots) == 0 || s.localDB == nil { return result } diff --git a/releases/v3.53/RELEASE_NOTES.md b/releases/v3.53/RELEASE_NOTES.md new file mode 100644 index 0000000..b098cfa --- /dev/null +++ b/releases/v3.53/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +# QuoteForge v3.53 + +26 ноября 2026 + +Экспорт CSV из раздела «Цена продажи» учитывает накидку каждой строки, в том числе когда один LOT встречается у нескольких артикулов вендора.