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) { />