Merge remote-tracking branch 'origin/master'
This commit is contained in:
669
ui/src/pages/AccountAgingStatement.vue
Normal file
669
ui/src/pages/AccountAgingStatement.vue
Normal file
@@ -0,0 +1,669 @@
|
||||
<template>
|
||||
<q-page v-if="canReadFinance" class="q-px-md q-pb-md q-pt-xs page-col statement-page">
|
||||
<div class="filter-sticky compact-filter q-pa-sm q-mb-xs">
|
||||
<div class="row q-col-gutter-sm items-end">
|
||||
<div class="col-12 col-md-5">
|
||||
<q-select
|
||||
v-model="selectedCari"
|
||||
:options="filteredOptions"
|
||||
label="Cari kod / isim"
|
||||
filled
|
||||
dense
|
||||
clearable
|
||||
use-input
|
||||
input-debounce="300"
|
||||
@filter="filterCari"
|
||||
emit-value
|
||||
map-options
|
||||
:loading="accountStore.loading"
|
||||
option-value="value"
|
||||
option-label="label"
|
||||
behavior="menu"
|
||||
:keep-selected="true"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-input v-model="dateTo" label="Son tarih" filled dense clearable readonly>
|
||||
<template #append>
|
||||
<q-icon name="event" class="cursor-pointer">
|
||||
<q-popup-proxy cover transition-show="scale" transition-hide="scale">
|
||||
<q-date v-model="dateTo" mask="YYYY-MM-DD" locale="tr-TR" />
|
||||
</q-popup-proxy>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
<q-select
|
||||
v-model="selectedMonType"
|
||||
:options="monetaryTypeOptions"
|
||||
label="Parasal İşlem Tipi"
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
dense
|
||||
/>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<q-btn color="primary" icon="filter_alt" label="Filtrele" @click="onFilterClick" />
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<q-btn flat color="grey-8" icon="restart_alt" label="Sıfırla" @click="resetFilters" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-scroll">
|
||||
<div class="sticky-bar row justify-end items-center q-pa-sm bg-grey-1">
|
||||
<q-btn-dropdown
|
||||
v-if="canExportFinance"
|
||||
flat
|
||||
color="red"
|
||||
icon="picture_as_pdf"
|
||||
label="Yazdır"
|
||||
class="q-mr-sm"
|
||||
>
|
||||
<q-list style="min-width: 220px">
|
||||
<q-item clickable v-close-popup @click="downloadAgingPDF">
|
||||
<q-item-section class="text-primary">
|
||||
Detaylı Yaşlandırma Ekstresi Yazdır
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-btn-dropdown>
|
||||
|
||||
<q-btn
|
||||
flat
|
||||
color="secondary"
|
||||
icon="list"
|
||||
:label="allDetailsOpen ? 'Tüm Detayları Kapat' : 'Tüm Detayları Aç'"
|
||||
@click="toggleAllDetails"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<q-table
|
||||
class="sticky-table statement-table"
|
||||
title="Cari Yaşlandırmalı Ekstre"
|
||||
:rows="agingStore.masterRows"
|
||||
:columns="masterColumns"
|
||||
row-key="group_key"
|
||||
flat
|
||||
bordered
|
||||
dense
|
||||
hide-bottom
|
||||
wrap-cells
|
||||
:rows-per-page-options="[0]"
|
||||
:loading="agingStore.loading"
|
||||
:table-style="{ tableLayout: 'fixed', width: '100%' }"
|
||||
>
|
||||
<template #header="props">
|
||||
<q-tr :props="props" class="header-row">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">{{ col.label }}</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
|
||||
<template #body="props">
|
||||
<q-tr :props="props" class="master-row">
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<q-btn
|
||||
v-if="col.name === 'expand'"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
size="sm"
|
||||
:icon="masterExpanded[props.row.group_key] ? 'expand_less' : 'expand_more'"
|
||||
@click="toggleMaster(props.row.group_key)"
|
||||
/>
|
||||
<span
|
||||
v-else-if="masterNumericCols.includes(col.name)"
|
||||
:class="['block', masterCenteredCols.includes(col.name) ? 'text-center' : 'text-right']"
|
||||
>
|
||||
{{ masterDayCols.includes(col.name) ? formatDay(props.row[col.field]) : formatAmount(props.row[col.field]) }}
|
||||
</span>
|
||||
<span v-else>{{ props.row[col.field] ?? '-' }}</span>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
|
||||
<q-tr v-if="masterExpanded[props.row.group_key]" class="master-sub-row">
|
||||
<q-td colspan="100%" class="q-pa-none">
|
||||
<div class="currency-groups">
|
||||
<div class="currency-level-head">
|
||||
<div class="cgh-cell cgh-expand"></div>
|
||||
<div class="cgh-cell cgh-code">Ana Cari Kod</div>
|
||||
<div class="cgh-cell cgh-code">Ana Cari Detay</div>
|
||||
<div class="cgh-cell cgh-code">Döviz Cinsi</div>
|
||||
<div class="cgh-cell cgh-num">Açık Kalem Tutarı</div>
|
||||
<div class="cgh-cell cgh-num">Açık Kalem USD</div>
|
||||
<div class="cgh-cell cgh-num">Açık Kalem TRY</div>
|
||||
<div class="cgh-cell cgh-center">Ort Gün</div>
|
||||
<div class="cgh-cell cgh-center">Ort Belge Gün</div>
|
||||
</div>
|
||||
<div
|
||||
v-for="currRow in agingStore.getCurrenciesByMaster(props.row.group_key)"
|
||||
:key="currRow.group_key"
|
||||
class="currency-group"
|
||||
>
|
||||
<div class="currency-group-header">
|
||||
<div class="cgh-cell cgh-expand">
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
round
|
||||
size="sm"
|
||||
:icon="currencyExpanded[currRow.group_key] ? 'expand_less' : 'expand_more'"
|
||||
@click="toggleCurrency(currRow.group_key)"
|
||||
/>
|
||||
</div>
|
||||
<div class="cgh-cell cgh-code">{{ currRow.cari8 }}</div>
|
||||
<div class="cgh-cell cgh-code">{{ currRow.cari_detay || '-' }}</div>
|
||||
<div class="cgh-cell cgh-code">{{ currRow.doviz_cinsi }}</div>
|
||||
<div class="cgh-cell cgh-num">{{ formatAmount(currRow.acik_kalem_tutari) }}</div>
|
||||
<div class="cgh-cell cgh-num">{{ formatAmount(currRow.acik_kalem_usd) }}</div>
|
||||
<div class="cgh-cell cgh-num">{{ formatAmount(currRow.acik_kalem_try) }}</div>
|
||||
<div class="cgh-cell cgh-center">{{ formatDay(currRow.ort_gun) }}</div>
|
||||
<div class="cgh-cell cgh-center">{{ formatDay(currRow.ort_belge_gun) }}</div>
|
||||
</div>
|
||||
|
||||
<div v-if="currencyExpanded[currRow.group_key]" class="detail-host-row">
|
||||
<q-table
|
||||
:rows="agingStore.getDetailsByCurrency(currRow.group_key)"
|
||||
:columns="detailColumns"
|
||||
row-key="detail_key"
|
||||
flat
|
||||
dense
|
||||
bordered
|
||||
hide-bottom
|
||||
:rows-per-page-options="[0]"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
class="detail-subtable"
|
||||
:table-style="{ minWidth: '1500px' }"
|
||||
>
|
||||
<template #body-cell-eslesen_tutar="d">
|
||||
<q-td :props="d" class="text-right">{{ formatAmount(d.row.eslesen_tutar) }}</q-td>
|
||||
</template>
|
||||
<template #body-cell-usd_tutar="d">
|
||||
<q-td :props="d" class="text-right">{{ formatAmount(d.row.usd_tutar) }}</q-td>
|
||||
</template>
|
||||
<template #body-cell-try_tutar="d">
|
||||
<q-td :props="d" class="text-right">{{ formatAmount(d.row.try_tutar) }}</q-td>
|
||||
</template>
|
||||
<template #body-cell-gun_sayisi="d">
|
||||
<q-td :props="d" class="text-center">{{ formatDay(d.row.gun_sayisi) }}</q-td>
|
||||
</template>
|
||||
<template #body-cell-gun_sayisi_docdate="d">
|
||||
<q-td :props="d" class="text-center">{{ formatDay(d.row.gun_sayisi_docdate) }}</q-td>
|
||||
</template>
|
||||
<template #body-cell-gun_kur="d">
|
||||
<q-td :props="d" class="text-center">{{ formatAmount(d.row.gun_kur, 2) }}</q-td>
|
||||
</template>
|
||||
<template #body-cell-aciklama="d">
|
||||
<q-td :props="d" class="text-center">{{ d.row.aciklama || '-' }}</q-td>
|
||||
</template>
|
||||
</q-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</q-table>
|
||||
</div>
|
||||
</q-page>
|
||||
|
||||
<q-page v-else class="q-pa-md flex flex-center">
|
||||
<div class="text-negative text-subtitle1">Bu modüle erişim yetkiniz yok.</div>
|
||||
</q-page>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useQuasar } from 'quasar'
|
||||
import dayjs from 'dayjs'
|
||||
import { usePermission } from 'src/composables/usePermission'
|
||||
import { useAccountStore } from 'src/stores/accountStore'
|
||||
import { useStatementAgingStore } from 'src/stores/statementAgingStore'
|
||||
import { download, extractApiErrorDetail } from 'src/services/api'
|
||||
|
||||
const { canRead, canExport } = usePermission()
|
||||
const canReadFinance = canRead('finance')
|
||||
const canExportFinance = canExport('finance')
|
||||
|
||||
const $q = useQuasar()
|
||||
const accountStore = useAccountStore()
|
||||
const agingStore = useStatementAgingStore()
|
||||
|
||||
const selectedCari = ref(null)
|
||||
const filteredOptions = ref([])
|
||||
const dateTo = ref(dayjs().format('YYYY-MM-DD'))
|
||||
|
||||
const masterExpanded = ref({})
|
||||
const currencyExpanded = ref({})
|
||||
const allDetailsOpen = ref(false)
|
||||
|
||||
const monetaryTypeOptions = [
|
||||
{ label: '1-2 hesap', value: ['1', '2'] },
|
||||
{ label: '1-3 r hesap', value: ['1', '3'] }
|
||||
]
|
||||
const selectedMonType = ref(monetaryTypeOptions[0].value)
|
||||
|
||||
const masterColumns = [
|
||||
{ name: 'expand', label: '', field: 'expand', align: 'center' },
|
||||
{ name: 'cari8', label: 'Ana Cari Kod', field: 'cari8', align: 'left', sortable: true },
|
||||
{ name: 'cari_detay', label: 'Ana Cari Detay', field: 'cari_detay', align: 'left', sortable: true },
|
||||
{ name: 'acik_kalem_tutari_usd', label: 'Açık Kalem Tutarı USD', field: 'acik_kalem_tutari_usd', align: 'right', sortable: true },
|
||||
{ name: 'acik_kalem_tutari_try', label: 'Açık Kalem Tutarı TRY', field: 'acik_kalem_tutari_try', align: 'right', sortable: true },
|
||||
{ name: 'acik_kalem_ort_vade_gun', label: 'Açık Kalem Ort Vade Gün', field: 'acik_kalem_ort_vade_gun', align: 'center', sortable: true },
|
||||
{ name: 'acik_kalem_ort_belge_gun', label: 'Açık Kalem Ort Belge Gün', field: 'acik_kalem_ort_belge_gun', align: 'center', sortable: true },
|
||||
{ name: 'normal_usd_tutar', label: 'Normal USD Tutar', field: 'normal_usd_tutar', align: 'right', sortable: true },
|
||||
{ name: 'normal_try_tutar', label: 'Normal TRY Tutar', field: 'normal_try_tutar', align: 'right', sortable: true },
|
||||
{ name: 'ortalama_vade_gun', label: 'Ortalama Vade Gün', field: 'ortalama_vade_gun', align: 'center', sortable: true },
|
||||
{ name: 'ortalama_belge_gun', label: 'Ortalama Belge Gün', field: 'ortalama_belge_gun', align: 'center', sortable: true }
|
||||
]
|
||||
|
||||
const detailColumns = [
|
||||
{ name: 'fatura_cari', label: 'Fatura Cari', field: 'fatura_cari', align: 'left' },
|
||||
{ name: 'odeme_cari', label: 'Ödeme Cari', field: 'odeme_cari', align: 'left' },
|
||||
{ name: 'doc_currency_code', label: 'Döviz Cinsi', field: 'doc_currency_code', align: 'left' },
|
||||
{ name: 'fatura_ref', label: 'Fatura Ref', field: 'fatura_ref', align: 'left' },
|
||||
{ name: 'odeme_ref', label: 'Ödeme Ref', field: 'odeme_ref', align: 'left' },
|
||||
{ name: 'fatura_tarihi', label: 'Fatura Tarihi', field: 'fatura_tarihi', align: 'left' },
|
||||
{ name: 'odeme_tarihi', label: 'Ödeme Vade', field: 'odeme_tarihi', align: 'left' },
|
||||
{ name: 'odeme_doc_date', label: 'Ödeme DocDate', field: 'odeme_doc_date', align: 'left' },
|
||||
{ name: 'eslesen_tutar', label: 'Eşleşen Tutar', field: 'eslesen_tutar', align: 'right' },
|
||||
{ name: 'usd_tutar', label: 'USD Tutar', field: 'usd_tutar', align: 'right' },
|
||||
{ name: 'try_tutar', label: 'TRY Tutar', field: 'try_tutar', align: 'right' },
|
||||
{ name: 'aciklama', label: 'Açıklama', field: 'aciklama', align: 'center' },
|
||||
{ name: 'gun_sayisi', label: 'Gün', field: 'gun_sayisi', align: 'center' },
|
||||
{ name: 'gun_sayisi_docdate', label: 'Gün (DocDate)', field: 'gun_sayisi_docdate', align: 'center' },
|
||||
{ name: 'gun_kur', label: 'Gün Kur', field: 'gun_kur', align: 'center' }
|
||||
]
|
||||
|
||||
const masterNumericCols = ['acik_kalem_tutari_usd', 'acik_kalem_tutari_try', 'acik_kalem_ort_vade_gun', 'acik_kalem_ort_belge_gun', 'normal_usd_tutar', 'normal_try_tutar', 'ortalama_vade_gun', 'ortalama_belge_gun']
|
||||
const masterDayCols = ['acik_kalem_ort_vade_gun', 'acik_kalem_ort_belge_gun', 'ortalama_vade_gun', 'ortalama_belge_gun']
|
||||
const masterCenteredCols = ['acik_kalem_ort_vade_gun', 'acik_kalem_ort_belge_gun', 'ortalama_vade_gun', 'ortalama_belge_gun']
|
||||
|
||||
function normalizeText(str) {
|
||||
return (str || '')
|
||||
.toString()
|
||||
.toLocaleLowerCase('tr-TR')
|
||||
.normalize('NFD')
|
||||
.replace(/[\u0300-\u036f]/g, '')
|
||||
.trim()
|
||||
}
|
||||
|
||||
function filterCari(val, update) {
|
||||
const needle = normalizeText(val)
|
||||
|
||||
update(() => {
|
||||
if (!needle) {
|
||||
filteredOptions.value = accountStore.accountOptions
|
||||
return
|
||||
}
|
||||
|
||||
filteredOptions.value = accountStore.accountOptions.filter(o => {
|
||||
const label = normalizeText(o.label)
|
||||
const value = normalizeText(o.value)
|
||||
return label.includes(needle) || value.includes(needle)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await accountStore.fetchAccounts()
|
||||
filteredOptions.value = accountStore.accountOptions
|
||||
})
|
||||
|
||||
async function onFilterClick() {
|
||||
if (!selectedCari.value || !dateTo.value) {
|
||||
$q.notify({
|
||||
type: 'warning',
|
||||
message: 'Lütfen cari ve son tarih seçiniz.',
|
||||
position: 'top-right'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await agingStore.load({
|
||||
accountcode: selectedCari.value,
|
||||
enddate: dateTo.value,
|
||||
parislemler: selectedMonType.value
|
||||
})
|
||||
|
||||
const m = {}
|
||||
const c = {}
|
||||
for (const row of agingStore.masterRows) {
|
||||
m[row.group_key] = true
|
||||
for (const cr of agingStore.getCurrenciesByMaster(row.group_key)) {
|
||||
c[cr.group_key] = true
|
||||
}
|
||||
}
|
||||
masterExpanded.value = m
|
||||
currencyExpanded.value = c
|
||||
allDetailsOpen.value = agingStore.masterRows.length > 0
|
||||
} catch (err) {
|
||||
const msg = await extractApiErrorDetail(err)
|
||||
$q.notify({
|
||||
type: 'negative',
|
||||
message: msg || 'Veriler yüklenemedi',
|
||||
position: 'top-right'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function resetFilters() {
|
||||
selectedCari.value = null
|
||||
dateTo.value = dayjs().format('YYYY-MM-DD')
|
||||
selectedMonType.value = monetaryTypeOptions[0].value
|
||||
masterExpanded.value = {}
|
||||
currencyExpanded.value = {}
|
||||
allDetailsOpen.value = false
|
||||
agingStore.reset()
|
||||
}
|
||||
|
||||
function toggleMaster(key) {
|
||||
masterExpanded.value[key] = !masterExpanded.value[key]
|
||||
}
|
||||
|
||||
function toggleCurrency(key) {
|
||||
currencyExpanded.value[key] = !currencyExpanded.value[key]
|
||||
}
|
||||
|
||||
function toggleAllDetails() {
|
||||
allDetailsOpen.value = !allDetailsOpen.value
|
||||
|
||||
if (!allDetailsOpen.value) {
|
||||
masterExpanded.value = {}
|
||||
currencyExpanded.value = {}
|
||||
return
|
||||
}
|
||||
|
||||
const m = {}
|
||||
const c = {}
|
||||
for (const row of agingStore.masterRows) {
|
||||
m[row.group_key] = true
|
||||
for (const cr of agingStore.getCurrenciesByMaster(row.group_key)) {
|
||||
c[cr.group_key] = true
|
||||
}
|
||||
}
|
||||
masterExpanded.value = m
|
||||
currencyExpanded.value = c
|
||||
}
|
||||
|
||||
function formatAmount(value, fraction = 2) {
|
||||
const n = Number(value || 0)
|
||||
return new Intl.NumberFormat('tr-TR', {
|
||||
minimumFractionDigits: fraction,
|
||||
maximumFractionDigits: fraction
|
||||
}).format(n)
|
||||
}
|
||||
|
||||
function formatDay(value) {
|
||||
const n = Number(value || 0)
|
||||
const v = Number.isFinite(n) ? Math.ceil(n) : 0
|
||||
return new Intl.NumberFormat('tr-TR', {
|
||||
minimumFractionDigits: 0,
|
||||
maximumFractionDigits: 0
|
||||
}).format(v)
|
||||
}
|
||||
|
||||
async function downloadAgingPDF () {
|
||||
if (!canExportFinance.value) {
|
||||
$q.notify({ type: 'negative', message: 'PDF export yetkiniz yok', position: 'top-right' })
|
||||
return
|
||||
}
|
||||
|
||||
if (!selectedCari.value || !dateTo.value) {
|
||||
$q.notify({ type: 'warning', message: 'Lütfen cari ve son tarih seçiniz.', position: 'top-right' })
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
const blob = await download('/finance/account-aging-statement/export-pdf', {
|
||||
accountcode: selectedCari.value,
|
||||
enddate: dateTo.value,
|
||||
parislemler: selectedMonType.value
|
||||
})
|
||||
const pdfUrl = window.URL.createObjectURL(new Blob([blob], { type: 'application/pdf' }))
|
||||
window.open(pdfUrl, '_blank')
|
||||
} catch (err) {
|
||||
const detail = await extractApiErrorDetail(err?.original || err)
|
||||
$q.notify({
|
||||
type: 'negative',
|
||||
message: detail || 'PDF oluşturulamadı',
|
||||
position: 'top-right'
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.statement-page {
|
||||
--master-head-h: 34px;
|
||||
--lvl2-head-h: 34px;
|
||||
--lvl3-head-h: 34px;
|
||||
height: calc(100vh - 56px);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.table-scroll {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.compact-filter {
|
||||
border: 1px solid rgba(0, 0, 0, 0.12);
|
||||
border-radius: 8px;
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.sticky-bar {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 30;
|
||||
flex: 0 0 auto;
|
||||
background: var(--q-secondary);
|
||||
color: #fff;
|
||||
border: 1px solid rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.statement-table {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.statement-table :deep(.q-table__container) {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.statement-table :deep(.q-table__top) {
|
||||
flex: 0 0 auto;
|
||||
position: static;
|
||||
}
|
||||
|
||||
.statement-table :deep(.q-table__middle) {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
overflow: auto !important;
|
||||
max-height: none !important;
|
||||
}
|
||||
|
||||
.statement-table :deep(.header-row th) {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 30;
|
||||
height: var(--master-head-h);
|
||||
background: var(--q-primary);
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.22);
|
||||
box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.2), 0 1px 0 rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.statement-table :deep(.master-row td) {
|
||||
background: color-mix(in srgb, var(--q-secondary) 12%, white);
|
||||
border-bottom: 2px solid rgba(0, 0, 0, 0.18);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.statement-table :deep(.master-row td:first-child) {
|
||||
border-left: 3px solid var(--q-primary);
|
||||
}
|
||||
|
||||
.statement-table :deep(.master-sub-row td) {
|
||||
background: #f4f6fb;
|
||||
border-bottom: 8px solid #fff;
|
||||
vertical-align: top;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.currency-groups {
|
||||
padding: 6px;
|
||||
background: #f8faff;
|
||||
}
|
||||
|
||||
.currency-group {
|
||||
border-left: 4px solid var(--q-secondary);
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.08);
|
||||
border-right: 1px solid rgba(0, 0, 0, 0.08);
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
||||
margin-bottom: 8px;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.currency-level-head {
|
||||
position: sticky;
|
||||
top: var(--master-head-h);
|
||||
z-index: 27;
|
||||
display: grid;
|
||||
grid-template-columns: 48px 120px 280px 110px 1fr 1fr 1fr 120px 150px;
|
||||
align-items: center;
|
||||
gap: 0;
|
||||
background: var(--q-secondary);
|
||||
color: #fff;
|
||||
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||
margin-bottom: 6px;
|
||||
min-height: var(--lvl2-head-h);
|
||||
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.currency-group-header {
|
||||
position: sticky;
|
||||
top: calc(var(--master-head-h) + var(--lvl2-head-h));
|
||||
z-index: 26;
|
||||
display: grid;
|
||||
grid-template-columns: 48px 120px 280px 110px 1fr 1fr 1fr 120px 150px;
|
||||
align-items: center;
|
||||
gap: 0;
|
||||
background: #4c5f7a;
|
||||
color: #fff;
|
||||
min-height: var(--lvl3-head-h);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.18);
|
||||
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
|
||||
}
|
||||
|
||||
.cgh-cell {
|
||||
padding: 6px 8px;
|
||||
border-right: 1px solid rgba(255, 255, 255, 0.2);
|
||||
font-weight: 600;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.cgh-cell:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.cgh-num {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.cgh-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.cgh-expand {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.detail-host-row :deep(td) {
|
||||
background: #fdfdfd;
|
||||
padding: 6px !important;
|
||||
}
|
||||
|
||||
.detail-subtable {
|
||||
border-left: 4px solid var(--q-primary);
|
||||
border-top: 1px solid rgba(0, 0, 0, 0.08);
|
||||
border-right: 1px solid rgba(0, 0, 0, 0.08);
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.statement-table :deep(th),
|
||||
.statement-table :deep(td),
|
||||
.detail-subtable :deep(th),
|
||||
.detail-subtable :deep(td) {
|
||||
padding: 3px 6px !important;
|
||||
font-size: 11px !important;
|
||||
line-height: 1.2 !important;
|
||||
}
|
||||
|
||||
.detail-subtable :deep(.q-table__top) {
|
||||
position: static;
|
||||
}
|
||||
|
||||
.detail-subtable :deep(.q-table__middle) {
|
||||
overflow: visible !important;
|
||||
max-height: none !important;
|
||||
}
|
||||
|
||||
.detail-subtable :deep(thead th) {
|
||||
position: sticky;
|
||||
top: calc(var(--master-head-h) + var(--lvl2-head-h) + var(--lvl3-head-h));
|
||||
z-index: 25;
|
||||
background: #1f3b5b;
|
||||
color: #fff;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.2);
|
||||
box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.detail-subtable :deep(td[data-col="gun_sayisi"]),
|
||||
.detail-subtable :deep(td[data-col="gun_sayisi_docdate"]),
|
||||
.detail-subtable :deep(td[data-col="gun_kur"]),
|
||||
.detail-subtable :deep(td[data-col="aciklama"]),
|
||||
.detail-subtable :deep(th[data-col="gun_sayisi"]),
|
||||
.detail-subtable :deep(th[data-col="gun_sayisi_docdate"]),
|
||||
.detail-subtable :deep(th[data-col="gun_kur"]),
|
||||
.detail-subtable :deep(th[data-col="aciklama"]),
|
||||
.statement-table :deep(td[data-col="acik_kalem_ort_vade_gun"]),
|
||||
.statement-table :deep(td[data-col="acik_kalem_ort_belge_gun"]),
|
||||
.statement-table :deep(td[data-col="ortalama_vade_gun"]),
|
||||
.statement-table :deep(td[data-col="ortalama_belge_gun"]),
|
||||
.statement-table :deep(th[data-col="acik_kalem_ort_vade_gun"]),
|
||||
.statement-table :deep(th[data-col="acik_kalem_ort_belge_gun"]),
|
||||
.statement-table :deep(th[data-col="ortalama_vade_gun"]),
|
||||
.statement-table :deep(th[data-col="ortalama_belge_gun"]) {
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
@media (max-width: 1366px) {
|
||||
.statement-table :deep(th),
|
||||
.statement-table :deep(td),
|
||||
.detail-subtable :deep(th),
|
||||
.detail-subtable :deep(td) {
|
||||
font-size: 10px !important;
|
||||
padding: 2px 4px !important;
|
||||
}
|
||||
|
||||
.currency-group-header {
|
||||
grid-template-columns: 44px 100px 220px 90px 1fr 1fr 1fr 90px 120px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
13
ui/src/pages/AgedCustomerBalanceListDummy.vue
Normal file
13
ui/src/pages/AgedCustomerBalanceListDummy.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<q-page class="q-pa-md">
|
||||
<q-card flat bordered class="q-pa-lg">
|
||||
<div class="text-h6">Cari Yaşlandırmalı Cari Bakiye Listesi</div>
|
||||
<div class="text-subtitle2 q-mt-sm text-grey-7">
|
||||
Dummy ekran hazır. Bu modülün filtre ve tablo kurgusu bir sonraki adımda eklenecek.
|
||||
</div>
|
||||
</q-card>
|
||||
</q-page>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
</script>
|
||||
13
ui/src/pages/AgedStatementDummy.vue
Normal file
13
ui/src/pages/AgedStatementDummy.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<q-page class="q-pa-md">
|
||||
<q-card flat bordered class="q-pa-lg">
|
||||
<div class="text-h6">Cari Yaşlandırmalı Ekstre</div>
|
||||
<div class="text-subtitle2 q-mt-sm text-grey-7">
|
||||
Dummy ekran hazır. Bu modülün filtre ve tablo kurgusu bir sonraki adımda eklenecek.
|
||||
</div>
|
||||
</q-card>
|
||||
</q-page>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
</script>
|
||||
@@ -1,263 +1,43 @@
|
||||
<template>
|
||||
<template>
|
||||
<q-page v-if="canReadFinance" class="q-pa-md page-layout">
|
||||
<div class="filter-sticky">
|
||||
<div class="row q-col-gutter-sm q-mb-md">
|
||||
<div class="col-12 col-sm-6 col-md-4">
|
||||
<q-input
|
||||
v-model="store.filters.cariSearch"
|
||||
filled
|
||||
dense
|
||||
label="Cari Kodu / Cari Adı"
|
||||
@keyup.enter="store.applyCariSearch()"
|
||||
>
|
||||
<template #append>
|
||||
<q-btn
|
||||
dense
|
||||
flat
|
||||
round
|
||||
icon="search"
|
||||
@click="store.applyCariSearch()"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
<div class="top-actions row q-col-gutter-sm items-end q-mb-sm">
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-input
|
||||
v-model="store.filters.selectedDate"
|
||||
label="Tarih"
|
||||
filled
|
||||
dense
|
||||
readonly
|
||||
>
|
||||
<template #append>
|
||||
<q-icon name="event" class="cursor-pointer">
|
||||
<q-popup-proxy cover transition-show="scale" transition-hide="scale">
|
||||
<q-date v-model="store.filters.selectedDate" mask="YYYY-MM-DD" />
|
||||
</q-popup-proxy>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-input
|
||||
v-model="store.filters.selectedDate"
|
||||
label="Tarih"
|
||||
filled
|
||||
dense
|
||||
readonly
|
||||
>
|
||||
<template #append>
|
||||
<q-icon name="event" class="cursor-pointer">
|
||||
<q-popup-proxy cover transition-show="scale" transition-hide="scale">
|
||||
<q-date v-model="store.filters.selectedDate" mask="YYYY-MM-DD" />
|
||||
</q-popup-proxy>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
<q-toggle
|
||||
v-model="store.filters.excludeZeroBalance12"
|
||||
dense
|
||||
label="1_2 Bakiyesi Sıfır Olanları Alma"
|
||||
@update:model-value="onToggle12Changed"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-select
|
||||
v-model="store.filters.cariIlkGrup"
|
||||
:options="store.cariIlkGrupOptions"
|
||||
multiple
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
dense
|
||||
options-dense
|
||||
class="compact-select"
|
||||
label="Cari İlk Grup"
|
||||
:display-value="selectionLabel(store.filters.cariIlkGrup, 'Cari İlk Grup')"
|
||||
>
|
||||
<template #before-options>
|
||||
<q-item clickable dense @click.stop="store.selectAll('cariIlkGrup', store.cariIlkGrupOptions)">
|
||||
<q-item-section>Tümünü Seç</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable dense @click.stop="store.clearAll('cariIlkGrup')">
|
||||
<q-item-section>Tümünü Temizle</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
<q-checkbox :model-value="scope.selected" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6 col-md-3">
|
||||
<q-toggle
|
||||
v-model="store.filters.excludeZeroBalance13"
|
||||
dense
|
||||
label="1_3 Bakiyesi Sıfır Olanları Alma"
|
||||
@update:model-value="onToggle13Changed"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-select
|
||||
v-model="store.filters.piyasa"
|
||||
:options="store.piyasaOptions"
|
||||
multiple
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
dense
|
||||
options-dense
|
||||
class="compact-select"
|
||||
label="Piyasa"
|
||||
:display-value="selectionLabel(store.filters.piyasa, 'Piyasa')"
|
||||
>
|
||||
<template #before-options>
|
||||
<q-item clickable dense @click.stop="store.selectAll('piyasa', store.piyasaOptions)">
|
||||
<q-item-section>Tümünü Seç</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable dense @click.stop="store.clearAll('piyasa')">
|
||||
<q-item-section>Tümünü Temizle</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
<q-checkbox :model-value="scope.selected" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-select
|
||||
v-model="store.filters.temsilci"
|
||||
:options="store.temsilciOptions"
|
||||
multiple
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
dense
|
||||
options-dense
|
||||
class="compact-select"
|
||||
label="Temsilci"
|
||||
:display-value="selectionLabel(store.filters.temsilci, 'Temsilci')"
|
||||
>
|
||||
<template #before-options>
|
||||
<q-item clickable dense @click.stop="store.selectAll('temsilci', store.temsilciOptions)">
|
||||
<q-item-section>Tümünü Seç</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable dense @click.stop="store.clearAll('temsilci')">
|
||||
<q-item-section>Tümünü Temizle</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
<q-checkbox :model-value="scope.selected" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-select
|
||||
v-model="store.filters.riskDurumu"
|
||||
:options="store.riskDurumuOptions"
|
||||
multiple
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
dense
|
||||
options-dense
|
||||
class="compact-select"
|
||||
label="Risk Durumu"
|
||||
:display-value="selectionLabel(store.filters.riskDurumu, 'Risk Durumu')"
|
||||
>
|
||||
<template #before-options>
|
||||
<q-item clickable dense @click.stop="store.selectAll('riskDurumu', store.riskDurumuOptions)">
|
||||
<q-item-section>Tümünü Seç</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable dense @click.stop="store.clearAll('riskDurumu')">
|
||||
<q-item-section>Tümünü Temizle</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
<q-checkbox :model-value="scope.selected" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-select
|
||||
v-model="store.filters.islemTipi"
|
||||
:options="islemTipiOptions"
|
||||
multiple
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
dense
|
||||
options-dense
|
||||
class="compact-select"
|
||||
label="İşlem Tipi"
|
||||
:display-value="selectionLabel(store.filters.islemTipi, 'İşlem Tipi')"
|
||||
>
|
||||
<template #before-options>
|
||||
<q-item clickable dense @click.stop="store.selectAll('islemTipi', islemTipiOptions)">
|
||||
<q-item-section>Tümünü Seç</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable dense @click.stop="store.clearAll('islemTipi')">
|
||||
<q-item-section>Tümünü Temizle</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
<q-checkbox :model-value="scope.selected" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-select
|
||||
v-model="store.filters.ulke"
|
||||
:options="store.ulkeOptions"
|
||||
multiple
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
dense
|
||||
options-dense
|
||||
class="compact-select"
|
||||
label="Ülke (Özellik05)"
|
||||
:display-value="selectionLabel(store.filters.ulke, 'Ülke')"
|
||||
>
|
||||
<template #before-options>
|
||||
<q-item clickable dense @click.stop="store.selectAll('ulke', store.ulkeOptions)">
|
||||
<q-item-section>Tümünü Seç</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable dense @click.stop="store.clearAll('ulke')">
|
||||
<q-item-section>Tümünü Temizle</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
<q-checkbox :model-value="scope.selected" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row q-col-gutter-sm q-mb-md">
|
||||
<div class="col-auto">
|
||||
<q-btn
|
||||
color="primary"
|
||||
@@ -279,140 +59,472 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="filters-panel q-pa-sm q-mb-md">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-12 col-sm-6 col-md-4">
|
||||
<q-input
|
||||
v-model="store.filters.cariSearch"
|
||||
filled
|
||||
dense
|
||||
label="Cari Kodu / Cari Adı"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-select
|
||||
v-model="store.filters.cariIlkGrup"
|
||||
:options="store.cariIlkGrupOptions"
|
||||
multiple
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
dense
|
||||
options-dense
|
||||
class="compact-select"
|
||||
label="Cari İlk Grup"
|
||||
:display-value="selectionLabel(store.filters.cariIlkGrup, 'Cari İlk Grup')"
|
||||
>
|
||||
<template #before-options>
|
||||
<q-item clickable dense @click.stop="store.selectAll('cariIlkGrup', store.cariIlkGrupOptions)">
|
||||
<q-item-section>Tümünü Seç</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable dense @click.stop="store.clearAll('cariIlkGrup')">
|
||||
<q-item-section>Tümünü Temizle</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
<q-checkbox :model-value="scope.selected" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-select
|
||||
v-model="store.filters.piyasa"
|
||||
:options="store.piyasaOptions"
|
||||
multiple
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
dense
|
||||
options-dense
|
||||
class="compact-select"
|
||||
label="Piyasa"
|
||||
:display-value="selectionLabel(store.filters.piyasa, 'Piyasa')"
|
||||
>
|
||||
<template #before-options>
|
||||
<q-item clickable dense @click.stop="store.selectAll('piyasa', store.piyasaOptions)">
|
||||
<q-item-section>Tümünü Seç</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable dense @click.stop="store.clearAll('piyasa')">
|
||||
<q-item-section>Tümünü Temizle</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
<q-checkbox :model-value="scope.selected" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-select
|
||||
v-model="store.filters.temsilci"
|
||||
:options="store.temsilciOptions"
|
||||
multiple
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
dense
|
||||
options-dense
|
||||
class="compact-select"
|
||||
label="Temsilci"
|
||||
:display-value="selectionLabel(store.filters.temsilci, 'Temsilci')"
|
||||
>
|
||||
<template #before-options>
|
||||
<q-item clickable dense @click.stop="store.selectAll('temsilci', store.temsilciOptions)">
|
||||
<q-item-section>Tümünü Seç</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable dense @click.stop="store.clearAll('temsilci')">
|
||||
<q-item-section>Tümünü Temizle</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
<q-checkbox :model-value="scope.selected" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-select
|
||||
v-model="store.filters.riskDurumu"
|
||||
:options="store.riskDurumuOptions"
|
||||
multiple
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
dense
|
||||
options-dense
|
||||
class="compact-select"
|
||||
label="Risk Durumu"
|
||||
:display-value="selectionLabel(store.filters.riskDurumu, 'Risk Durumu')"
|
||||
>
|
||||
<template #before-options>
|
||||
<q-item clickable dense @click.stop="store.selectAll('riskDurumu', store.riskDurumuOptions)">
|
||||
<q-item-section>Tümünü Seç</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable dense @click.stop="store.clearAll('riskDurumu')">
|
||||
<q-item-section>Tümünü Temizle</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
<q-checkbox :model-value="scope.selected" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-select
|
||||
v-model="store.filters.islemTipi"
|
||||
:options="islemTipiOptions"
|
||||
multiple
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
dense
|
||||
options-dense
|
||||
class="compact-select"
|
||||
label="İşlem Tipi"
|
||||
:display-value="selectionLabel(store.filters.islemTipi, 'İşlem Tipi')"
|
||||
>
|
||||
<template #before-options>
|
||||
<q-item clickable dense @click.stop="store.selectAll('islemTipi', islemTipiOptions)">
|
||||
<q-item-section>Tümünü Seç</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable dense @click.stop="store.clearAll('islemTipi')">
|
||||
<q-item-section>Tümünü Temizle</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
<q-checkbox :model-value="scope.selected" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-select
|
||||
v-model="store.filters.ulke"
|
||||
:options="store.ulkeOptions"
|
||||
multiple
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
dense
|
||||
options-dense
|
||||
class="compact-select"
|
||||
label="Ülke"
|
||||
:display-value="selectionLabel(store.filters.ulke, 'Ülke')"
|
||||
>
|
||||
<template #before-options>
|
||||
<q-item clickable dense @click.stop="store.selectAll('ulke', store.ulkeOptions)">
|
||||
<q-item-section>Tümünü Seç</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable dense @click.stop="store.clearAll('ulke')">
|
||||
<q-item-section>Tümünü Temizle</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
<q-checkbox :model-value="scope.selected" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-select
|
||||
v-model="store.filters.il"
|
||||
:options="store.ilOptions"
|
||||
multiple
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
dense
|
||||
options-dense
|
||||
class="compact-select"
|
||||
label="İl"
|
||||
:display-value="selectionLabel(store.filters.il, 'İl')"
|
||||
>
|
||||
<template #before-options>
|
||||
<q-item clickable dense @click.stop="store.selectAll('il', store.ilOptions)">
|
||||
<q-item-section>Tümünü Seç</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable dense @click.stop="store.clearAll('il')">
|
||||
<q-item-section>Tümünü Temizle</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
<q-checkbox :model-value="scope.selected" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-6 col-md-2">
|
||||
<q-select
|
||||
v-model="store.filters.ilce"
|
||||
:options="store.ilceOptions"
|
||||
multiple
|
||||
emit-value
|
||||
map-options
|
||||
filled
|
||||
dense
|
||||
options-dense
|
||||
class="compact-select"
|
||||
label="İlçe"
|
||||
:display-value="selectionLabel(store.filters.ilce, 'İlçe')"
|
||||
>
|
||||
<template #before-options>
|
||||
<q-item clickable dense @click.stop="store.selectAll('ilce', store.ilceOptions)">
|
||||
<q-item-section>Tümünü Seç</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable dense @click.stop="store.clearAll('ilce')">
|
||||
<q-item-section>Tümünü Temizle</q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
</template>
|
||||
<template #option="scope">
|
||||
<q-item v-bind="scope.itemProps">
|
||||
<q-item-section avatar>
|
||||
<q-checkbox :model-value="scope.selected" />
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.label }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<q-banner v-if="store.error" class="bg-red-1 text-negative q-mb-md rounded-borders">
|
||||
{{ store.error }}
|
||||
</q-banner>
|
||||
|
||||
<q-banner v-if="!store.hasFetched && !store.loading" class="bg-blue-1 text-primary q-mb-md rounded-borders">
|
||||
Bakiyeleri Getir Tuşuna Basmadan Sistem Çalışmaz
|
||||
Bakiyeleri Getir tuşuna basmadan sistem çalışmaz.
|
||||
</q-banner>
|
||||
</div>
|
||||
|
||||
<div class="table-area">
|
||||
<div class="sticky-bar row justify-end items-center q-pa-sm bg-grey-1">
|
||||
<q-btn
|
||||
flat
|
||||
color="secondary"
|
||||
icon="list"
|
||||
:label="allDetailsOpen ? 'Tüm Detayları Kapat' : 'Tüm Detayları Aç'"
|
||||
@click="toggleAllDetails"
|
||||
/>
|
||||
</div>
|
||||
<q-table
|
||||
title="Cari Bakiye Listesi"
|
||||
:rows="store.summaryRows"
|
||||
:columns="summaryColumns"
|
||||
row-key="group_key"
|
||||
:loading="store.loading"
|
||||
flat
|
||||
bordered
|
||||
dense
|
||||
wrap-cells
|
||||
separator="cell"
|
||||
hide-bottom
|
||||
:rows-per-page-options="[0]"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
:table-style="{ tableLayout: 'fixed', width: '100%' }"
|
||||
class="balance-table"
|
||||
>
|
||||
<template #header="props">
|
||||
<q-tr :props="props" class="header-row">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
{{ col.label }}
|
||||
</q-th>
|
||||
</q-tr>
|
||||
<q-tr class="totals-row">
|
||||
<q-th
|
||||
v-for="col in props.cols"
|
||||
:key="`tot-${col.name}`"
|
||||
:class="col.align === 'right' ? 'text-right' : ''"
|
||||
<div class="sticky-bar row justify-between items-center q-pa-sm bg-grey-1">
|
||||
<div />
|
||||
<div class="row items-center q-gutter-sm">
|
||||
<q-btn
|
||||
flat
|
||||
color="secondary"
|
||||
icon="list"
|
||||
:label="allDetailsOpen ? 'Tüm Detayları Kapat' : 'Tüm Detayları Aç'"
|
||||
@click="toggleAllDetails"
|
||||
/>
|
||||
<q-btn-dropdown
|
||||
v-if="canExportFinance"
|
||||
flat
|
||||
color="red"
|
||||
icon="picture_as_pdf"
|
||||
label="Yazdır"
|
||||
>
|
||||
{{ totalCellValue(col.name) }}
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
<q-list style="min-width: 240px">
|
||||
<q-item clickable v-close-popup @click="downloadCustomerBalancePDF(true)">
|
||||
<q-item-section class="text-primary">
|
||||
Detaylı Cari Bakiye Listesi Yazdır
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadCustomerBalancePDF(false)">
|
||||
<q-item-section class="text-secondary">
|
||||
Detaysız Cari Bakiye Listesi Yazdır
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-btn-dropdown>
|
||||
<q-btn
|
||||
v-if="canExportFinance"
|
||||
flat
|
||||
color="green-8"
|
||||
icon="table_view"
|
||||
label="Excel"
|
||||
@click="downloadCustomerBalanceExcel"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template #body="props">
|
||||
<q-tr :props="props" class="sub-header-row">
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<q-btn
|
||||
v-if="col.name === 'expand'"
|
||||
dense
|
||||
flat
|
||||
round
|
||||
size="sm"
|
||||
:icon="expanded[props.row.group_key] ? 'expand_less' : 'expand_more'"
|
||||
@click="toggleGroup(props.row.group_key)"
|
||||
/>
|
||||
<span v-else-if="col.name === 'prbr_1_2'" class="text-right block prbr-cell">
|
||||
{{ formatCurrencyMap(props.row.bakiye_1_2_map) }}
|
||||
</span>
|
||||
<span v-else-if="col.name === 'prbr_1_3'" class="text-right block prbr-cell">
|
||||
{{ formatCurrencyMap(props.row.bakiye_1_3_map) }}
|
||||
</span>
|
||||
<span v-else-if="staticMoneyFields.includes(col.name)" class="text-center block">
|
||||
{{ formatAmount(props.row[col.field]) }}
|
||||
</span>
|
||||
<span v-else-if="col.name === 'hesap_alinmayan_gun'" class="text-right block">
|
||||
-
|
||||
</span>
|
||||
<span v-else>
|
||||
{{ props.row[col.field] || '-' }}
|
||||
</span>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
<q-table
|
||||
title="Cari Bakiye Listesi"
|
||||
:rows="store.summaryRows"
|
||||
:columns="summaryColumns"
|
||||
row-key="group_key"
|
||||
:loading="store.loading"
|
||||
flat
|
||||
bordered
|
||||
dense
|
||||
wrap-cells
|
||||
separator="cell"
|
||||
hide-bottom
|
||||
:rows-per-page-options="[0]"
|
||||
:pagination="{ rowsPerPage: 0 }"
|
||||
:table-style="{ tableLayout: 'fixed', width: '100%' }"
|
||||
class="balance-table"
|
||||
>
|
||||
<template #header="props">
|
||||
<q-tr :props="props" class="header-row">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
{{ col.label }}
|
||||
</q-th>
|
||||
</q-tr>
|
||||
<q-tr class="totals-row">
|
||||
<q-th
|
||||
v-for="col in props.cols"
|
||||
:key="`tot-${col.name}`"
|
||||
:class="col.align === 'right' ? 'text-right' : ''"
|
||||
>
|
||||
{{ totalCellValue(col.name) }}
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
|
||||
<q-tr v-if="expanded[props.row.group_key]" class="detail-host-row">
|
||||
<q-td colspan="100%">
|
||||
<div class="detail-wrap">
|
||||
<q-table
|
||||
:rows="store.getDetailsByGroup(props.row.group_key)"
|
||||
:columns="detailColumns"
|
||||
row-key="cari_kodu"
|
||||
<template #body="props">
|
||||
<q-tr :props="props" class="sub-header-row">
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<q-btn
|
||||
v-if="col.name === 'expand'"
|
||||
dense
|
||||
flat
|
||||
bordered
|
||||
hide-bottom
|
||||
:table-style="{ tableLayout: 'fixed', width: '100%' }"
|
||||
class="detail-table"
|
||||
>
|
||||
<template #body-cell-prbr_1_2="scope">
|
||||
<q-td :props="scope" class="text-right prbr-cell">
|
||||
{{ formatRowPrBr(scope.row, '1_2') }}
|
||||
</q-td>
|
||||
</template>
|
||||
<template #body-cell-prbr_1_3="scope">
|
||||
<q-td :props="scope" class="text-right prbr-cell">
|
||||
{{ formatRowPrBr(scope.row, '1_3') }}
|
||||
</q-td>
|
||||
</template>
|
||||
</q-table>
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</q-table>
|
||||
round
|
||||
size="sm"
|
||||
:icon="expanded[props.row.group_key] ? 'expand_less' : 'expand_more'"
|
||||
@click="toggleGroup(props.row.group_key)"
|
||||
/>
|
||||
<span v-else-if="col.name === 'prbr_1_2'" class="text-right block prbr-cell">
|
||||
{{ formatCurrencyMap(props.row.bakiye_1_2_map) }}
|
||||
</span>
|
||||
<span v-else-if="col.name === 'prbr_1_3'" class="text-right block prbr-cell">
|
||||
{{ formatCurrencyMap(props.row.bakiye_1_3_map) }}
|
||||
</span>
|
||||
<span v-else-if="staticMoneyFields.includes(col.name)" class="text-center block">
|
||||
{{ formatAmount(props.row[col.field]) }}
|
||||
</span>
|
||||
<span v-else>{{ props.row[col.field] || '-' }}</span>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
|
||||
<q-tr v-if="expanded[props.row.group_key]" class="detail-host-row">
|
||||
<q-td colspan="100%">
|
||||
<div class="detail-wrap">
|
||||
<q-table
|
||||
:rows="store.getDetailsByGroup(props.row.group_key)"
|
||||
:columns="detailColumns"
|
||||
row-key="cari_kodu"
|
||||
dense
|
||||
flat
|
||||
bordered
|
||||
hide-bottom
|
||||
:table-style="{ tableLayout: 'fixed', width: '100%' }"
|
||||
class="detail-table"
|
||||
>
|
||||
<template #body-cell-prbr_1_2="scope">
|
||||
<q-td :props="scope" class="text-right prbr-cell">
|
||||
{{ formatRowPrBr(scope.row, '1_2') }}
|
||||
</q-td>
|
||||
</template>
|
||||
<template #body-cell-prbr_1_3="scope">
|
||||
<q-td :props="scope" class="text-right prbr-cell">
|
||||
{{ formatRowPrBr(scope.row, '1_3') }}
|
||||
</q-td>
|
||||
</template>
|
||||
</q-table>
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</q-table>
|
||||
</div>
|
||||
</q-page>
|
||||
|
||||
<q-page v-else class="q-pa-md flex flex-center">
|
||||
<div class="text-negative text-subtitle1">
|
||||
Bu module erisim yetkiniz yok.
|
||||
Bu modüle erişim yetkiniz yok.
|
||||
</div>
|
||||
</q-page>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useCustomerBalanceListStore } from 'src/stores/customerBalanceListStore'
|
||||
import { usePermission } from 'src/composables/usePermission'
|
||||
import { download, extractApiErrorDetail } from 'src/services/api'
|
||||
|
||||
const store = useCustomerBalanceListStore()
|
||||
const expanded = ref({})
|
||||
const allDetailsOpen = ref(false)
|
||||
const $q = useQuasar()
|
||||
|
||||
const { canRead } = usePermission()
|
||||
const { canRead, canExport } = usePermission()
|
||||
const canReadFinance = canRead('finance')
|
||||
const canExportFinance = canExport('finance')
|
||||
|
||||
const islemTipiOptions = [
|
||||
{ label: '1_2 Bakiye Pr.Br', value: 'prbr_1_2' },
|
||||
@@ -422,14 +534,49 @@ const islemTipiOptions = [
|
||||
{ label: '1_3 USD Bakiye', value: 'usd_1_3' },
|
||||
{ label: '1_3 TRY Bakiye', value: 'try_1_3' }
|
||||
]
|
||||
|
||||
const staticMoneyFields = ['usd_bakiye_1_2', 'tl_bakiye_1_2', 'usd_bakiye_1_3', 'tl_bakiye_1_3']
|
||||
|
||||
function toNumericSortValue (value) {
|
||||
if (typeof value === 'number') {
|
||||
return Number.isFinite(value) ? value : 0
|
||||
}
|
||||
|
||||
const s = String(value ?? '').trim()
|
||||
if (!s) return 0
|
||||
|
||||
const hasComma = s.includes(',')
|
||||
const hasDot = s.includes('.')
|
||||
|
||||
let normalized = s.replace(/\s+/g, '')
|
||||
|
||||
if (hasComma && hasDot) {
|
||||
const lastComma = normalized.lastIndexOf(',')
|
||||
const lastDot = normalized.lastIndexOf('.')
|
||||
if (lastComma > lastDot) {
|
||||
normalized = normalized.replace(/\./g, '').replace(',', '.')
|
||||
} else {
|
||||
normalized = normalized.replace(/,/g, '')
|
||||
}
|
||||
} else if (hasComma) {
|
||||
normalized = normalized.replace(/\./g, '').replace(',', '.')
|
||||
}
|
||||
|
||||
const n = Number.parseFloat(normalized)
|
||||
return Number.isFinite(n) ? n : 0
|
||||
}
|
||||
|
||||
function sortTextTr (a, b) {
|
||||
return String(a ?? '').localeCompare(String(b ?? ''), 'tr', { sensitivity: 'base' })
|
||||
}
|
||||
|
||||
const metricDefs = {
|
||||
prbr_1_2: { name: 'prbr_1_2', label: '1_2 Bakiye\nPr.Br', field: 'prbr_1_2', align: 'right', sortable: false },
|
||||
prbr_1_3: { name: 'prbr_1_3', label: '1_3 Bakiye\nPr.Br', field: 'prbr_1_3', align: 'right', sortable: false },
|
||||
usd_1_2: { name: 'usd_bakiye_1_2', label: '1_2 USD_BAKIYE', field: 'usd_bakiye_1_2', align: 'center', sortable: true },
|
||||
try_1_2: { name: 'tl_bakiye_1_2', label: '1_2 TRY_BAKIYE', field: 'tl_bakiye_1_2', align: 'center', sortable: true },
|
||||
usd_1_3: { name: 'usd_bakiye_1_3', label: '1_3 USD_BAKIYE', field: 'usd_bakiye_1_3', align: 'center', sortable: true },
|
||||
try_1_3: { name: 'tl_bakiye_1_3', label: '1_3 TRY_BAKIYE', field: 'tl_bakiye_1_3', align: 'center', sortable: true }
|
||||
usd_1_2: { name: 'usd_bakiye_1_2', label: '1_2 USD_BAKIYE', field: 'usd_bakiye_1_2', align: 'center', sortable: true, sort: (a, b) => toNumericSortValue(a) - toNumericSortValue(b) },
|
||||
try_1_2: { name: 'tl_bakiye_1_2', label: '1_2 TRY_BAKIYE', field: 'tl_bakiye_1_2', align: 'center', sortable: true, sort: (a, b) => toNumericSortValue(a) - toNumericSortValue(b) },
|
||||
usd_1_3: { name: 'usd_bakiye_1_3', label: '1_3 USD_BAKIYE', field: 'usd_bakiye_1_3', align: 'center', sortable: true, sort: (a, b) => toNumericSortValue(a) - toNumericSortValue(b) },
|
||||
try_1_3: { name: 'tl_bakiye_1_3', label: '1_3 TRY_BAKIYE', field: 'tl_bakiye_1_3', align: 'center', sortable: true, sort: (a, b) => toNumericSortValue(a) - toNumericSortValue(b) }
|
||||
}
|
||||
|
||||
const selectedMetricKeys = computed(() => {
|
||||
@@ -440,15 +587,14 @@ const selectedMetricKeys = computed(() => {
|
||||
|
||||
const summaryColumns = computed(() => ([
|
||||
{ name: 'expand', label: '', field: 'expand', align: 'center', sortable: false },
|
||||
{ name: 'ana_cari_kodu', label: 'Ana Cari Kodu', field: 'ana_cari_kodu', align: 'left', sortable: true },
|
||||
{ name: 'ana_cari_adi', label: 'Ana Cari Detay', field: 'ana_cari_adi', align: 'left', sortable: true },
|
||||
{ name: 'piyasa', label: 'Piyasa', field: 'piyasa', align: 'left', sortable: true },
|
||||
{ name: 'temsilci', label: 'Temsilci', field: 'temsilci', align: 'left', sortable: true },
|
||||
{ name: 'risk_durumu', label: 'Risk Durumu', field: 'risk_durumu', align: 'left', sortable: true },
|
||||
...selectedMetricKeys.value.map(k => metricDefs[k]),
|
||||
{ name: 'hesap_alinmayan_gun', label: 'Hesap Alınmayan Gün', field: 'hesap_alinmayan_gun', align: 'right', sortable: false },
|
||||
{ name: 'kalan_fatura_ortalama_vade_tarihi', label: 'Kalan Fatura Ortalama Vade Tarihi', field: 'kalan_fatura_ortalama_vade_tarihi', align: 'left', sortable: true }
|
||||
{ name: 'ana_cari_kodu', label: 'Ana Cari Kodu', field: 'ana_cari_kodu', align: 'left', sortable: true, sort: sortTextTr },
|
||||
{ name: 'ana_cari_adi', label: 'Ana Cari Detay', field: 'ana_cari_adi', align: 'left', sortable: true, sort: sortTextTr },
|
||||
{ name: 'piyasa', label: 'Piyasa', field: 'piyasa', align: 'left', sortable: true, sort: sortTextTr },
|
||||
{ name: 'temsilci', label: 'Temsilci', field: 'temsilci', align: 'left', sortable: true, sort: sortTextTr },
|
||||
{ name: 'risk_durumu', label: 'Risk Durumu', field: 'risk_durumu', align: 'left', sortable: true, sort: sortTextTr },
|
||||
...selectedMetricKeys.value.map((k) => metricDefs[k])
|
||||
]))
|
||||
|
||||
const liveTotals = computed(() => {
|
||||
return store.filteredRows.reduce((acc, row) => {
|
||||
acc.usd_bakiye_1_2 += Number(row.usd_bakiye_1_2) || 0
|
||||
@@ -468,23 +614,36 @@ const detailColumns = computed(() => [
|
||||
{ name: 'cari_kodu', label: 'Cari Kodu', field: 'cari_kodu', align: 'left' },
|
||||
{ name: 'cari_detay', label: 'Cari Detay', field: 'cari_detay', align: 'left' },
|
||||
{ name: 'sirket', label: 'Şirket', field: 'sirket', align: 'left' },
|
||||
{ name: 'sirket_detay', label: 'Şirket Detayı', field: 'sirket_detay', align: 'left' },
|
||||
{ name: 'muhasebe_kodu', label: 'Muhasebe Kodu', field: 'muhasebe_kodu', align: 'left' },
|
||||
{ name: 'piyasa', label: 'Piyasa', field: 'piyasa', align: 'left' },
|
||||
{ name: 'temsilci', label: 'Temsilci', field: 'temsilci', align: 'left' },
|
||||
{ name: 'ozellik03', label: 'Risk Durumu', field: 'ozellik03', align: 'left' },
|
||||
{ name: 'risk_durumu', label: 'Risk Durumu', field: 'risk_durumu', align: 'left' },
|
||||
{ name: 'ozellik05', label: 'Ülke', field: 'ozellik05', align: 'left' },
|
||||
{ name: 'ozellik06', label: 'Özellik06', field: 'ozellik06', align: 'left' },
|
||||
{ name: 'ozellik07', label: 'Özellik07', field: 'ozellik07', align: 'left' },
|
||||
{ name: 'il', label: 'İl', field: 'il', align: 'left' },
|
||||
{ name: 'ilce', label: 'İlçe', field: 'ilce', align: 'left' },
|
||||
{ name: 'cari_doviz', label: 'Döviz', field: 'cari_doviz', align: 'left' },
|
||||
...selectedMetricKeys.value.map(k => metricDefs[k]),
|
||||
{ name: 'hesap_alinmayan_gun', label: 'Hesap Alınmayan Gün', field: 'hesap_alinmayan_gun', align: 'right' },
|
||||
{ name: 'kalan_fatura_ortalama_vade_tarihi', label: 'Kalan Fatura Ortalama Vade Tarihi', field: 'kalan_fatura_ortalama_vade_tarihi', align: 'left' }
|
||||
...selectedMetricKeys.value.map((k) => metricDefs[k])
|
||||
])
|
||||
|
||||
|
||||
function onReset () {
|
||||
store.resetFilters()
|
||||
store.applyCariSearch()
|
||||
}
|
||||
|
||||
function onToggle12Changed (val) {
|
||||
if (val) {
|
||||
store.filters.excludeZeroBalance13 = false
|
||||
}
|
||||
}
|
||||
|
||||
function onToggle13Changed (val) {
|
||||
if (val) {
|
||||
store.filters.excludeZeroBalance12 = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function toggleGroup (key) {
|
||||
expanded.value[key] = !expanded.value[key]
|
||||
if (!expanded.value[key]) {
|
||||
@@ -512,6 +671,97 @@ function toggleAllDetails () {
|
||||
expanded.value = {}
|
||||
}
|
||||
|
||||
async function downloadCustomerBalancePDF (detailed) {
|
||||
if (!canExportFinance.value) {
|
||||
$q.notify({ type: 'negative', message: 'PDF export yetkiniz yok', position: 'top-right' })
|
||||
return
|
||||
}
|
||||
|
||||
if (!store.hasFetched) {
|
||||
$q.notify({ type: 'warning', message: 'Önce Bakiyeleri Getir ile veri yükleyin.', position: 'top-right' })
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
const params = {
|
||||
selected_date: store.filters.selectedDate,
|
||||
cari_search: String(store.filters.cariSearch || '').trim(),
|
||||
cari_ilk_grup: (store.filters.cariIlkGrup || []).join(','),
|
||||
piyasa: (store.filters.piyasa || []).join(','),
|
||||
temsilci: (store.filters.temsilci || []).join(','),
|
||||
risk_durumu: (store.filters.riskDurumu || []).join(','),
|
||||
islem_tipi: (store.filters.islemTipi || []).join(','),
|
||||
ulke: (store.filters.ulke || []).join(','),
|
||||
il: (store.filters.il || []).join(','),
|
||||
ilce: (store.filters.ilce || []).join(','),
|
||||
exclude_zero_12: store.filters.excludeZeroBalance12 ? '1' : '0',
|
||||
exclude_zero_13: store.filters.excludeZeroBalance13 ? '1' : '0',
|
||||
detailed: detailed ? '1' : '0'
|
||||
}
|
||||
|
||||
const blob = await download('/finance/customer-balances/export-pdf', params)
|
||||
const pdfUrl = window.URL.createObjectURL(new Blob([blob], { type: 'application/pdf' }))
|
||||
window.open(pdfUrl, '_blank')
|
||||
} catch (err) {
|
||||
const detail = await extractApiErrorDetail(err?.original || err)
|
||||
$q.notify({
|
||||
type: 'negative',
|
||||
message: detail || 'PDF oluşturulamadı',
|
||||
position: 'top-right'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async function downloadCustomerBalanceExcel () {
|
||||
if (!canExportFinance.value) {
|
||||
$q.notify({ type: 'negative', message: 'Excel export yetkiniz yok', position: 'top-right' })
|
||||
return
|
||||
}
|
||||
|
||||
if (!store.hasFetched) {
|
||||
$q.notify({ type: 'warning', message: 'Önce Bakiyeleri Getir ile veri yükleyin.', position: 'top-right' })
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
const params = {
|
||||
selected_date: store.filters.selectedDate,
|
||||
cari_search: String(store.filters.cariSearch || '').trim(),
|
||||
cari_ilk_grup: (store.filters.cariIlkGrup || []).join(','),
|
||||
piyasa: (store.filters.piyasa || []).join(','),
|
||||
temsilci: (store.filters.temsilci || []).join(','),
|
||||
risk_durumu: (store.filters.riskDurumu || []).join(','),
|
||||
islem_tipi: (store.filters.islemTipi || []).join(','),
|
||||
ulke: (store.filters.ulke || []).join(','),
|
||||
il: (store.filters.il || []).join(','),
|
||||
ilce: (store.filters.ilce || []).join(','),
|
||||
exclude_zero_12: store.filters.excludeZeroBalance12 ? '1' : '0',
|
||||
exclude_zero_13: store.filters.excludeZeroBalance13 ? '1' : '0'
|
||||
}
|
||||
|
||||
const file = await download('/finance/customer-balances/export-excel', params)
|
||||
const blob = new Blob(
|
||||
[file],
|
||||
{ type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }
|
||||
)
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const a = document.createElement('a')
|
||||
a.href = url
|
||||
a.download = 'cari_bakiye_listesi.xlsx'
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
a.remove()
|
||||
window.URL.revokeObjectURL(url)
|
||||
} catch (err) {
|
||||
const detail = await extractApiErrorDetail(err?.original || err)
|
||||
$q.notify({
|
||||
type: 'negative',
|
||||
message: detail || 'Excel oluşturulamadı',
|
||||
position: 'top-right'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function formatAmount (value) {
|
||||
const n = Number(value || 0)
|
||||
return new Intl.NumberFormat('tr-TR', {
|
||||
@@ -538,7 +788,6 @@ function totalCellValue (colName) {
|
||||
if (colName === 'tl_bakiye_1_2') return formatAmount(liveTotals.value.tl_bakiye_1_2)
|
||||
if (colName === 'usd_bakiye_1_3') return formatAmount(liveTotals.value.usd_bakiye_1_3)
|
||||
if (colName === 'tl_bakiye_1_3') return formatAmount(liveTotals.value.tl_bakiye_1_3)
|
||||
if (colName === 'hesap_alinmayan_gun') return '-'
|
||||
return '-'
|
||||
}
|
||||
|
||||
@@ -564,7 +813,7 @@ function formatCurrencyMap (mapObj) {
|
||||
if (!entries.length) return '-'
|
||||
return entries
|
||||
.map(([curr, amount]) => `${curr}: ${formatAmount(amount)}`)
|
||||
.join(' | ')
|
||||
.join('\n')
|
||||
}
|
||||
|
||||
function formatRowPrBr (row, tip) {
|
||||
@@ -577,7 +826,6 @@ function formatRowPrBr (row, tip) {
|
||||
if (amount === 0) return '-'
|
||||
return `${curr} ${formatAmount(amount)}`
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -596,6 +844,12 @@ function formatRowPrBr (row, tip) {
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
|
||||
.filters-panel {
|
||||
border: 1px solid rgba(0, 0, 0, 0.12);
|
||||
border-radius: 8px;
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.compact-select :deep(.q-field__control) {
|
||||
min-height: 40px;
|
||||
}
|
||||
@@ -652,7 +906,7 @@ function formatRowPrBr (row, tip) {
|
||||
background: var(--q-primary);
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
font-family: "Roboto", sans-serif;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
}
|
||||
|
||||
.balance-table :deep(.totals-row th) {
|
||||
@@ -662,7 +916,7 @@ function formatRowPrBr (row, tip) {
|
||||
background: var(--q-secondary);
|
||||
color: var(--q-dark);
|
||||
font-weight: 700;
|
||||
font-family: "Roboto", sans-serif;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
@@ -701,7 +955,7 @@ function formatRowPrBr (row, tip) {
|
||||
}
|
||||
|
||||
.prbr-cell {
|
||||
white-space: normal;
|
||||
white-space: pre-line;
|
||||
word-break: break-word;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
13
ui/src/pages/CustomerBalanceListDummy.vue
Normal file
13
ui/src/pages/CustomerBalanceListDummy.vue
Normal file
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<q-page class="q-pa-md">
|
||||
<q-card flat bordered class="q-pa-lg">
|
||||
<div class="text-h6">Cari Bakiye Listesi</div>
|
||||
<div class="text-subtitle2 q-mt-sm text-grey-7">
|
||||
Dummy ekran hazır. Bu modülün filtre ve tablo kurgusu bir sonraki adımda eklenecek.
|
||||
</div>
|
||||
</q-card>
|
||||
</q-page>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
</script>
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<template>
|
||||
<q-page v-if="canReadFinance" class="q-pa-md page-col statement-page">
|
||||
|
||||
<!-- 🔹 Cari Kod / İsim (sabit) -->
|
||||
<!-- Cari Kod / İsim (sabit) -->
|
||||
<div class="filter-sticky">
|
||||
<q-select
|
||||
v-model="selectedCari"
|
||||
@@ -22,7 +22,7 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 🔹 Filtre Alanı -->
|
||||
<!-- Filtre Alanı -->
|
||||
<div class="filter-collapsible">
|
||||
<div class="row items-center justify-between q-pa-sm bg-grey-2">
|
||||
<div class="text-subtitle1">Filtreler</div>
|
||||
@@ -116,7 +116,7 @@
|
||||
</q-slide-transition>
|
||||
</div>
|
||||
|
||||
<!-- 🔹 Tablo Alanı -->
|
||||
<!-- Tablo Alanı -->
|
||||
<div class="table-scroll">
|
||||
|
||||
<!-- Toggle butonları (sticky üst bar) -->
|
||||
@@ -438,7 +438,7 @@ function toggleRowDetails(row) {
|
||||
expandedRows.value[row.belge_no] = !expandedRows.value[row.belge_no]
|
||||
}
|
||||
|
||||
/* 🔹 Tüm detayları aç/kapat */
|
||||
/* Tüm detayları aç/kapat */
|
||||
function toggleAllDetails() {
|
||||
allDetailsOpen.value = !allDetailsOpen.value
|
||||
if (allDetailsOpen.value) {
|
||||
@@ -454,7 +454,7 @@ function toggleAllDetails() {
|
||||
function normalizeText (str) {
|
||||
return (str || '')
|
||||
.toString()
|
||||
.toLocaleLowerCase('tr-TR') // 🔥 Türkçe uyumlu
|
||||
.toLocaleLowerCase('tr-TR') // Türkçe uyumlu
|
||||
.normalize('NFD') // aksan temizleme
|
||||
.replace(/[\u0300-\u036f]/g, '')
|
||||
.trim()
|
||||
@@ -480,7 +480,7 @@ function formatAmount(n) {
|
||||
|
||||
const filtersOpen = ref(true)
|
||||
|
||||
/* 🔹 Kolon gizle/göster */
|
||||
/* Kolon gizle/göster */
|
||||
const visibleColumns = ref([])
|
||||
const showLeftCols = ref(true)
|
||||
|
||||
@@ -501,7 +501,7 @@ function toggleLeftCols() {
|
||||
showLeftCols.value = !showLeftCols.value
|
||||
}
|
||||
|
||||
/* 🔹 PDF İndirme Butonuna bağla */
|
||||
/* PDF İndirme Butonuna bağla */
|
||||
async function handleDownload() {
|
||||
if (!canExportFinance.value) {
|
||||
$q.notify({
|
||||
@@ -536,14 +536,14 @@ async function handleDownload() {
|
||||
selectedMonType.value // <-- eklendi (['1','2'] veya ['1','3'])
|
||||
)
|
||||
|
||||
console.log("📤 [DEBUG] Store’dan gelen result:", result)
|
||||
console.log("[DEBUG] Store’dan gelen result:", result)
|
||||
|
||||
$q.notify({
|
||||
type: result.ok ? 'positive' : 'negative',
|
||||
message: result.message,
|
||||
position: 'top-right'
|
||||
})
|
||||
}/* 🔹 Cari Hesap Ekstresi (2. seçenek) */
|
||||
}/* Cari Hesap Ekstresi (2. seçenek) */
|
||||
import { useDownloadstHeadStore } from 'src/stores/downloadstHeadStore'
|
||||
|
||||
const downloadstHeadStore = useDownloadstHeadStore()
|
||||
@@ -582,7 +582,7 @@ async function CurrheadDownload() {
|
||||
selectedMonType.value // parasal işlem tipi (parislemler)
|
||||
)
|
||||
|
||||
console.log("📤 [DEBUG] CurrheadDownloadresult:", result)
|
||||
console.log("[DEBUG] CurrheadDownloadresult:", result)
|
||||
|
||||
$q.notify({
|
||||
type: result.ok ? 'positive' : 'negative',
|
||||
@@ -689,3 +689,4 @@ async function CurrheadDownload() {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user