Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -47,7 +47,12 @@
|
||||
<template #append>
|
||||
<q-icon name="event" class="cursor-pointer">
|
||||
<q-popup-proxy cover transition-show="scale" transition-hide="scale">
|
||||
<q-date v-model="dateFrom" mask="YYYY-MM-DD" locale="tr-TR"/>
|
||||
<q-date
|
||||
v-model="dateFrom"
|
||||
mask="YYYY-MM-DD"
|
||||
locale="tr-TR"
|
||||
:options="isValidFromDate"
|
||||
/>
|
||||
</q-popup-proxy>
|
||||
</q-icon>
|
||||
</template>
|
||||
@@ -63,7 +68,12 @@
|
||||
<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-date
|
||||
v-model="dateTo"
|
||||
mask="YYYY-MM-DD"
|
||||
locale="tr-TR"
|
||||
:options="isValidToDate"
|
||||
/>
|
||||
</q-popup-proxy>
|
||||
</q-icon>
|
||||
</template>
|
||||
@@ -334,6 +344,29 @@ onMounted(async () => {
|
||||
const dateFrom = ref(dayjs().startOf('year').format('YYYY-MM-DD'))
|
||||
const dateTo = ref(dayjs().format('YYYY-MM-DD'))
|
||||
|
||||
function isValidFromDate (date) {
|
||||
if (!dateTo.value) return true
|
||||
return !dayjs(date).isAfter(dayjs(dateTo.value), 'day')
|
||||
}
|
||||
|
||||
function isValidToDate (date) {
|
||||
if (!dateFrom.value) return true
|
||||
return !dayjs(date).isBefore(dayjs(dateFrom.value), 'day')
|
||||
}
|
||||
|
||||
function hasInvalidDateRange () {
|
||||
if (!dateFrom.value || !dateTo.value) return false
|
||||
return dayjs(dateFrom.value).isAfter(dayjs(dateTo.value), 'day')
|
||||
}
|
||||
|
||||
function notifyInvalidDateRange () {
|
||||
$q.notify({
|
||||
type: 'warning',
|
||||
message: '⚠️ Başlangıç tarihi bitiş tarihinden sonra olamaz.',
|
||||
position: 'top-right'
|
||||
})
|
||||
}
|
||||
|
||||
/* Parasal İşlem Tipi */
|
||||
const monetaryTypeOptions = [
|
||||
{ label: '1-2 hesap', value: ['1', '2'] },
|
||||
@@ -375,6 +408,11 @@ async function onFilterClick() {
|
||||
return
|
||||
}
|
||||
|
||||
if (hasInvalidDateRange()) {
|
||||
notifyInvalidDateRange()
|
||||
return
|
||||
}
|
||||
|
||||
await statementheaderStore.loadStatements({
|
||||
startdate: dateFrom.value,
|
||||
enddate: dateTo.value,
|
||||
@@ -485,6 +523,11 @@ async function handleDownload() {
|
||||
return
|
||||
}
|
||||
|
||||
if (hasInvalidDateRange()) {
|
||||
notifyInvalidDateRange()
|
||||
return
|
||||
}
|
||||
|
||||
// ✅ Seçilen parasal işlem tipini gönder
|
||||
const result = await downloadstpdfStore.downloadPDF(
|
||||
selectedCari.value, // accountCode
|
||||
@@ -526,6 +569,11 @@ async function CurrheadDownload() {
|
||||
return
|
||||
}
|
||||
|
||||
if (hasInvalidDateRange()) {
|
||||
notifyInvalidDateRange()
|
||||
return
|
||||
}
|
||||
|
||||
// ✅ Yeni store fonksiyonu doğru şekilde çağrılıyor
|
||||
const result = await downloadstHeadStore.handlestHeadDownload(
|
||||
selectedCari.value, // accountCode
|
||||
|
||||
Reference in New Issue
Block a user