Corrected Some Rendering

Corrected Booking Sum
This commit is contained in:
2025-03-21 12:20:02 +01:00
parent f1fa6d2762
commit 3dcaeb1d4f

View File

@@ -35,7 +35,7 @@ const accounts = ref([])
const loading = ref(true)
const setup = async () => {
if(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))
itemInfo.value = (await supabase.from("bankstatements").select("*, statementallocations(*, cd_id(*, customer(*)), ii_id(*))").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))
@@ -373,41 +373,46 @@ setup()
variant="outline"
color="rose"
class="mr-3"
@click="removeAllocation(itemInfo.statementallocations.find(i => i.account === item.account).id)"
@click="removeAllocation(item.id)"
/>
</UCard>
<UCard
class="mt-5"
: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 allocatedDocuments"
:ui="{ring: itemInfo.statementallocations.find(i => i.cd_id === item.cd_id) ? 'ring-primary-500' : 'ring-gray-200 dark:ring-gray-800'}"
v-for="item in itemInfo.statementallocations.filter(i => i.cd_id)"
>
<template #header>
<div class="flex flex-row justify-between">
<span>{{document.customer ? document.customer.name : ""}} - {{document.documentNumber}}</span>
<span class="font-semibold text-nowrap">{{displayCurrency(useSum().getCreatedDocumentSum(document, createddocuments))}}</span>
<span>{{item.cd_id.customer ? item.cd_id.customer.name : ""}} - {{item.cd_id.documentNumber}}</span>
<span class="font-semibold text-nowrap">{{displayCurrency(item.amount)}}</span>
</div>
</template>
<UButton
<!-- <UButton
icon="i-heroicons-check"
variant="outline"
class="mr-3"
v-if="!itemInfo.statementallocations.find(i => i.cd_id === document.id)"
@click="saveAllocation({cd_id: document.id, bs_id: itemInfo.id, amount: Number(useSum().getCreatedDocumentSum(document,createddocuments))})"
/>
/>-->
<UButton
icon="i-heroicons-x-mark"
variant="outline"
color="rose"
class="mr-3"
v-if="itemInfo.statementallocations.find(i => i.cd_id === document.id)"
@click="removeAllocation(itemInfo.statementallocations.find(i => i.cd_id === document.id).id)"
class=""
@click="removeAllocation(item.id)"
/>
<!-- <EntityModalButtons
:button-create="false"
:button-edit="false"
:id="item.cd_id.id"
type="createddocuments"/>
{{item.cd_id.id}}-->
<UButton
<!-- <UButton
variant="outline"
icon="i-heroicons-arrow-right-end-on-rectangle"
@click="router.push(`/createDocument/show/${document.id}`)"
/>
/>-->
</UCard>
<UCard
class="mt-5"
@@ -566,7 +571,7 @@ setup()
variant="outline"
class="mr-3"
v-if="!itemInfo.statementallocations.find(i => i.cd_id === document.id)"
@click="saveAllocation({cd_id: document.id, bs_id: itemInfo.id, amount: Number(document.openSum)})"
@click="saveAllocation({cd_id: document.id, bs_id: itemInfo.id, amount: Number(document.openSum < maunualAllocationSum ? document.openSum : manualAllocationSum)})"
/>
<UButton