Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -835,6 +835,7 @@ const $q = useQuasar()
|
||||
const orderStore = useOrderEntryStore()
|
||||
const orderentryStore = useOrderEntryStore()
|
||||
orderStore.initSchemaMap()
|
||||
void orderStore.ensureProductSizeMatchRules()
|
||||
|
||||
const schemaSource = computed(() =>
|
||||
Object.keys(orderStore?.schemaMap || {}).length
|
||||
@@ -1777,6 +1778,7 @@ watch(() => orderStore.replaceRouteSignal, async (id) => {
|
||||
|
||||
/* -------------------- LIFECYCLE -------------------- */
|
||||
onMounted(async () => {
|
||||
await orderStore.ensureProductSizeMatchRules()
|
||||
await nextTick()
|
||||
|
||||
/* ---------------- UI ---------------- */
|
||||
@@ -2671,17 +2673,16 @@ async function onModelChange(modelCode) {
|
||||
})
|
||||
|
||||
/* =======================================================
|
||||
🔑 BEDEN GRUBU — TEK VE KESİN KARAR
|
||||
- ÖNCE detectBedenGroup (accent/garson/yas kurallarını içerir)
|
||||
- Sonra güvenli fallback
|
||||
🔑 BEDEN GRUBU — TEK VE KESİN KARAR (SQL kural tabanı)
|
||||
======================================================= */
|
||||
let bedenGrpKey = null
|
||||
try {
|
||||
bedenGrpKey = detectBedenGroup(
|
||||
null,
|
||||
form.urunAnaGrubu,
|
||||
form.kategori || form.urunAltGrubu,
|
||||
form.yetiskinGarson || form.askiliyan
|
||||
form.kategori || '',
|
||||
form.yetiskinGarson || form.askiliyan,
|
||||
form.urunAltGrubu || ''
|
||||
)
|
||||
} catch (e) {
|
||||
console.warn('⚠️ detectBedenGroup hata:', e)
|
||||
@@ -2689,42 +2690,13 @@ async function onModelChange(modelCode) {
|
||||
}
|
||||
|
||||
if (!bedenGrpKey) {
|
||||
const anaNRaw = String(form.urunAnaGrubu || '')
|
||||
.normalize('NFD')
|
||||
.replace(/[\u0300-\u036f]/g, '')
|
||||
.toLowerCase()
|
||||
.trim()
|
||||
const katN = String(form.kategori || form.urunAltGrubu || '')
|
||||
.normalize('NFD')
|
||||
.replace(/[\u0300-\u036f]/g, '')
|
||||
.toLowerCase()
|
||||
.trim()
|
||||
const ygN = String(form.yetiskinGarson || form.askiliyan || '')
|
||||
.normalize('NFD')
|
||||
.replace(/[\u0300-\u036f]/g, '')
|
||||
.toLowerCase()
|
||||
.trim()
|
||||
const anaN =
|
||||
(katN.includes('yetiskin') && anaNRaw.includes('gomlek klasik'))
|
||||
? anaNRaw.replace('gomlek klasik', 'gomlek ata yaka')
|
||||
: anaNRaw
|
||||
|
||||
const hasGarsonMeta =
|
||||
anaN.includes('garson') ||
|
||||
katN.includes('garson') ||
|
||||
katN.includes('yetiskin/garson') ||
|
||||
ygN.includes('garson') ||
|
||||
ygN.includes('yetiskin/garson')
|
||||
|
||||
if (hasGarsonMeta) bedenGrpKey = 'yas'
|
||||
else if (anaN.includes('pantolon') || katN.includes('pantolon')) bedenGrpKey = 'pan'
|
||||
else if (anaN.includes('gomlek') || katN.includes('gomlek')) bedenGrpKey = 'gom'
|
||||
else if (anaN.includes('ayakkabi') || katN.includes('ayakkabi')) bedenGrpKey = 'ayk'
|
||||
$q.notify({
|
||||
type: 'negative',
|
||||
message: 'Beden grubu eşleşmesi bulunamadı (kategori/ana grup/alt grup).'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// ✅ Son fallback
|
||||
if (!bedenGrpKey) bedenGrpKey = 'tak'
|
||||
|
||||
form.grpKey = bedenGrpKey
|
||||
console.log('🧭 Editor grpKey set edildi →', bedenGrpKey)
|
||||
// ✅ Editor bedenleri hemen aç (UI seed) — schemaMap tek kaynak
|
||||
|
||||
@@ -875,7 +875,8 @@ function toggleAllDetails() {
|
||||
|
||||
function buildLevel3Rows(grp3) {
|
||||
const byKey = new Map()
|
||||
const gk = activeGrpKey.value || 'tak'
|
||||
const gk = activeGrpKey.value
|
||||
if (!gk) return []
|
||||
|
||||
for (const item of grp3.items || []) {
|
||||
const model = String(item.Urun_Kodu || '').trim()
|
||||
@@ -1235,6 +1236,7 @@ async function fetchStockByAttributes() {
|
||||
if (!orderStore.schemaMap || !Object.keys(orderStore.schemaMap).length) {
|
||||
orderStore.initSchemaMap()
|
||||
}
|
||||
await orderStore.ensureProductSizeMatchRules()
|
||||
|
||||
const res = await api.get('/product-stock-query-by-attributes', { params })
|
||||
const list = Array.isArray(res?.data) ? res.data : []
|
||||
@@ -1249,14 +1251,27 @@ async function fetchStockByAttributes() {
|
||||
const grpKey = detectBedenGroup(
|
||||
list.map((x) => x?.Beden || ''),
|
||||
first?.URUN_ANA_GRUBU || '',
|
||||
first?.YETISKIN_GARSON || ''
|
||||
first?.KATEGORI || first?.YETISKIN_GARSON || '',
|
||||
first?.YETISKIN_GARSON || '',
|
||||
first?.URUN_ALT_GRUBU || ''
|
||||
)
|
||||
|
||||
const schemaMap = Object.keys(orderStore.schemaMap || {}).length
|
||||
? orderStore.schemaMap
|
||||
: storeSchemaByKey
|
||||
activeGrpKey.value = grpKey || 'tak'
|
||||
activeSchema.value = schemaMap?.[grpKey] || storeSchemaByKey.tak
|
||||
if (!grpKey || !schemaMap?.[grpKey]) {
|
||||
rawRows.value = []
|
||||
openState.value = {}
|
||||
errorMessage.value = 'Beden grubu eşleşmesi bulunamadı.'
|
||||
$q.notify({
|
||||
type: 'negative',
|
||||
position: 'top-right',
|
||||
message: 'Beden grubu eşleşmesi bulunamadı (kategori/ana grup/alt grup).'
|
||||
})
|
||||
return
|
||||
}
|
||||
activeGrpKey.value = grpKey
|
||||
activeSchema.value = schemaMap[grpKey]
|
||||
|
||||
rawRows.value = list
|
||||
productImageCache.value = {}
|
||||
@@ -1491,7 +1506,8 @@ function resetForm() {
|
||||
void loadFilterOptions(true)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
await orderStore.ensureProductSizeMatchRules()
|
||||
void loadFilterOptions(true)
|
||||
window.addEventListener('mousemove', onFullscreenMouseMove)
|
||||
window.addEventListener('mouseup', onFullscreenMouseUp)
|
||||
|
||||
@@ -850,7 +850,8 @@ function toggleAllDetails() {
|
||||
|
||||
function buildLevel3Rows(grp3) {
|
||||
const byKey = new Map()
|
||||
const gk = activeGrpKey.value || 'tak'
|
||||
const gk = activeGrpKey.value
|
||||
if (!gk) return []
|
||||
|
||||
for (const item of grp3.items || []) {
|
||||
const model = String(item.Urun_Kodu || '').trim()
|
||||
@@ -1045,6 +1046,7 @@ async function fetchStockByCode() {
|
||||
if (!orderStore.schemaMap || !Object.keys(orderStore.schemaMap).length) {
|
||||
orderStore.initSchemaMap()
|
||||
}
|
||||
await orderStore.ensureProductSizeMatchRules()
|
||||
|
||||
const res = await api.get('/product-stock-query', { params: { code } })
|
||||
const list = Array.isArray(res?.data) ? res.data : []
|
||||
@@ -1059,14 +1061,27 @@ async function fetchStockByCode() {
|
||||
const grpKey = detectBedenGroup(
|
||||
list.map((x) => x?.Beden || ''),
|
||||
first?.URUN_ANA_GRUBU || '',
|
||||
first?.YETISKIN_GARSON || ''
|
||||
first?.KATEGORI || first?.YETISKIN_GARSON || '',
|
||||
first?.YETISKIN_GARSON || '',
|
||||
first?.URUN_ALT_GRUBU || ''
|
||||
)
|
||||
|
||||
const schemaMap = Object.keys(orderStore.schemaMap || {}).length
|
||||
? orderStore.schemaMap
|
||||
: storeSchemaByKey
|
||||
activeGrpKey.value = grpKey || 'tak'
|
||||
activeSchema.value = schemaMap?.[grpKey] || storeSchemaByKey.tak
|
||||
if (!grpKey || !schemaMap?.[grpKey]) {
|
||||
rawRows.value = []
|
||||
openState.value = {}
|
||||
errorMessage.value = 'Beden grubu eşleşmesi bulunamadı.'
|
||||
$q.notify({
|
||||
type: 'negative',
|
||||
position: 'top-right',
|
||||
message: 'Beden grubu eşleşmesi bulunamadı (kategori/ana grup/alt grup).'
|
||||
})
|
||||
return
|
||||
}
|
||||
activeGrpKey.value = grpKey
|
||||
activeSchema.value = schemaMap[grpKey]
|
||||
|
||||
rawRows.value = list
|
||||
productImageCache.value = {}
|
||||
@@ -1308,7 +1323,8 @@ onUnmounted(() => {
|
||||
productImageBlobUrls.value = []
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
await orderStore.ensureProductSizeMatchRules()
|
||||
loadProductOptions()
|
||||
window.addEventListener('mousemove', onFullscreenMouseMove)
|
||||
window.addEventListener('mouseup', onFullscreenMouseUp)
|
||||
|
||||
@@ -57,6 +57,60 @@ export const schemaByKey = BEDEN_SCHEMA.reduce((m, g) => {
|
||||
return m
|
||||
}, {})
|
||||
|
||||
const productSizeMatchCache = {
|
||||
loaded: false,
|
||||
rules: [],
|
||||
schemas: {}
|
||||
}
|
||||
|
||||
function resetProductSizeMatchCache() {
|
||||
productSizeMatchCache.loaded = false
|
||||
productSizeMatchCache.rules = []
|
||||
productSizeMatchCache.schemas = {}
|
||||
}
|
||||
|
||||
function setProductSizeMatchCache(payload) {
|
||||
const rules = Array.isArray(payload?.rules) ? payload.rules : []
|
||||
const schemasRaw = payload?.schemas && typeof payload.schemas === 'object'
|
||||
? payload.schemas
|
||||
: {}
|
||||
|
||||
const normalizedRules = rules
|
||||
.map(r => ({
|
||||
productGroupID: Number(r?.product_group_id || r?.productGroupID || 0),
|
||||
kategori: normalizeTextForMatch(r?.kategori || ''),
|
||||
urunAnaGrubu: normalizeTextForMatch(r?.urun_ana_grubu || r?.urunAnaGrubu || ''),
|
||||
urunAltGrubu: normalizeTextForMatch(r?.urun_alt_grubu || r?.urunAltGrubu || ''),
|
||||
groupKeys: Array.isArray(r?.group_keys || r?.groupKeys)
|
||||
? (r.group_keys || r.groupKeys).map(g => String(g || '').trim()).filter(Boolean)
|
||||
: []
|
||||
}))
|
||||
.filter(r => r.groupKeys.length > 0)
|
||||
.sort((a, b) => {
|
||||
if (a.productGroupID && b.productGroupID) return a.productGroupID - b.productGroupID
|
||||
return 0
|
||||
})
|
||||
|
||||
const normalizedSchemas = {}
|
||||
for (const [k, vals] of Object.entries(schemasRaw)) {
|
||||
const key = String(k || '').trim()
|
||||
if (!key) continue
|
||||
const arr = Array.isArray(vals)
|
||||
? vals
|
||||
: String(vals || '').split(',')
|
||||
normalizedSchemas[key] = arr
|
||||
.map(v => {
|
||||
const s = String(v == null ? '' : v).trim()
|
||||
return s === '' ? ' ' : s
|
||||
})
|
||||
.filter((v, idx, all) => all.indexOf(v) === idx)
|
||||
}
|
||||
|
||||
productSizeMatchCache.loaded = true
|
||||
productSizeMatchCache.rules = normalizedRules
|
||||
productSizeMatchCache.schemas = normalizedSchemas
|
||||
}
|
||||
|
||||
|
||||
export const stockMap = ref({})
|
||||
export const bedenStock = ref([])
|
||||
@@ -228,6 +282,28 @@ export const useOrderEntryStore = defineStore('orderentry', {
|
||||
)
|
||||
},
|
||||
|
||||
async ensureProductSizeMatchRules($q = null, force = false) {
|
||||
if (!force && productSizeMatchCache.loaded && productSizeMatchCache.rules.length > 0) {
|
||||
return true
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await api.get('/product-size-match/rules')
|
||||
setProductSizeMatchCache(res?.data || {})
|
||||
return true
|
||||
} catch (err) {
|
||||
if (force) {
|
||||
resetProductSizeMatchCache()
|
||||
}
|
||||
console.warn('⚠ product-size-match rules alınamadı:', err)
|
||||
$q?.notify?.({
|
||||
type: 'warning',
|
||||
message: 'Beden eşleme kuralları alınamadı.'
|
||||
})
|
||||
return false
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getRowKey(row) {
|
||||
if (!row) return null
|
||||
@@ -923,6 +999,14 @@ export const useOrderEntryStore = defineStore('orderentry', {
|
||||
try {
|
||||
// geçici varsayım (sonra isClosed durumuna göre set edilecek)
|
||||
this.setMode?.('edit')
|
||||
const rulesReady = await this.ensureProductSizeMatchRules?.($q)
|
||||
if (!rulesReady) {
|
||||
$q?.notify?.({
|
||||
type: 'negative',
|
||||
message: 'Beden eşleme kuralları yüklenemedi.'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
/* =======================================================
|
||||
🔹 BACKEND — authoritative load
|
||||
@@ -1774,6 +1858,13 @@ export const useOrderEntryStore = defineStore('orderentry', {
|
||||
form.tutar = Number((adet * Number(form.fiyat || 0)).toFixed(2))
|
||||
|
||||
const newRow = toSummaryRowFromForm(form)
|
||||
if (!newRow) {
|
||||
$q?.notify?.({
|
||||
type: 'negative',
|
||||
message: 'Beden grubu eşleşmesi bulunamadı.'
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
/* =======================================================
|
||||
5️⃣ EDIT MODE (editingKey ZORUNLU)
|
||||
@@ -2327,14 +2418,15 @@ export const useOrderEntryStore = defineStore('orderentry', {
|
||||
detectBedenGroup(
|
||||
Object.keys(srcMap || {}),
|
||||
raw.urunAnaGrubu || raw.UrunAnaGrubu || '',
|
||||
raw.kategori || raw.Kategori || raw.urunAltGrubu || raw.UrunAltGrubu || '',
|
||||
raw.kategori || raw.Kategori || '',
|
||||
raw.yetiskinGarson ||
|
||||
raw.YETISKIN_GARSON ||
|
||||
raw.YetiskinGarson ||
|
||||
raw.AskiliYan ||
|
||||
raw.ASKILIYAN ||
|
||||
raw.askiliyan ||
|
||||
''
|
||||
'',
|
||||
raw.urunAltGrubu || raw.UrunAltGrubu || ''
|
||||
) ||
|
||||
'tak'
|
||||
|
||||
@@ -2393,7 +2485,12 @@ export const useOrderEntryStore = defineStore('orderentry', {
|
||||
|
||||
urunAnaGrubu: raw.UrunAnaGrubu || 'GENEL',
|
||||
urunAltGrubu: raw.UrunAltGrubu || '',
|
||||
kategori: raw.Kategori || raw.UrunAltGrubu || '',
|
||||
kategori:
|
||||
raw.Kategori ||
|
||||
raw.YETISKIN_GARSON ||
|
||||
raw.YetiskinGarson ||
|
||||
raw.yetiskinGarson ||
|
||||
'',
|
||||
yetiskinGarson:
|
||||
raw.YETISKIN_GARSON ||
|
||||
raw.YetiskinGarson ||
|
||||
@@ -2458,8 +2555,9 @@ export const useOrderEntryStore = defineStore('orderentry', {
|
||||
const grpKey = detectBedenGroup(
|
||||
bedenList,
|
||||
row.urunAnaGrubu,
|
||||
row.kategori || row.urunAltGrubu,
|
||||
row.yetiskinGarson
|
||||
row.kategori || '',
|
||||
row.yetiskinGarson,
|
||||
row.urunAltGrubu || ''
|
||||
)
|
||||
|
||||
const cleanedMap = { ...row.__tmpMap }
|
||||
@@ -2655,11 +2753,36 @@ export const useOrderEntryStore = defineStore('orderentry', {
|
||||
// 🔸 GRUP ANAHTARI TESPİTİ
|
||||
// =======================================================
|
||||
activeGroupKeyForRow(row) {
|
||||
const bedenSet = new Set()
|
||||
|
||||
if (row?.bedenMap && typeof row.bedenMap === 'object') {
|
||||
const grp = row?.grpKey && row.bedenMap[row.grpKey] && typeof row.bedenMap[row.grpKey] === 'object'
|
||||
? row.bedenMap[row.grpKey]
|
||||
: null
|
||||
|
||||
if (grp) {
|
||||
Object.keys(grp).forEach(k => bedenSet.add(String(k || '')))
|
||||
} else {
|
||||
Object.values(row.bedenMap).forEach(m => {
|
||||
if (m && typeof m === 'object') {
|
||||
Object.keys(m).forEach(k => bedenSet.add(String(k || '')))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (bedenSet.size === 0 && Array.isArray(row?.bedenLabels)) {
|
||||
row.bedenLabels.forEach(lbl => {
|
||||
bedenSet.add(String(lbl == null ? '' : lbl))
|
||||
})
|
||||
}
|
||||
|
||||
return detectBedenGroup(
|
||||
null,
|
||||
Array.from(bedenSet),
|
||||
row?.urunAnaGrubu || '',
|
||||
row?.kategori || row?.urunAltGrubu || '',
|
||||
row?.YETISKIN_GARSON || row?.yetiskinGarson || ''
|
||||
row?.kategori || '',
|
||||
row?.YETISKIN_GARSON || row?.yetiskinGarson || '',
|
||||
row?.urunAltGrubu || ''
|
||||
)
|
||||
},
|
||||
/* =======================================================
|
||||
@@ -3621,16 +3744,113 @@ export function normalizeBeden(v) {
|
||||
return normalizeBedenLabel(v)
|
||||
}
|
||||
|
||||
function deriveKategoriToken(urunKategori = '', yetiskinGarson = '') {
|
||||
const kat = normalizeTextForMatch(urunKategori || '')
|
||||
if (kat.includes('GARSON')) return 'GARSON'
|
||||
if (kat.includes('YETISKIN')) return 'YETISKIN'
|
||||
return ''
|
||||
}
|
||||
|
||||
function normalizeRuleAltGroup(urunAltGrubu = '') {
|
||||
return normalizeTextForMatch(urunAltGrubu || '')
|
||||
}
|
||||
|
||||
function pickBestGroupFromCandidates(groupKeys = [], bedenList = []) {
|
||||
if (!Array.isArray(groupKeys) || groupKeys.length === 0) return ''
|
||||
if (groupKeys.length === 1) return groupKeys[0]
|
||||
|
||||
const normalizedBeden = (Array.isArray(bedenList) ? bedenList : [])
|
||||
.map(v => normalizeBedenLabel(v))
|
||||
.filter(Boolean)
|
||||
|
||||
if (!normalizedBeden.length) return groupKeys[0]
|
||||
|
||||
let bestKey = groupKeys[0]
|
||||
let bestScore = -1
|
||||
|
||||
for (const key of groupKeys) {
|
||||
const schema = Array.isArray(productSizeMatchCache.schemas?.[key])
|
||||
? productSizeMatchCache.schemas[key]
|
||||
: []
|
||||
const normalizedSchema = new Set(schema.map(v => normalizeBedenLabel(v)))
|
||||
let score = 0
|
||||
for (const b of normalizedBeden) {
|
||||
if (normalizedSchema.has(b)) score += 1
|
||||
}
|
||||
if (score > bestScore) {
|
||||
bestScore = score
|
||||
bestKey = key
|
||||
}
|
||||
}
|
||||
|
||||
return bestKey || groupKeys[0]
|
||||
}
|
||||
|
||||
function resolveGroupFromProductSizeMatchRules(
|
||||
bedenList,
|
||||
urunAnaGrubu = '',
|
||||
urunKategori = '',
|
||||
yetiskinGarson = '',
|
||||
urunAltGrubu = ''
|
||||
) {
|
||||
if (!productSizeMatchCache.loaded || !Array.isArray(productSizeMatchCache.rules) || !productSizeMatchCache.rules.length) {
|
||||
return ''
|
||||
}
|
||||
|
||||
const kategoriToken = deriveKategoriToken(urunKategori, yetiskinGarson)
|
||||
const ana = normalizeTextForMatch(urunAnaGrubu || '')
|
||||
const alt = normalizeRuleAltGroup(urunAltGrubu)
|
||||
if (!kategoriToken || !ana) return ''
|
||||
|
||||
const candidateGroupKeys = []
|
||||
for (const rule of productSizeMatchCache.rules) {
|
||||
if (!rule?.urunAnaGrubu || rule.urunAnaGrubu !== ana) continue
|
||||
if (rule.kategori !== kategoriToken) continue
|
||||
const ruleAlt = normalizeTextForMatch(rule.urunAltGrubu || '')
|
||||
if (ruleAlt !== alt) continue
|
||||
for (const g of (rule.groupKeys || [])) {
|
||||
const key = String(g || '').trim()
|
||||
if (key && !candidateGroupKeys.includes(key)) {
|
||||
candidateGroupKeys.push(key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!candidateGroupKeys.length) return ''
|
||||
return pickBestGroupFromCandidates(candidateGroupKeys, bedenList)
|
||||
}
|
||||
|
||||
/* ===========================================================
|
||||
Size Group Detection
|
||||
- Core logic aligned with backend detectBedenGroupGo
|
||||
- Keeps frontend aksbir bucket for accessory lines
|
||||
=========================================================== */
|
||||
export function detectBedenGroup(bedenList, urunAnaGrubu = '', urunKategori = '', yetiskinGarson = '') {
|
||||
export function detectBedenGroup(bedenList, urunAnaGrubu = '', urunKategori = '', yetiskinGarson = '', urunAltGrubu = '') {
|
||||
const list = Array.isArray(bedenList) && bedenList.length > 0
|
||||
? bedenList.map(v => (v || '').toString().trim().toUpperCase())
|
||||
: [' ']
|
||||
|
||||
const ruleBased = resolveGroupFromProductSizeMatchRules(
|
||||
list,
|
||||
urunAnaGrubu,
|
||||
urunKategori,
|
||||
yetiskinGarson,
|
||||
urunAltGrubu
|
||||
)
|
||||
if (productSizeMatchCache.loaded) {
|
||||
if (!ruleBased) {
|
||||
console.warn('⚠ product-size-match eşleşme bulunamadı', {
|
||||
kategori: deriveKategoriToken(urunKategori, yetiskinGarson),
|
||||
urunAnaGrubu: normalizeTextForMatch(urunAnaGrubu || ''),
|
||||
urunAltGrubu: normalizeRuleAltGroup(urunAltGrubu),
|
||||
bedenList: list
|
||||
})
|
||||
}
|
||||
return ruleBased || ''
|
||||
}
|
||||
|
||||
return ''
|
||||
|
||||
const rawAna = normalizeTextForMatch(urunAnaGrubu || '')
|
||||
const rawKat = normalizeTextForMatch(urunKategori || '')
|
||||
const rawYetiskinGarson = normalizeTextForMatch(yetiskinGarson || '')
|
||||
@@ -3672,6 +3892,12 @@ export function detectBedenGroup(bedenList, urunAnaGrubu = '', urunKategori = ''
|
||||
return 'yas'
|
||||
}
|
||||
|
||||
// Ayakkabi kurali garsondan once uygulanmali:
|
||||
// GARSON + AYAKKABI => ayk_garson, digerleri => ayk
|
||||
if (mappedRawAna.includes('AYAKKABI') || rawKat.includes('AYAKKABI')) {
|
||||
return hasGarsonSignal ? 'ayk_garson' : 'ayk'
|
||||
}
|
||||
|
||||
const hasGarson = hasGarsonSignal
|
||||
if (hasGarson) return 'yas'
|
||||
|
||||
@@ -3721,7 +3947,8 @@ export function detectBedenGroup(bedenList, urunAnaGrubu = '', urunKategori = ''
|
||||
export function toSummaryRowFromForm(form) {
|
||||
if (!form) return null
|
||||
|
||||
const grpKey = form.grpKey || 'tak'
|
||||
const grpKey = form.grpKey
|
||||
if (!grpKey) return null
|
||||
const bedenMap = {}
|
||||
|
||||
const labels = Array.isArray(form.bedenLabels) ? form.bedenLabels : []
|
||||
|
||||
Reference in New Issue
Block a user