Added Buttons for all connected Documents

This commit is contained in:
2025-12-09 12:07:00 +01:00
parent 8b70b77b85
commit 84c88ef69e
2 changed files with 10 additions and 10 deletions

View File

@@ -509,11 +509,11 @@ const archiveStatement = async () => {
</UCard> </UCard>
<UCard <UCard
class="mt-5" class="mt-5"
v-for="item in itemInfo.statementallocations.filter(i => i.ii_id)" v-for="item in itemInfo.statementallocations.filter(i => i.incominginvoice)"
> >
<template #header> <template #header>
<div class="flex flex-row justify-between"> <div class="flex flex-row justify-between">
<span>{{item.ii_id.reference}} - {{vendors.find(i => i.id === item.ii_id.vendor).name}}</span> <span>{{item.incominginvoice.reference}} - {{vendors.find(i => i.id === item.incominginvoice.vendor).name}}</span>
<span class="font-semibold text-nowrap">{{displayCurrency(item.amount)}}</span> <span class="font-semibold text-nowrap">{{displayCurrency(item.amount)}}</span>
</div> </div>
</template> </template>
@@ -529,11 +529,11 @@ const archiveStatement = async () => {
</UCard> </UCard>
<UCard <UCard
class="mt-5" class="mt-5"
v-for="item in itemInfo.statementallocations.filter(i => i.cd_id)" v-for="item in itemInfo.statementallocations.filter(i => i.createddocument)"
> >
<template #header> <template #header>
<div class="flex flex-row justify-between"> <div class="flex flex-row justify-between">
<span v-if="customers.find(i => i.id === item.cd_id.customer)">{{item.cd_id.documentNumber}} - {{customers.find(i => i.id === item.cd_id.customer).name}}</span> <span v-if="customers.find(i => i.id === item.createddocument.customer)">{{item.createddocument.documentNumber}} - {{customers.find(i => i.id === item.createddocument.customer).name}}</span>
<span class="font-semibold text-nowrap">{{displayCurrency(item.amount)}}</span> <span class="font-semibold text-nowrap">{{displayCurrency(item.amount)}}</span>
</div> </div>
</template> </template>
@@ -810,8 +810,8 @@ const archiveStatement = async () => {
icon="i-heroicons-check" icon="i-heroicons-check"
variant="outline" variant="outline"
class="mr-3" class="mr-3"
v-if="!itemInfo.statementallocations.find(i => i.cd_id === document.id)" v-if="!itemInfo.statementallocations.find(i => i.createddocument === document.id)"
@click="saveAllocation({cd_id: document.id, bankstatement: itemInfo.id, amount: Number(Number(document.openSum) < manualAllocationSum ? document.openSum : manualAllocationSum), description: allocationDescription})" @click="saveAllocation({createddocument: document.id, bankstatement: itemInfo.id, amount: Number(Number(document.openSum) < manualAllocationSum ? document.openSum : manualAllocationSum), description: allocationDescription})"
/> />
<UButton <UButton
@@ -835,8 +835,8 @@ const archiveStatement = async () => {
icon="i-heroicons-check" icon="i-heroicons-check"
variant="outline" variant="outline"
class="mr-3" class="mr-3"
v-if="!itemInfo.statementallocations.find(i => i.ii_id === item.id)" v-if="!itemInfo.statementallocations.find(i => i.incominginvoice === item.id)"
@click="saveAllocation({ii_id: item.id, bankstatement: itemInfo.id, amount: Number(Math.abs(getInvoiceSum(item,true)) > Math.abs(manualAllocationSum) ? manualAllocationSum : getInvoiceSum(item,true)), description: allocationDescription})" @click="saveAllocation({incominginvoice: item.id, bankstatement: itemInfo.id, amount: Number(Math.abs(getInvoiceSum(item,true)) > Math.abs(manualAllocationSum) ? manualAllocationSum : getInvoiceSum(item,true)), description: allocationDescription})"
/> />
<UButton <UButton
variant="outline" variant="outline"

View File

@@ -39,9 +39,9 @@ const openEmail = () => {
const openBankstatements = () => { const openBankstatements = () => {
if(itemInfo.value.statementallocations.length > 1) { if(itemInfo.value.statementallocations.length > 1) {
navigateTo(`/banking/?filter=${JSON.stringify(itemInfo.value.statementallocations.map(i => i.bs_id))}`) navigateTo(`/banking/?filter=${JSON.stringify(itemInfo.value.statementallocations.map(i => i.bankstatement))}`)
} else { } else {
navigateTo(`/banking/statements/edit/${itemInfo.value.statementallocations[0].bs_id}`) navigateTo(`/banking/statements/edit/${itemInfo.value.statementallocations[0].bankstatement}`)
} }
} }
</script> </script>