Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user