Fix product performance grouped JSON build
This commit is contained in:
@@ -457,7 +457,7 @@
|
||||
|
||||
<div v-else class="column q-gutter-md pcd-content-body">
|
||||
<div
|
||||
v-for="(grp, gi) in detailGroups"
|
||||
v-for="(grp, gi) in detailGroupsWithTotals"
|
||||
:key="groupKey(grp, gi)"
|
||||
class="pcd-group-card"
|
||||
>
|
||||
@@ -2911,6 +2911,26 @@ function shouldIncludeRowInGroupTotal (grp, row) {
|
||||
return normalizedValue !== '0' && normalizedValue !== 'false' && normalizedValue !== 'hayir'
|
||||
}
|
||||
|
||||
// OrderEntry groupedRows ile ayni desen: sub-header degerleri ayri bir
|
||||
// state/cache icinde tutulmaz; iki gorunen tutar kolonu satirlardan reaktif
|
||||
// olarak her degisiklikte yeniden toplanir.
|
||||
const detailGroupsWithTotals = computed(() => (
|
||||
detailGroups.value.map(group => {
|
||||
const totals = (Array.isArray(group?.items) ? group.items : []).reduce((acc, row) => {
|
||||
if (!shouldIncludeRowInGroupTotal(group, row)) return acc
|
||||
acc.tryTotal += parseMoneyInput(row?.lTutar)
|
||||
acc.usdTotal += resolveRowUSDTutar(row)
|
||||
return acc
|
||||
}, { tryTotal: 0, usdTotal: 0 })
|
||||
|
||||
return {
|
||||
...group,
|
||||
tryTotal: totals.tryTotal,
|
||||
usdTotal: totals.usdTotal
|
||||
}
|
||||
})
|
||||
))
|
||||
|
||||
function refreshLiveGroupTotals () {
|
||||
// Totals are derived directly from reactive rows. The revision only forces
|
||||
// Quasar's table/sub-header render after an in-place row edit.
|
||||
@@ -2972,19 +2992,11 @@ function resolveRenderedGroupRowCount (groupIndex) {
|
||||
}
|
||||
|
||||
function resolveGroupTRYTutar (groupIndex, _revision) {
|
||||
const grp = detailGroups.value[groupIndex]
|
||||
return (Array.isArray(grp?.items) ? grp.items : []).reduce((total, row) => {
|
||||
if (!shouldIncludeRowInGroupTotal(grp, row)) return total
|
||||
return total + resolveRowTRYTutar(row)
|
||||
}, 0)
|
||||
return parseMoneyInput(detailGroupsWithTotals.value[groupIndex]?.tryTotal)
|
||||
}
|
||||
|
||||
function resolveGroupUSDTutar (groupIndex, _revision) {
|
||||
const grp = detailGroups.value[groupIndex]
|
||||
return (Array.isArray(grp?.items) ? grp.items : []).reduce((total, row) => {
|
||||
if (!shouldIncludeRowInGroupTotal(grp, row)) return total
|
||||
return total + resolveRowUSDTutar(row)
|
||||
}, 0)
|
||||
return parseMoneyInput(detailGroupsWithTotals.value[groupIndex]?.usdTotal)
|
||||
}
|
||||
|
||||
function resolveGroupQuantity (grp) {
|
||||
|
||||
Reference in New Issue
Block a user