moved filter

This commit is contained in:
2025-04-05 19:35:36 +02:00
parent 267b68283f
commit 8604a18ed5

View File

@@ -64,7 +64,6 @@ const clearSearchString = () => {
} }
const filterAccount = ref(bankaccounts || []) const filterAccount = ref(bankaccounts || [])
const showOnlyNotAssigned = ref(true)
const displayCurrency = (value, currency = "€") => { const displayCurrency = (value, currency = "€") => {
return `${Number(value).toFixed(2).replace(".",",")} ${currency}` return `${Number(value).toFixed(2).replace(".",",")} ${currency}`
@@ -82,9 +81,17 @@ const calculateOpenSum = (statement) => {
return (Math.abs(statement.amount) - startingAmount).toFixed(2) return (Math.abs(statement.amount) - startingAmount).toFixed(2)
} }
const selectedFilters = ref(['Nur offene anzeigen'])
const filteredRows = computed(() => { const filteredRows = computed(() => {
return useSearch(searchString.value, bankstatements.value.filter(i => filterAccount.value.find(x => x.id === i.account) && (showOnlyNotAssigned.value ? Number(calculateOpenSum(i)) !== 0 : true))) let temp = bankstatements.value
if(selectedFilters.value.includes("Nur offene anzeigen")){
temp = temp.filter(i => Number(calculateOpenSum(i)) !== 0)
}
return useSearch(searchString.value, temp.filter(i => filterAccount.value.find(x => x.id === i.account)))
}) })
setupPage() setupPage()
@@ -131,11 +138,6 @@ setupPage()
Konto Konto
</template> </template>
</USelectMenu> </USelectMenu>
<UCheckbox
v-model="showOnlyNotAssigned"
class="my-auto ml-3"
label="Nur offene anzeigen"
/>
</template> </template>
<template #right> <template #right>
<USelectMenu <USelectMenu
@@ -151,6 +153,18 @@ setupPage()
Spalten Spalten
</template> </template>
</USelectMenu> </USelectMenu>
<USelectMenu
icon="i-heroicons-adjustments-horizontal-solid"
multiple
v-model="selectedFilters"
:options="['Nur offene anzeigen']"
:color="selectedFilters.length > 0 ? 'primary' : 'white'"
:ui-menu="{ width: 'min-w-max' }"
>
<template #label>
Filter
</template>
</USelectMenu>
</template> </template>
</UDashboardToolbar> </UDashboardToolbar>
<UTable <UTable