Fix product performance grouped JSON build
This commit is contained in:
@@ -2891,20 +2891,25 @@ function shouldIncludeRowInGroupTotal (grp, row) {
|
|||||||
return normalizedValue !== '0' && normalizedValue !== 'false' && normalizedValue !== 'hayir'
|
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) {
|
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)
|
total + (shouldIncludeRowInGroupTotal(grp, row) ? resolveRowTRYTutar(row) : 0)
|
||||||
), 0)
|
), 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
function resolveGroupUSDTutar (grp, _revision) {
|
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)
|
total + (shouldIncludeRowInGroupTotal(grp, row) ? resolveRowUSDTutar(row) : 0)
|
||||||
), 0)
|
), 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
function resolveGroupQuantity (grp) {
|
function resolveGroupQuantity (grp) {
|
||||||
return (Array.isArray(grp?.items) ? grp.items : []).reduce((total, row) => (
|
return rowsForGroupTotal(grp).reduce((total, row) => (
|
||||||
total + resolveNumericRowQuantity(row)
|
total + resolveNumericRowQuantity(row)
|
||||||
), 0)
|
), 0)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user