From 2d0cb7277471a3629c1ae711a785b93d4468d7a1 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 13 May 2025 16:37:44 +0200 Subject: [PATCH] refactor: refs #8388 compute totalAmount dynamically from arrayData --- src/pages/Entry/EntryPreAccount.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/pages/Entry/EntryPreAccount.vue b/src/pages/Entry/EntryPreAccount.vue index 9bd0871a9..3f921f435 100644 --- a/src/pages/Entry/EntryPreAccount.vue +++ b/src/pages/Entry/EntryPreAccount.vue @@ -53,12 +53,16 @@ const warehouses = ref([]); const defaultDmsDescription = ref(); const dmsTypeId = ref(); const selectedRows = ref([]); -const totalAmount = ref(); const hasDiferentDms = ref(false); let maxDays; let defaultDays; let supplierRef; let dmsFk; + +const totalAmount = computed(() => { + return arrayData.store.data.totalAmount ?? 0; +}); + const totalSelectedAmount = computed(() => { if (!selectedRows.value.length) return 0; return selectedRows.value.reduce((acc, entry) => acc + entry.amount, 0); @@ -397,13 +401,10 @@ async function createInvoice() { :user-params="{ daysAgo, isBooked }" :row-click="false" :table="{ selection: 'multiple' }" - :limit="0" :footer="true" - @on-fetch=" - (data) => (totalAmount = data?.reduce((acc, entry) => acc + entry.amount, 0)) - " :selection-fn="(rows) => rows.filter((row) => !row.isBooked)" auto-load + key-data="preAccounting" >