diff --git a/pages/banking/statements/[mode]/[[id]].vue b/pages/banking/statements/[mode]/[[id]].vue index ddb9878..5cde083 100644 --- a/pages/banking/statements/[mode]/[[id]].vue +++ b/pages/banking/statements/[mode]/[[id]].vue @@ -28,6 +28,9 @@ const allocatedDocuments = ref([]) const openIncomingInvoices = ref([]) const allocatedIncomingInvoices = ref([]) +const customers = ref([]) +const vendors = ref([]) + const createddocuments = ref([]) const accounts = ref([]) @@ -48,6 +51,8 @@ const setup = async () => { accounts.value = (await supabase.from("accounts").select()).data ownaccounts.value = (await supabase.from("ownaccounts").select()).data + customers.value = (await supabase.from("customers").select()).data + vendors.value = (await supabase.from("vendors").select()).data openDocuments.value = documents.filter(i => i.statementallocations.reduce((n,{amount}) => n + amount, 0).toFixed(2) !== useSum().getCreatedDocumentSum(i,createddocuments.value).toFixed(2)) openDocuments.value = openDocuments.value.map(i => { @@ -121,6 +126,8 @@ const saveAllocations = async () => { const showAccountSelection = ref(false) const accountToSave = ref("") const ownAccountToSave = ref("") +const customerAccountToSave = ref("") +const vendorAccountToSave = ref("") const selectAccount = (id) => { accountToSave.value = id @@ -129,6 +136,7 @@ const selectAccount = (id) => { const manualAllocationSum = ref(itemInfo.value.amount || 0) +const allocationDescription = ref("") const saveAllocation = async (allocation) => { @@ -397,6 +405,42 @@ setup() @click="removeAllocation(item.id)" /> + + + + + + + +
- Buchungssumme - - Buchungsdaten + - - + + + + + + + + Ohne Beleg buchen @@ -519,7 +576,7 @@ setup() variant="outline" icon="i-heroicons-check" :disabled="!accountToSave" - @click="saveAllocation({bs_id: itemInfo.id, amount: manualAllocationSum, account: accountToSave })" + @click="saveAllocation({bs_id: itemInfo.id, amount: manualAllocationSum, account: accountToSave, description: allocationDescription })" /> + + + + + + + + + + + + + + + + + + + + @@ -639,7 +770,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 < maunualAllocationSum ? document.openSum : manualAllocationSum)})" + @click="saveAllocation({cd_id: document.id, bs_id: itemInfo.id, amount: Number(document.openSum < maunualAllocationSum ? document.openSum : manualAllocationSum), description: allocationDescription})" />