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
4db8ca1140
commit
d82590c34b
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