Fix product performance grouped JSON build

This commit is contained in:
M_Kececi
2026-08-19 00:45:58 +03:00
parent 5f1c37859b
commit 2d85a33623
@@ -457,7 +457,7 @@
<div v-else class="column q-gutter-md pcd-content-body"> <div v-else class="column q-gutter-md pcd-content-body">
<div <div
v-for="(grp, gi) in detailGroups" v-for="(grp, gi) in detailGroupsWithTotals"
:key="groupKey(grp, gi)" :key="groupKey(grp, gi)"
class="pcd-group-card" class="pcd-group-card"
> >
@@ -2911,6 +2911,26 @@ function shouldIncludeRowInGroupTotal (grp, row) {
return normalizedValue !== '0' && normalizedValue !== 'false' && normalizedValue !== 'hayir' 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 () { function refreshLiveGroupTotals () {
// Totals are derived directly from reactive rows. The revision only forces // Totals are derived directly from reactive rows. The revision only forces
// Quasar's table/sub-header render after an in-place row edit. // Quasar's table/sub-header render after an in-place row edit.
@@ -2972,19 +2992,11 @@ function resolveRenderedGroupRowCount (groupIndex) {
} }
function resolveGroupTRYTutar (groupIndex, _revision) { function resolveGroupTRYTutar (groupIndex, _revision) {
const grp = detailGroups.value[groupIndex] return parseMoneyInput(detailGroupsWithTotals.value[groupIndex]?.tryTotal)
return (Array.isArray(grp?.items) ? grp.items : []).reduce((total, row) => {
if (!shouldIncludeRowInGroupTotal(grp, row)) return total
return total + resolveRowTRYTutar(row)
}, 0)
} }
function resolveGroupUSDTutar (groupIndex, _revision) { function resolveGroupUSDTutar (groupIndex, _revision) {
const grp = detailGroups.value[groupIndex] return parseMoneyInput(detailGroupsWithTotals.value[groupIndex]?.usdTotal)
return (Array.isArray(grp?.items) ? grp.items : []).reduce((total, row) => {
if (!shouldIncludeRowInGroupTotal(grp, row)) return total
return total + resolveRowUSDTutar(row)
}, 0)
} }
function resolveGroupQuantity (grp) { function resolveGroupQuantity (grp) {