From ff95882e42191411348b12ab4640b13a8b828560 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 20 Jan 2025 11:51:53 +0100 Subject: [PATCH] fix: refs #7936 rollback --- src/pages/InvoiceIn/Card/InvoiceInVat.vue | 32 +++++------------------ 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/src/pages/InvoiceIn/Card/InvoiceInVat.vue b/src/pages/InvoiceIn/Card/InvoiceInVat.vue index b702851b3..f7ef7d525 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInVat.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInVat.vue @@ -33,19 +33,15 @@ defineProps({ }, }); -function test(row) { - console.log('test', row); - return `${row.id}: ${row.name}`; -} - const columns = computed(() => [ { name: 'expense', label: t('Expense'), + field: (row) => row.expenseFk, options: expenses.value, model: 'expenseFk', optionValue: 'id', - optionLabel: (row) => test(row), + optionLabel: (row) => `${row.id}: ${row.name}`, sortable: true, align: 'left', }, @@ -123,8 +119,6 @@ function taxRate(invoiceInTax) { return ((taxTypeSage / 100) * taxableBase).toFixed(2); } -const expensesRef = ref(); -const exponseShow = ref(false); function autocompleteExpense(evt, row, col) { const val = evt.target.value; if (!val) return; @@ -133,17 +127,9 @@ function autocompleteExpense(evt, row, col) { const lookup = expenses.value.find( ({ id }) => id == useAccountShortToStandard(param) ); - if (lookup) { - row[col.model] = lookup?.id; - expensesRef.value.showItem = true; - } -} -const formatOpt = (row, { model, options }, prop) => { - const obj = row[model]; - const option = options.find(({ id }) => id == obj); - return option ? `${obj}:${option[prop]}` : ''; -}; + if (lookup) row[col.model] = lookup; +}