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 <noreply@anthropic.com>
This commit is contained in:
1 parent
65db9b37ea
commit
2f0957ae4e
1 file changed
+7
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user