Fix product performance grouped JSON build

This commit is contained in:
M_Kececi
2026-08-18 21:39:53 +03:00
parent f14a96a024
commit 36e0ec9ff5
@@ -2891,20 +2891,25 @@ function shouldIncludeRowInGroupTotal (grp, row) {
return normalizedValue !== '0' && normalizedValue !== 'false' && normalizedValue !== 'hayir'
}
function rowsForGroupTotal (grp) {
const groupName = normalizeGroupName(grp?.sAciklama3)
return flatDetailRows.value.filter(row => normalizeGroupName(row?.sAciklama3) === groupName)
}
function resolveGroupTRYTutar (grp, _revision) {
return (Array.isArray(grp?.items) ? grp.items : []).reduce((total, row) => (
return rowsForGroupTotal(grp).reduce((total, row) => (
total + (shouldIncludeRowInGroupTotal(grp, row) ? resolveRowTRYTutar(row) : 0)
), 0)
}
function resolveGroupUSDTutar (grp, _revision) {
return (Array.isArray(grp?.items) ? grp.items : []).reduce((total, row) => (
return rowsForGroupTotal(grp).reduce((total, row) => (
total + (shouldIncludeRowInGroupTotal(grp, row) ? resolveRowUSDTutar(row) : 0)
), 0)
}
function resolveGroupQuantity (grp) {
return (Array.isArray(grp?.items) ? grp.items : []).reduce((total, row) => (
return rowsForGroupTotal(grp).reduce((total, row) => (
total + resolveNumericRowQuantity(row)
), 0)
}