diff --git a/src/pages/InvoiceIn/Card/InvoiceInVat.vue b/src/pages/InvoiceIn/Card/InvoiceInVat.vue index d9eacf686..f7ef7d525 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInVat.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInVat.vue @@ -119,7 +119,17 @@ function taxRate(invoiceInTax) { return ((taxTypeSage / 100) * taxableBase).toFixed(2); } -const formatLabel = (row, prop) => `${row.id}: ${row[prop]}`; +function autocompleteExpense(evt, row, col) { + const val = evt.target.value; + if (!val) return; + + const param = isNaN(val) ? row[col.model] : val; + const lookup = expenses.value.find( + ({ id }) => id == useAccountShortToStandard(param) + ); + + if (lookup) row[col.model] = lookup; +}