From 2f0957ae4e8e9809c1d8044987b0d533fda79846 Mon Sep 17 00:00:00 2001 From: Michael Chus Date: Thu, 5 Mar 2026 12:47:32 +0300 Subject: [PATCH] Fix price levels returning empty in offline mode CalculatePriceLevels now falls back to localDB when pricelistRepo is nil (offline mode) to resolve the latest pricelist ID per source. Previously all price lookups were skipped, resulting in empty prices on the pricing tab. Co-Authored-By: Claude Sonnet 4.6 --- internal/services/quote.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/services/quote.go b/internal/services/quote.go index 8185a3d..f7dc0db 100644 --- a/internal/services/quote.go +++ b/internal/services/quote.go @@ -289,6 +289,13 @@ func (s *QuoteService) CalculatePriceLevels(req *PriceLevelsRequest) (*PriceLeve result.ResolvedPricelistIDs[sourceKey] = latest.ID } } + if st.id == 0 && s.localDB != nil { + localPL, err := s.localDB.GetLatestLocalPricelistBySource(sourceKey) + if err == nil && localPL != nil { + st.id = localPL.ServerID + result.ResolvedPricelistIDs[sourceKey] = localPL.ServerID + } + } if st.id == 0 { continue }