Changes
This commit is contained in:
2
app.vue
2
app.vue
@@ -6,6 +6,8 @@ const tenants = (await supabase.from("tenants").select()).data
|
|||||||
const dataStore = useDataStore()
|
const dataStore = useDataStore()
|
||||||
const viewport = useViewport()
|
const viewport = useViewport()
|
||||||
|
|
||||||
|
console.log("1.")
|
||||||
|
|
||||||
/*watch(viewport.breakpoint, (newBreakpoint, oldBreakpoint) => {
|
/*watch(viewport.breakpoint, (newBreakpoint, oldBreakpoint) => {
|
||||||
console.log('Breakpoint updated:', oldBreakpoint, '->', newBreakpoint)
|
console.log('Breakpoint updated:', oldBreakpoint, '->', newBreakpoint)
|
||||||
})*/
|
})*/
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ const openShowModal = ref(false)
|
|||||||
const openDocument = async () => {
|
const openDocument = async () => {
|
||||||
//selectedDocument.value = doc
|
//selectedDocument.value = doc
|
||||||
openShowModal.value = true
|
openShowModal.value = true
|
||||||
|
console.log("open")
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateDocument = async () => {
|
const updateDocument = async () => {
|
||||||
@@ -131,7 +132,7 @@ const updateDocumentAssignment = async () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="documentListItem" @click="returnEmit ? $emit('clicked', documentData.id) : openDocument">
|
<div class="documentListItem" @click="returnEmit ? $emit('clicked', documentData.id) : openShowModal = true">
|
||||||
<object
|
<object
|
||||||
:data="`${documentData.url}#toolbar=0&navpanes=0&scrollbar=0`"
|
:data="`${documentData.url}#toolbar=0&navpanes=0&scrollbar=0`"
|
||||||
class="previewEmbed"
|
class="previewEmbed"
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ const supabase = useSupabaseClient()
|
|||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
|
console.log("2.")
|
||||||
|
|
||||||
dataStore.initializeData((await supabase.auth.getUser()).data.user.id)
|
dataStore.initializeData((await supabase.auth.getUser()).data.user.id)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -76,6 +76,9 @@
|
|||||||
class="text-rose-500"
|
class="text-rose-500"
|
||||||
>{{String(row.amount.toFixed(2)).replace(".",",")}} €</span>
|
>{{String(row.amount.toFixed(2)).replace(".",",")}} €</span>
|
||||||
</template>
|
</template>
|
||||||
|
<template #openAmount-data="{row}">
|
||||||
|
{{displayCurrency(calculateOpenSum(row))}}
|
||||||
|
</template>
|
||||||
<template #partner-data="{row}">
|
<template #partner-data="{row}">
|
||||||
<span
|
<span
|
||||||
v-if="row.amount < 0"
|
v-if="row.amount < 0"
|
||||||
@@ -200,6 +203,11 @@ const templateColumns = [
|
|||||||
label: "Betrag",
|
label: "Betrag",
|
||||||
sortable: true
|
sortable: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: "openAmount",
|
||||||
|
label: "Offener Betrag",
|
||||||
|
sortable: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: "partner",
|
key: "partner",
|
||||||
label: "Name",
|
label: "Name",
|
||||||
@@ -219,9 +227,36 @@ const searchString = ref('')
|
|||||||
const filterAccount = ref(dataStore.bankAccounts || [])
|
const filterAccount = ref(dataStore.bankAccounts || [])
|
||||||
const showOnlyNotAssigned = ref(true)
|
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(() => {
|
const filteredRows = computed(() => {
|
||||||
return useSearch(searchString.value, dataStore.bankstatements.filter(i => filterAccount.value.find(x => x.id === i.account) && (showOnlyNotAssigned.value ? (!i.createdDocument && !i.incomingInvoice) : true)))
|
return useSearch(searchString.value, dataStore.bankstatements.filter(i => filterAccount.value.find(x => x.id === i.account) && (showOnlyNotAssigned.value ? Number(calculateOpenSum(i)) !== 0 : true)))
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -53,9 +53,23 @@ const getInvoiceSum = (invoice) => {
|
|||||||
sum += account.amountTax
|
sum += account.amountTax
|
||||||
sum += account.amountNet
|
sum += account.amountNet
|
||||||
})
|
})
|
||||||
return sum
|
return sum.toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const calculateOpenSum = computed(() => {
|
||||||
|
let startingAmount = itemInfo.value.amount
|
||||||
|
|
||||||
|
itemInfo.value.assignments.forEach(item => {
|
||||||
|
if(item.type === "createdDocument") {
|
||||||
|
let doc = dataStore.getCreatedDocumentById(item.id)
|
||||||
|
startingAmount = startingAmount - getDocumentSum(doc)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return startingAmount.toFixed(2)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
setup()
|
setup()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@@ -121,9 +135,11 @@ setup()
|
|||||||
</template>
|
</template>
|
||||||
</UDashboardNavbar>
|
</UDashboardNavbar>
|
||||||
|
|
||||||
<UDashboardPanelContent>
|
<UDashboardPanelContent
|
||||||
|
class="flex flex-row"
|
||||||
|
>
|
||||||
<UCard
|
<UCard
|
||||||
class="w-4/5 mx-auto mt-10"
|
class="w-2/5 mx-auto mt-5"
|
||||||
v-if="itemInfo"
|
v-if="itemInfo"
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
@@ -190,12 +206,28 @@ setup()
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="flex-row flex justify-between">
|
<tr class="flex-row flex justify-between">
|
||||||
<td>
|
<td colspan="2">
|
||||||
<span class="font-semibold">Verknüpftes Dokument:</span>
|
<span class="font-semibold">Verknüpftes Dokument:</span>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr
|
||||||
|
class="flex-row flex justify-between mb-3"
|
||||||
|
v-for="item in itemInfo.assignments"
|
||||||
|
>
|
||||||
<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'">
|
||||||
|
{{dataStore.getCreatedDocumentById(item.id).documentNumber}}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<UButton
|
||||||
|
variant="outline"
|
||||||
|
icon="i-heroicons-arrow-right-end-on-rectangle"
|
||||||
|
@click="router.push(`/createDocument/show/${item.id}`)"
|
||||||
|
/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="flex-row flex justify-between">
|
<tr class="flex-row flex justify-between">
|
||||||
@@ -209,32 +241,53 @@ setup()
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</UCard>
|
</UCard>
|
||||||
|
|
||||||
<UDivider
|
<!-- <UDivider
|
||||||
class="mt-5 w-4/5 mx-auto"
|
class="mt-5 w-2/5 mx-auto"
|
||||||
v-if="!itemInfo.createdDocument && !itemInfo.incomingInvoice"
|
v-if="!itemInfo.createdDocument && !itemInfo.incomingInvoice"
|
||||||
/>
|
/>-->
|
||||||
|
|
||||||
<UCard
|
<div
|
||||||
class="w-4/5 mx-auto mt-5"
|
class="w-2/5 mx-auto"
|
||||||
v-if="itemInfo.amount > 0 && !itemInfo.createdDocument"
|
v-if="itemInfo.amount > 0 "
|
||||||
:ui="{ring: itemInfo.createdDocument === document.id ? 'ring-primary-500' : 'ring-gray-200 dark:ring-gray-800'}"
|
|
||||||
v-for="document in dataStore.getOpenDocuments()"
|
|
||||||
>
|
>
|
||||||
<template #header>
|
<UDivider
|
||||||
<div class="flex flex-row justify-between">
|
label="Test"
|
||||||
<span>{{dataStore.getCustomerById(document.customer).name}} - {{document.documentNumber}}</span>
|
>
|
||||||
<span class="font-semibold text-primary-500">{{displayCurrency(getDocumentSum(document))}}</span>
|
<span>Offene Summe: {{displayCurrency(calculateOpenSum)}}</span>
|
||||||
</div>
|
</UDivider>
|
||||||
</template>
|
<UCard
|
||||||
<UButton
|
class="mt-5"
|
||||||
icon="i-heroicons-check"
|
:ui="{ring: itemInfo.assignments.find(i => i.id === document.id) ? 'ring-primary-500' : 'ring-gray-200 dark:ring-gray-800'}"
|
||||||
variant="outline"
|
v-for="document in dataStore.getOpenDocuments()"
|
||||||
v-if="Number(getDocumentSum(document)) === itemInfo.amount"
|
>
|
||||||
@click="itemInfo.createdDocument = document.id"
|
<template #header>
|
||||||
/>
|
<div class="flex flex-row justify-between">
|
||||||
</UCard>
|
<span>{{dataStore.getCustomerById(document.customer).name}} - {{document.documentNumber}}</span>
|
||||||
|
<span class="font-semibold text-primary-500">{{displayCurrency(getDocumentSum(document))}}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<UButton
|
||||||
|
icon="i-heroicons-check"
|
||||||
|
variant="outline"
|
||||||
|
class="mr-3"
|
||||||
|
v-if="!itemInfo.assignments.find(i => i.id === document.id)"
|
||||||
|
@click="itemInfo.assignments.push({type: 'createdDocument',id: document.id})"
|
||||||
|
/>
|
||||||
|
<UButton
|
||||||
|
icon="i-heroicons-x-mark"
|
||||||
|
variant="outline"
|
||||||
|
color="rose"
|
||||||
|
v-if="itemInfo.assignments.find(i => i.id === document.id)"
|
||||||
|
@click="itemInfo.assignments = itemInfo.assignments.filter(i => i.id !== document.id)"
|
||||||
|
/>
|
||||||
|
</UCard>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -684,6 +684,7 @@ setupPage()
|
|||||||
/>
|
/>
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
|
|
||||||
|
|
||||||
<InputGroup class="w-full">
|
<InputGroup class="w-full">
|
||||||
<UFormGroup
|
<UFormGroup
|
||||||
label="Datum:"
|
label="Datum:"
|
||||||
@@ -923,7 +924,8 @@ setupPage()
|
|||||||
:search-attributes="['name']"
|
:search-attributes="['name']"
|
||||||
v-model="row.product"
|
v-model="row.product"
|
||||||
@change="row.unit = dataStore.getProductById(row.product).unit,
|
@change="row.unit = dataStore.getProductById(row.product).unit,
|
||||||
row.price = dataStore.getProductById(row.product).sellingPrice || 0"
|
row.price = dataStore.getProductById(row.product).sellingPrice || 0,
|
||||||
|
row.description = dataStore.getProductById(row.product).description"
|
||||||
>
|
>
|
||||||
<template #label>
|
<template #label>
|
||||||
<span class="truncate">{{dataStore.getProductById(row.product) ?dataStore.getProductById(row.product).name : "Kein Produkt ausgewählt" }}</span>
|
<span class="truncate">{{dataStore.getProductById(row.product) ?dataStore.getProductById(row.product).name : "Kein Produkt ausgewählt" }}</span>
|
||||||
|
|||||||
@@ -106,8 +106,9 @@
|
|||||||
<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="row.paid" class="text-primary-500">Bezahlt</span>
|
<span v-if="dataStore.bankstatements.find(x => x.assignments.find(y => y.id === row.id))" class="text-primary-500">Bezahlt</span>
|
||||||
<span v-if="!row.paid" :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}}-->
|
||||||
</template>
|
</template>
|
||||||
<template #amount-data="{row}">
|
<template #amount-data="{row}">
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ const downloadSelected = async () => {
|
|||||||
|
|
||||||
<DocumentList
|
<DocumentList
|
||||||
:documents="filteredDocuments"
|
:documents="filteredDocuments"
|
||||||
|
@selectDocument="(info) => console.log(info)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<USlideover
|
<USlideover
|
||||||
|
|||||||
@@ -17,7 +17,11 @@ const {vendors} = storeToRefs(useDataStore())
|
|||||||
const {fetchVendorInvoices} = useDataStore()
|
const {fetchVendorInvoices} = useDataStore()
|
||||||
|
|
||||||
const availableDocuments = computed(() => {
|
const availableDocuments = computed(() => {
|
||||||
return dataStore.documents.filter(i => i.tags.includes('Eingangsrechnung' /*&& dataStore.incominginvoices.filter(x => x.document === i).length === 0*/))
|
|
||||||
|
//console.log(dataStore.documents.filter(i => i.tags.includes('Eingangsrechnung') && !dataStore.incominginvoices.find(x => x.document === i.id)))
|
||||||
|
//console.log(dataStore.documents.filter(i => i.tags.includes('Eingangsrechnung')).length)
|
||||||
|
|
||||||
|
return dataStore.documents.filter(i => i.tags.includes('Eingangsrechnung') && !dataStore.incominginvoices.find(x => x.document === i.id))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@@ -111,7 +115,7 @@ const totalCalculated = computed(() => {
|
|||||||
itemInfo.value.accounts.forEach(account => {
|
itemInfo.value.accounts.forEach(account => {
|
||||||
if(account.amountNet) totalNet += account.amountNet
|
if(account.amountNet) totalNet += account.amountNet
|
||||||
|
|
||||||
if(account.taxType === 19 && account.amountTax) {
|
if(account.taxType === "19" && account.amountTax) {
|
||||||
totalAmount19Tax += account.amountTax
|
totalAmount19Tax += account.amountTax
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -157,11 +161,11 @@ setupPage()
|
|||||||
</UButton>
|
</UButton>
|
||||||
<UTooltip
|
<UTooltip
|
||||||
text="Bearbeiten ist nur im Entwurfsstatus möglich"
|
text="Bearbeiten ist nur im Entwurfsstatus möglich"
|
||||||
|
v-if="mode !== 'edit'"
|
||||||
>
|
>
|
||||||
<UButton
|
<UButton
|
||||||
:disabled="itemInfo.state !== 'Entwurf'"
|
:disabled="itemInfo.state !== 'Entwurf'"
|
||||||
@click="router.push(`/incominginvoices/edit/${itemInfo.id}`)"
|
@click="router.push(`/incominginvoices/edit/${itemInfo.id}`)"
|
||||||
v-if="mode !== 'edit'"
|
|
||||||
>
|
>
|
||||||
Bearbeiten
|
Bearbeiten
|
||||||
</UButton>
|
</UButton>
|
||||||
@@ -210,9 +214,9 @@ setupPage()
|
|||||||
v-if="currentDocument ? currentDocument.url : false"
|
v-if="currentDocument ? currentDocument.url : false"
|
||||||
:data="currentDocument.url + '#toolbar=0&navpanes=0&scrollbar=0&statusbar=0&messages=0&scrollbar=0'"
|
:data="currentDocument.url + '#toolbar=0&navpanes=0&scrollbar=0&statusbar=0&messages=0&scrollbar=0'"
|
||||||
type="application/pdf"
|
type="application/pdf"
|
||||||
class="mx-5 documentPreview"
|
class="mx-5 documentPreview w-full"
|
||||||
/>
|
/>
|
||||||
<div class="w-2/5 mx-5">
|
<div class="w-3/5 mx-5">
|
||||||
|
|
||||||
<div v-if="mode === 'show'">
|
<div v-if="mode === 'show'">
|
||||||
|
|
||||||
@@ -444,6 +448,7 @@ setupPage()
|
|||||||
</UInput>
|
</UInput>
|
||||||
|
|
||||||
</UFormGroup>
|
</UFormGroup>
|
||||||
|
{{item}}
|
||||||
|
|
||||||
|
|
||||||
</InputGroup>
|
</InputGroup>
|
||||||
@@ -451,7 +456,7 @@ setupPage()
|
|||||||
|
|
||||||
<UButton
|
<UButton
|
||||||
class="mt-3"
|
class="mt-3"
|
||||||
@click="itemInfo.accounts = [...itemInfo.accounts.slice(0,index+1),{account:null, amountNet: null, amountTax:null, taxType: null} , ...itemInfo.accounts.slice(index+1)]"
|
@click="itemInfo.accounts = [...itemInfo.accounts.slice(0,index+1),{account:null, amountNet: null, amountTax:null, taxType: '19'} , ...itemInfo.accounts.slice(index+1)]"
|
||||||
>
|
>
|
||||||
Position hinzufügen
|
Position hinzufügen
|
||||||
</UButton>
|
</UButton>
|
||||||
@@ -477,7 +482,6 @@ setupPage()
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.documentPreview {
|
.documentPreview {
|
||||||
width: 30vw;
|
|
||||||
aspect-ratio: 1 / 1.414;
|
aspect-ratio: 1 / 1.414;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -279,11 +279,13 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
])
|
])
|
||||||
|
|
||||||
async function initializeData (userId) {
|
async function initializeData (userId) {
|
||||||
|
console.log("init")
|
||||||
|
|
||||||
let profileconnections = (await supabase.from("profileconnections").select()).data
|
let profileconnections = (await supabase.from("profileconnections").select()).data
|
||||||
let profiles = (await supabase.from("profiles").select()).data
|
let profiles = (await supabase.from("profiles").select()).data
|
||||||
let activeProfileConnection = profileconnections.find(i => i.active)
|
let activeProfileConnection = profileconnections.find(i => i.active)
|
||||||
if(activeProfileConnection) {
|
if(activeProfileConnection) {
|
||||||
|
console.log("Active Profile Selected")
|
||||||
activeProfile.value = profiles.find(i => i.id === activeProfileConnection.profile_id)
|
activeProfile.value = profiles.find(i => i.id === activeProfileConnection.profile_id)
|
||||||
currentTenant.value = activeProfile.value.tenant
|
currentTenant.value = activeProfile.value.tenant
|
||||||
|
|
||||||
@@ -329,11 +331,15 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function fetchData () {
|
async function fetchData () {
|
||||||
|
console.log("Fetch Start")
|
||||||
await fetchOwnProfiles()
|
await fetchOwnProfiles()
|
||||||
await fetchProfiles()
|
await fetchProfiles()
|
||||||
await fetchDocuments()
|
|
||||||
await fetchTenants()
|
await fetchTenants()
|
||||||
await fetchOwnTenant()
|
await fetchOwnTenant()
|
||||||
|
|
||||||
|
//loaded.value = true
|
||||||
|
await fetchDocuments()
|
||||||
await fetchEvents()
|
await fetchEvents()
|
||||||
await fetchTasks()
|
await fetchTasks()
|
||||||
await fetchProjects()
|
await fetchProjects()
|
||||||
@@ -372,6 +378,9 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
await fetchServiceCategories()
|
await fetchServiceCategories()
|
||||||
await fetchResources()
|
await fetchResources()
|
||||||
loaded.value = true
|
loaded.value = true
|
||||||
|
|
||||||
|
console.log("Data Fetched")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearStore () {
|
function clearStore () {
|
||||||
@@ -1519,7 +1528,22 @@ export const useDataStore = defineStore('data', () => {
|
|||||||
|
|
||||||
const getOpenDocuments = computed(() => (itemId) => {
|
const getOpenDocuments = computed(() => (itemId) => {
|
||||||
|
|
||||||
return createddocuments.value.filter(i => (i.type === "invoices" || i.type === "advanceInvoices") && !bankstatements.value.some(x => x.createdDocument === i.id))
|
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)
|
||||||
|
|
||||||
|
/*let finalItems = []
|
||||||
|
items.forEach(item => {
|
||||||
|
if(bankstatements.value.filter(i => i.assignments.find(x => x.id === item.id))){
|
||||||
|
finalItems.push(item)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
return finalItems*/
|
||||||
|
|
||||||
|
return items
|
||||||
|
|
||||||
|
//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) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user