From 569e22e4f8818b43e8da74c780ab47400fd2b17f Mon Sep 17 00:00:00 2001 From: M_Kececi Date: Tue, 17 Mar 2026 14:04:53 +0300 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ui/src/pages/AccountAgingStatement.vue | 2 +- ui/src/stores/statementAgingStore.js | 30 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/ui/src/pages/AccountAgingStatement.vue b/ui/src/pages/AccountAgingStatement.vue index 66482c9..1e30ab3 100644 --- a/ui/src/pages/AccountAgingStatement.vue +++ b/ui/src/pages/AccountAgingStatement.vue @@ -616,7 +616,7 @@ function formatAmount(value, fraction = 2) { .detail-subtable :deep(thead th) { position: sticky; - top: 108px; + top: 72px; z-index: 22; background: #1f3b5b; color: #fff; diff --git a/ui/src/stores/statementAgingStore.js b/ui/src/stores/statementAgingStore.js index 08a8c8f..017738b 100644 --- a/ui/src/stores/statementAgingStore.js +++ b/ui/src/stores/statementAgingStore.js @@ -174,6 +174,26 @@ export const useStatementAgingStore = defineStore('statementAging', { currencyByMaster[key].sort((a, b) => String(a.doc_currency_code).localeCompare(String(b.doc_currency_code), 'en', { sensitivity: 'base' })) } + for (const key of Object.keys(detailMap)) { + detailMap[key].sort((a, b) => { + const aOpen = isAcikKalem(a?.aciklama) + const bOpen = isAcikKalem(b?.aciklama) + if (aOpen !== bOpen) { + return aOpen ? -1 : 1 + } + + const aDate = toSortableDate(a) + const bDate = toSortableDate(b) + if (aDate !== bDate) { + return bDate - aDate + } + + const aRef = String(a?.fatura_ref || '') + const bRef = String(b?.fatura_ref || '') + return aRef.localeCompare(bRef, 'tr', { sensitivity: 'base' }) + }) + } + this.currencyRowsByMaster = currencyByMaster this.detailByCurrency = detailMap }, @@ -219,3 +239,13 @@ function normalizeRowKeys(row) { doc_currency_code: row.DocCurrencyCode ?? row.doc_currency_code ?? null } } + +function isAcikKalem(value) { + return String(value || '').trim().toUpperCase() === 'ACIKKALEM' +} + +function toSortableDate(row) { + const raw = row?.odeme_doc_date || row?.odeme_tarihi || row?.fatura_tarihi || '' + const t = Date.parse(String(raw || '').trim()) + return Number.isFinite(t) ? t : 0 +}