From e680cbc25d4adfe0831dd8c25465995adf6f6779 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 14 Apr 2025 12:04:13 +0200 Subject: [PATCH] refactor: refs #8277 update invoice creation logic and adjust data filtering options --- src/pages/Entry/EntryPreAccount.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pages/Entry/EntryPreAccount.vue b/src/pages/Entry/EntryPreAccount.vue index fbc1d2fc5..9cd44ac8e 100644 --- a/src/pages/Entry/EntryPreAccount.vue +++ b/src/pages/Entry/EntryPreAccount.vue @@ -172,7 +172,8 @@ const columns = computed(() => [ name: 'accountType', options: entryAccounts.value, optionLabel: 'type', - optionValue: 'code', + optionValue: 'id', + sortBy: 'id', }, }, { @@ -247,7 +248,7 @@ async function preAccount() { params: { companyFk: firstRow.companyFk, year }, }) ).data; - return createInvoice(true); + return createInvoice(); } else if (dmsFk) { supplierRef = ( await axios.get(`Dms/${dmsFk}`, { @@ -284,16 +285,15 @@ async function uploadFile() { async function afterUploadFile({ reference }, res) { supplierRef = reference; dmsFk = res.data[0].id; - await createInvoice(false); + await createInvoice(); } -async function createInvoice(isAgricultural) { +async function createInvoice() { try { - await axios.post(`Entries/preAccount`, { + await axios.post(`Entries/addInvoiceIn`, { ids: selectedRows.value.map((entry) => entry.id), supplierRef, dmsFk, - isAgricultural, }); notify(t('entry.preAccount.success'), 'positive'); } catch (e) { @@ -333,7 +333,7 @@ async function createInvoice(isAgricultural) { />