This commit is contained in:
2024-06-02 21:39:26 +02:00
parent 4cd4a9c7c4
commit e139eb771c
9 changed files with 498 additions and 439 deletions

View File

@@ -312,7 +312,7 @@ let links = computed(() => {
... dataStore.ownTenant.features.vehicles ? [{ ... dataStore.ownTenant.features.vehicles ? [{
label: "Fahrzeuge", label: "Fahrzeuge",
to: "/vehicles", to: "/vehicles",
icon: "i-heroicons-truck" icon: "i-heroicons-truck",
}] : [], }] : [],
{ {
label: "Stammdaten", label: "Stammdaten",
@@ -476,7 +476,7 @@ const footerLinks = [/*{
<UDashboardSearchButton label="Suche..."/> <UDashboardSearchButton label="Suche..."/>
</template> </template>
<UDashboardSidebarLinks :links="links" > <UDashboardSidebarLinks :links="links">
</UDashboardSidebarLinks> </UDashboardSidebarLinks>
@@ -540,5 +540,7 @@ const footerLinks = [/*{
</template> </template>
<style scoped> <style scoped>
.testclass {
color: red;
}
</style> </style>

View File

@@ -1,3 +1,116 @@
<script setup>
import dayjs from "dayjs";
definePageMeta({
middleware: "auth"
})
defineShortcuts({
'/': () => {
//console.log(searchinput)
//searchinput.value.focus()
document.getElementById("searchinput").focus()
},
'escape': () => {
//console.log(searchinput)
//searchinput.value.focus()
showStatementModal.value = false
}
})
const dataStore = useDataStore()
const router = useRouter()
const supabase = useSupabaseClient()
const bankstatements = ref([])
const setupPage = async () => {
bankstatements.value = (await supabase.from("bankstatements").select("*, statementallocations(*)").eq('tenant', dataStore.currentTenant).order("date", {ascending:false})).data
}
const selectedStatement = ref(null)
const showStatementModal = ref(false)
const templateColumns = [
{
key: "account",
label: "Konto",
sortable: true
},{
key: "valueDate",
label: "Valuta",
sortable: true
},
{
key: "amount",
label: "Betrag",
sortable: true
},
{
key: "openAmount",
label: "Offener Betrag",
sortable: true
},
{
key: "partner",
label: "Name",
sortable: true
},
{
key: "text",
label: "Beschreibung",
sortable: true
}
]
const selectedColumns = ref(templateColumns)
const columns = computed(() => templateColumns.filter((column) => selectedColumns.value.includes(column)))
const searchString = ref('')
const filterAccount = ref(dataStore.bankAccounts || [])
const showOnlyNotAssigned = ref(true)
const displayCurrency = (value, currency = "€") => {
return `${Number(value).toFixed(2).replace(".",",")} ${currency}`
}
const getDocumentSum = (doc) => {
let sum = 0
doc.rows.forEach(row => {
if(row.mode === "normal" || row.mode === "service" || row.mode === "free") {
sum += row.quantity * row.price * (1 - row.discountPercent / 100) * (1 + row.taxPercent / 100)
}
})
return sum
}
const calculateOpenSum = (statement) => {
let startingAmount = statement.amount || 0
statement.statementallocations.forEach(item => {
if(item.cd_id) {
startingAmount = startingAmount - item.amount
} else if(item.ii_id) {
startingAmount = Number(startingAmount) + item.amount
}
})
return startingAmount.toFixed(2)
}
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)))
})
setupPage()
</script>
<template> <template>
<UDashboardNavbar title="Bankbuchungen"> <UDashboardNavbar title="Bankbuchungen">
<template #right> <template #right>
@@ -161,104 +274,7 @@
</UModal> </UModal>
</template> </template>
<script setup>
import dayjs from "dayjs";
definePageMeta({
middleware: "auth"
})
defineShortcuts({
'/': () => {
//console.log(searchinput)
//searchinput.value.focus()
document.getElementById("searchinput").focus()
},
'escape': () => {
//console.log(searchinput)
//searchinput.value.focus()
showStatementModal.value = false
}
})
const dataStore = useDataStore()
const router = useRouter()
const selectedStatement = ref(null)
const showStatementModal = ref(false)
const templateColumns = [
{
key: "account",
label: "Konto",
sortable: true
},{
key: "valueDate",
label: "Valuta",
sortable: true
},
{
key: "amount",
label: "Betrag",
sortable: true
},
{
key: "openAmount",
label: "Offener Betrag",
sortable: true
},
{
key: "partner",
label: "Name",
sortable: true
},
{
key: "text",
label: "Beschreibung",
sortable: true
}
]
const selectedColumns = ref(templateColumns)
const columns = computed(() => templateColumns.filter((column) => selectedColumns.value.includes(column)))
const searchString = ref('')
const filterAccount = ref(dataStore.bankAccounts || [])
const showOnlyNotAssigned = ref(true)
const displayCurrency = (value, currency = "€") => {
return `${Number(value).toFixed(2).replace(".",",")} ${currency}`
}
const getDocumentSum = (doc) => {
let sum = 0
doc.rows.forEach(row => {
if(row.mode === "normal" || row.mode === "service" || row.mode === "free") {
sum += row.quantity * row.price * (1 - row.discountPercent / 100) * (1 + row.taxPercent / 100)
}
})
return sum
}
const calculateOpenSum = (statement) => {
let startingAmount = statement.amount
statement.assignments.forEach(item => {
if(item.type === "createdDocument") {
let doc = dataStore.getCreatedDocumentById(item.id)
startingAmount = startingAmount - getDocumentSum(doc)
}
})
return startingAmount.toFixed(2)
}
const filteredRows = computed(() => {
return useSearch(searchString.value, dataStore.bankstatements.filter(i => filterAccount.value.find(x => x.id === i.account) && (showOnlyNotAssigned.value ? Number(calculateOpenSum(i)) !== 0 : true)))
})
</script>
<style scoped> <style scoped>

View File

@@ -16,16 +16,26 @@ const dataStore = useDataStore()
const route = useRoute() const route = useRoute()
const router = useRouter() const router = useRouter()
const mode = ref(route.params.mode || "show") const mode = ref(route.params.mode || "show")
const supabase = useSupabaseClient()
const itemInfo = ref({}) const itemInfo = ref({statementallocations:[]})
const oldItemInfo = ref({}) const oldItemInfo = ref({})
const setup = () => { const openDocuments = ref([])
const setup = async () => {
if(route.params.id) { if(route.params.id) {
itemInfo.value = dataStore.bankstatements.find(i => i.id === Number(route.params.id)) itemInfo.value = (await supabase.from("bankstatements").select("*, statementallocations(*)").eq("id",route.params.id).single()).data //dataStore.bankstatements.find(i => i.id === Number(route.params.id))
} }
if(itemInfo.value) oldItemInfo.value = JSON.parse(JSON.stringify(itemInfo.value)) if(itemInfo.value) oldItemInfo.value = JSON.parse(JSON.stringify(itemInfo.value))
openDocuments.value = (await supabase.from("createddocuments").select("*, statementallocations(*)")).data.filter(i => i.statementallocations.length === 0 || i.statementallocations.find(x => x.bs_id === itemInfo.value.id))
let allocations = (await supabase.from("createddocuments").select(`*, statementallocations(*)`).eq("id",50)).data
} }
const displayCurrency = (value, currency = "€") => { const displayCurrency = (value, currency = "€") => {
@@ -57,18 +67,29 @@ const getInvoiceSum = (invoice) => {
} }
const calculateOpenSum = computed(() => { const calculateOpenSum = computed(() => {
let startingAmount = itemInfo.value.amount let startingAmount = itemInfo.value.amount || 0
itemInfo.value.assignments.forEach(item => { itemInfo.value.statementallocations.forEach(item => {
if(item.type === "createdDocument") { if(item.cd_id) {
let doc = dataStore.getCreatedDocumentById(item.id) startingAmount = startingAmount - item.amount
startingAmount = startingAmount - getDocumentSum(doc) } else if(item.ii_id) {
startingAmount = Number(startingAmount) + item.amount
} }
}) })
return startingAmount.toFixed(2) return startingAmount.toFixed(2)
}) })
const saveAllocations = async () => {
let allocationsToBeSaved = itemInfo.value.statementallocations.filter(i => !i.id)
for await (let i of allocationsToBeSaved) {
await dataStore.createNewItem("statementallocations", i)
}
}
setup() setup()
@@ -89,13 +110,13 @@ setup()
</template> </template>
<template #center> <template #center>
<h1 <h1
:class="['text-xl','font-medium', ... itemInfo.incomingInvoice || itemInfo.createdDocument ? ['text-primary-500'] : ['text-rose-600']]" :class="['text-xl','font-medium', Number(calculateOpenSum) === 0 ? ['text-primary-500'] : ['text-rose-600']]"
>Kontobewegung bearbeiten</h1> >Kontobewegung bearbeiten</h1>
</template> </template>
<template #right> <template #right>
<UButton <UButton
v-if="mode === 'edit'" v-if="mode === 'edit'"
@click="dataStore.updateItem('bankstatements',itemInfo,oldItemInfo)" @click="saveAllocations"
> >
Speichern Speichern
</UButton> </UButton>
@@ -160,11 +181,11 @@ setup()
<span v-if="itemInfo.amount > 0" class="text-primary-500 font-semibold">{{itemInfo.amount.toFixed(2).replace(".",",")}} {{itemInfo.currency}}</span> <span v-if="itemInfo.amount > 0" class="text-primary-500 font-semibold">{{itemInfo.amount.toFixed(2).replace(".",",")}} {{itemInfo.currency}}</span>
<span v-else-if="itemInfo.amount < 0" class="text-rose-600 font-semibold">{{itemInfo.amount.toFixed(2).replace(".",",")}} {{itemInfo.currency}}</span> <span v-else-if="itemInfo.amount < 0" class="text-rose-600 font-semibold">{{itemInfo.amount.toFixed(2).replace(".",",")}} {{itemInfo.currency}}</span>
<span v-else>{{itemInfo.amount.toFixed(2).replace(".",",")}} {{itemInfo.currency}}</span> <span v-else>{{(itemInfo.amount || 0).toFixed(2).replace(".",",")}} {{itemInfo.currency}}</span>
</div> </div>
</template> </template>
<table class="w-full"> <table class="w-full" v-if="itemInfo.id">
<tr class="flex-row flex justify-between"> <tr class="flex-row flex justify-between">
<td> <td>
<span class="font-semibold">Buchungsdatum:</span> <span class="font-semibold">Buchungsdatum:</span>
@@ -207,26 +228,36 @@ setup()
</tr> </tr>
<tr class="flex-row flex justify-between"> <tr class="flex-row flex justify-between">
<td colspan="2"> <td colspan="2">
<span class="font-semibold">Verknüpftes Dokument:</span> <span class="font-semibold">Verknüpfte Dokumente:</span>
</td> </td>
</tr> </tr>
<tr <tr
class="flex-row flex justify-between mb-3" class="flex-row flex justify-between mb-3"
v-for="item in itemInfo.assignments" v-for="item in itemInfo.statementallocations"
> >
<td> <td>
<!-- <span v-if="itemInfo.createdDocument"><nuxt-link :to="`/createDocument/show/${itemInfo.createdDocument}`">{{dataStore.createddocuments.find(i => i.id === itemInfo.createdDocument).documentNumber}}</nuxt-link></span> <!-- <span v-if="itemInfo.createdDocument"><nuxt-link :to="`/createDocument/show/${itemInfo.createdDocument}`">{{dataStore.createddocuments.find(i => i.id === itemInfo.createdDocument).documentNumber}}</nuxt-link></span>
<span v-else-if="itemInfo.incomingInvoice"><nuxt-link :to="`/incominInvoices/show/${itemInfo.incomingInvoice}`">{{dataStore.getIncomingInvoiceById(itemInfo.incomingInvoice).reference}}</nuxt-link></span>--> <span v-else-if="itemInfo.incomingInvoice"><nuxt-link :to="`/incominInvoices/show/${itemInfo.incomingInvoice}`">{{dataStore.getIncomingInvoiceById(itemInfo.incomingInvoice).reference}}</nuxt-link></span>-->
<span v-if="item.type === 'createdDocument'"> <span v-if="item.cd_id">
{{dataStore.getCreatedDocumentById(item.id).documentNumber}} {{dataStore.getCreatedDocumentById(item.cd_id).documentNumber}}
</span>
<span v-else-if="item.ii_id">
{{dataStore.getVendorById(dataStore.getIncomingInvoiceById(item.ii_id).vendor).name}} - {{dataStore.getIncomingInvoiceById(item.ii_id).reference}}
</span> </span>
</td> </td>
<td> <td>
<UButton <UButton
variant="outline" variant="outline"
icon="i-heroicons-arrow-right-end-on-rectangle" icon="i-heroicons-arrow-right-end-on-rectangle"
@click="router.push(`/createDocument/show/${item.id}`)" @click="router.push(`/createDocument/show/${item.cd_id}`)"
v-if="item.cd_id"
/>
<UButton
variant="outline"
icon="i-heroicons-arrow-right-end-on-rectangle"
@click="router.push(`/incominginvoices/show/${item.ii_id}`)"
v-else-if="item.ii_id"
/> />
</td> </td>
</tr> </tr>
@@ -253,15 +284,13 @@ setup()
class="w-2/5 mx-auto" class="w-2/5 mx-auto"
v-if="itemInfo.amount > 0 " v-if="itemInfo.amount > 0 "
> >
<UDivider <UDivider>
label="Test"
>
<span>Offene Summe: {{displayCurrency(calculateOpenSum)}}</span> <span>Offene Summe: {{displayCurrency(calculateOpenSum)}}</span>
</UDivider> </UDivider>
<UCard <UCard
class="mt-5" class="mt-5"
:ui="{ring: itemInfo.assignments.find(i => i.id === document.id) ? 'ring-primary-500' : 'ring-gray-200 dark:ring-gray-800'}" :ui="{ring: itemInfo.statementallocations.find(i => i.cd_id === document.id) ? 'ring-primary-500' : 'ring-gray-200 dark:ring-gray-800'}"
v-for="document in dataStore.getOpenDocuments()" v-for="document in openDocuments"
> >
<template #header> <template #header>
<div class="flex flex-row justify-between"> <div class="flex flex-row justify-between">
@@ -273,27 +302,36 @@ setup()
icon="i-heroicons-check" icon="i-heroicons-check"
variant="outline" variant="outline"
class="mr-3" class="mr-3"
v-if="!itemInfo.assignments.find(i => i.id === document.id)" v-if="!itemInfo.statementallocations.find(i => i.cd_id === document.id)"
@click="itemInfo.assignments.push({type: 'createdDocument',id: document.id})" @click="itemInfo.statementallocations.push({cd_id: document.id, bs_id: itemInfo.id, amount: Number(getDocumentSum(document))})"
/> />
<UButton <UButton
icon="i-heroicons-x-mark" icon="i-heroicons-x-mark"
variant="outline" variant="outline"
color="rose" color="rose"
v-if="itemInfo.assignments.find(i => i.id === document.id)" class="mr-3"
@click="itemInfo.assignments = itemInfo.assignments.filter(i => i.id !== document.id)" v-if="itemInfo.statementallocations.find(i => i.cd_id === document.id)"
@click="itemInfo.statementallocations = itemInfo.statementallocations.filter(i => i.cd_id !== document.id)"
/>
<UButton
variant="outline"
icon="i-heroicons-arrow-right-end-on-rectangle"
@click="router.push(`/createDocument/show/${document.id}`)"
/> />
</UCard> </UCard>
</div> </div>
<div
class="w-2/5 mx-auto"
v-if="itemInfo.amount < 0 "
>
<UDivider>
<span>Offene Summe: {{displayCurrency(calculateOpenSum)}}</span>
</UDivider>
<UCard <UCard
class="w-4/5 mx-auto mt-5" class="mt-5"
v-else-if="itemInfo.amount < 0 && !itemInfo.incomingInvoice" :ui="{ring: itemInfo.assignments.find(i => i.id === invoice.id) ? 'ring-primary-500' : 'ring-gray-200 dark:ring-gray-800'}"
v-for="invoice in dataStore.getOpenIncomingInvoices()" v-for="invoice in dataStore.getOpenIncomingInvoices()"
> >
<template #header> <template #header>
@@ -302,28 +340,30 @@ setup()
<span class="font-semibold text-rose-600">-{{displayCurrency(getInvoiceSum(invoice))}}</span> <span class="font-semibold text-rose-600">-{{displayCurrency(getInvoiceSum(invoice))}}</span>
</div> </div>
</template> </template>
<table class="w-full"> <UButton
<tr class="flex flex-row justify-between"> icon="i-heroicons-check"
<td><span class="font-semibold">Belegdatum:</span></td> variant="outline"
<td>{{dayjs(invoice.date).format("DD.MM.YYYY")}}</td> class="mr-3"
</tr> v-if="!itemInfo.assignments.find(i => i.id === invoice.id)"
<tr class="flex flex-row justify-between"> @click="itemInfo.assignments.push({type: 'incomingInvoice',id: invoice.id})"
<td><span class="font-semibold">Fälligkeitsdatum:</span></td> />
<td>{{dayjs(invoice.dueDate).format("DD.MM.YYYY")}}</td> <UButton
</tr> icon="i-heroicons-x-mark"
<tr class="flex flex-row justify-between"> variant="outline"
<td colspan="2"><span class="font-semibold">Beschreibung:</span></td> color="rose"
</tr> class="mr-3"
<tr class="flex flex-row justify-between"> v-if="itemInfo.assignments.find(i => i.id === invoice.id)"
<td colspan="2">{{invoice.description}}</td> @click="itemInfo.assignments = itemInfo.assignments.filter(i => i.id !== invoice.id)"
</tr> />
</table> <UButton
variant="outline"
icon="i-heroicons-arrow-right-end-on-rectangle"
@click="router.push(`/incominginvoices/show/${invoice.id}`)"
/>
</UCard> </UCard>
</div>
</UDashboardPanelContent> </UDashboardPanelContent>
</template> </template>
<style scoped> <style scoped>

View File

@@ -482,6 +482,7 @@ setupPage()
</UButton> </UButton>
<UButton <UButton
@click="closeDocument" @click="closeDocument"
v-if="itemInfo.id"
> >
Fertigstellen Fertigstellen
</UButton> </UButton>

View File

@@ -106,7 +106,7 @@
<span :class="dayjs(row.dueDate).diff(dayjs()) <= 0 ? ['text-rose-500'] : '' ">{{row.dueDate ? dayjs(row.dueDate).format("DD.MM.YY") : ''}}</span> <span :class="dayjs(row.dueDate).diff(dayjs()) <= 0 ? ['text-rose-500'] : '' ">{{row.dueDate ? dayjs(row.dueDate).format("DD.MM.YY") : ''}}</span>
</template> </template>
<template #paid-data="{row}"> <template #paid-data="{row}">
<span v-if="dataStore.bankstatements.find(x => x.assignments.find(y => y.id === row.id))" class="text-primary-500">Bezahlt</span> <span v-if="dataStore.bankstatements.find(x => x.assignments.find(y => y.type === 'createdDocument' && y.id === row.id))" class="text-primary-500">Bezahlt</span>
<span v-else :class="dayjs(row.dueDate).diff(dayjs()) <= 0 ? ['text-rose-500'] : ['text-cyan-500'] ">Offen</span> <span v-else :class="dayjs(row.dueDate).diff(dayjs()) <= 0 ? ['text-rose-500'] : ['text-cyan-500'] ">Offen</span>
<!-- {{dataStore.bankstatements.find(x => x.assignments.find(y => y.id === row.id)) ? true : false}}--> <!-- {{dataStore.bankstatements.find(x => x.assignments.find(y => y.id === row.id)) ? true : false}}-->
</template> </template>

View File

@@ -186,7 +186,6 @@ setupPage()
:render-headline="true" :render-headline="true"
/> />
</UCard> </UCard>
</div> </div>
</div> </div>
@@ -194,15 +193,8 @@ setupPage()
<UCard class="mt-5" v-else> <UCard class="mt-5" v-else>
<div v-if="item.label === 'Informationen'" class="flex">
<div v-if="item.label === 'Projekte'">
</div>
<div v-else-if="item.label === 'Projekte'">
<Toolbar> <Toolbar>
<UButton <UButton
@click="router.push(`/projects/create?customer=${currentItem.id}`)" @click="router.push(`/projects/create?customer=${currentItem.id}`)"

View File

@@ -187,8 +187,9 @@ setupPage()
</UButton> </UButton>
</template> </template>
</UDashboardNavbar> </UDashboardNavbar>
<UDashboardPanelContent>
<div v-if="!itemInfo.document"> <div v-if="!itemInfo.document">
<!-- <div v-if="availableDocuments.length === 0" class="w-1/2 mx-auto text-center"> <!-- <div v-if="availableDocuments.length === 0" class="w-1/2 mx-auto text-center">
<p class="text-2xl mt-5">Keine Dokumente zur Auswahl vefügbar</p> <p class="text-2xl mt-5">Keine Dokumente zur Auswahl vefügbar</p>
<UButton <UButton
@click="router.push(`/documents`)" @click="router.push(`/documents`)"
@@ -228,7 +229,7 @@ setupPage()
<p>Bezahlt: {{itemInfo.paid}}</p> <p>Bezahlt: {{itemInfo.paid}}</p>
<p>Beschreibung: {{itemInfo.description}}</p> <p>Beschreibung: {{itemInfo.description}}</p>
<!-- TODO: Buchungszeilen darstellen --> <!-- TODO: Buchungszeilen darstellen -->
</div> </div>
<HistoryDisplay <HistoryDisplay
@@ -448,7 +449,6 @@ setupPage()
</UInput> </UInput>
</UFormGroup> </UFormGroup>
{{item}}
</InputGroup> </InputGroup>
@@ -475,6 +475,8 @@ setupPage()
</div> </div>
</div> </div>
</div> </div>
</UDashboardPanelContent>

View File

@@ -120,7 +120,7 @@ const filteredRows = computed(() => {
{{dayjs(row.dueDate).format("DD.MM.YYYY")}} {{dayjs(row.dueDate).format("DD.MM.YYYY")}}
</template> </template>
<template #paid-data="{row}"> <template #paid-data="{row}">
<span v-if="row.paid" class="text-primary-500">Bezahlt</span> <span v-if="dataStore.bankstatements.find(x => x.assignments.find(y => y.type === 'incomingInvoice' && y.id === row.id))" class="text-primary-500">Bezahlt</span>
<span v-else class="text-rose-600">Offen</span> <span v-else class="text-rose-600">Offen</span>
</template> </template>
</UTable> </UTable>

View File

@@ -130,6 +130,10 @@ export const useDataStore = defineStore('data', () => {
label: "Kontobewegungen", label: "Kontobewegungen",
labelSingle: "Kontobewegung", labelSingle: "Kontobewegung",
historyItemHolder: "bankStatement", historyItemHolder: "bankStatement",
},
statementallocations: {
label: "Bankzuweisungen",
labelSingle: "Bankzuweisung"
} }
} }
@@ -809,7 +813,7 @@ export const useDataStore = defineStore('data', () => {
} else if (supabaseData) { } else if (supabaseData) {
console.log(supabaseData) console.log(supabaseData)
await generateHistoryItems(dataType, supabaseData[0]) await generateHistoryItems(dataType, supabaseData[0])
await eval( dataType + '.value.push(' + JSON.stringify(...supabaseData) + ')') //await eval( dataType + '.value.push(' + JSON.stringify(...supabaseData) + ')')
toast.add({title: `${dataTypes[dataType].labelSingle} hinzugefügt`}) toast.add({title: `${dataTypes[dataType].labelSingle} hinzugefügt`})
if(dataTypes[dataType].redirect) await router.push(`/${dataType}/show/${supabaseData[0].id}`) if(dataTypes[dataType].redirect) await router.push(`/${dataType}/show/${supabaseData[0].id}`)
return supabaseData return supabaseData
@@ -1526,12 +1530,12 @@ export const useDataStore = defineStore('data', () => {
return workingtimes.value.find(item => item.id === itemId) return workingtimes.value.find(item => item.id === itemId)
}) })
const getOpenDocuments = computed(() => (itemId) => { /*const getOpenDocuments = computed(() => (itemId) => {
let items = createddocuments.value.filter(i => i.type === "invoices" || i.type === "advanceInvoices") let items = createddocuments.value.filter(i => i.type === "invoices" || i.type === "advanceInvoices")
items = items.filter(i => bankstatements.value.filter(x => x.assignments.find(y => y.id === i.id)).length === 0) items = items.filter(i => bankstatements.value.filter(x => x.assignments.find(y => y.type === 'createdDocument' && y.id === i.id)).length === 0)
/*let finalItems = [] /!*let finalItems = []
items.forEach(item => { items.forEach(item => {
if(bankstatements.value.filter(i => i.assignments.find(x => x.id === item.id))){ if(bankstatements.value.filter(i => i.assignments.find(x => x.id === item.id))){
finalItems.push(item) finalItems.push(item)
@@ -1539,16 +1543,18 @@ export const useDataStore = defineStore('data', () => {
}) })
return finalItems*/ return finalItems*!/
return items return items
//return createddocuments.value.filter(i => (i.type === "invoices" || i.type === "advanceInvoices") && !bankstatements.value.some(x => x.amount -)) //return createddocuments.value.filter(i => (i.type === "invoices" || i.type === "advanceInvoices") && !bankstatements.value.some(x => x.amount -))
}) })*/
const getOpenIncomingInvoices = computed(() => (itemId) => { const getOpenIncomingInvoices = computed(() => (itemId) => {
return incominginvoices.value.filter(i => !i.paid) return incominginvoices.value.filter(i => bankstatements.value.filter(x => x.assignments.find(y => y.type === 'incomingInvoice' && y.id === i.id)).length === 0)
//return incominginvoices.value.filter(i => !i.paid)
}) })
@@ -1726,7 +1732,7 @@ export const useDataStore = defineStore('data', () => {
getBankAccountById, getBankAccountById,
getEventById, getEventById,
getWorkingTimeById, getWorkingTimeById,
getOpenDocuments, //getOpenDocuments,
getOpenIncomingInvoices getOpenIncomingInvoices
} }