Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-06-23 22:17:03 +03:00
parent 9526dfe645
commit 8866361a65

View File

@@ -1236,7 +1236,26 @@ func productSeriesAutoKey(productCode, colorCode, dim3Code string) string {
} }
func normalizeProductSeriesSize(v string) string { func normalizeProductSeriesSize(v string) string {
return strings.ToUpper(strings.TrimSpace(v)) s := strings.ToUpper(strings.TrimSpace(v))
// Some installations store series size tokens with a "seriesCode/size" prefix in title/rules
// (e.g. "2/48-50-52"). Treat "2/48" as size "48".
if i := strings.IndexByte(s, '/'); i > 0 {
prefix := strings.TrimSpace(s[:i])
suffix := strings.TrimSpace(s[i+1:])
if suffix != "" {
allDigits := true
for _, r := range prefix {
if r < '0' || r > '9' {
allDigits = false
break
}
}
if allDigits {
s = suffix
}
}
}
return s
} }
func copyProductSeriesStock(in map[string]float64) map[string]float64 { func copyProductSeriesStock(in map[string]float64) map[string]float64 {