#7936 improve InvoiceIn #1004

Merged
jorgep merged 55 commits from 7936-improveInvoiceIn into dev 2024-12-18 09:22:09 +00:00
2 changed files with 8 additions and 46 deletions
Showing only changes of commit bd12c3bc66 - Show all commits

View File

@ -26,7 +26,7 @@ const columns = computed(() => [
options: intrastats.value,
model: 'intrastatFk',
optionValue: 'id',
optionLabel: 'description',
optionLabel: (row) => `${row.id}: ${row.description}`,
sortable: true,
tabIndex: 1,
align: 'left',
@ -68,12 +68,6 @@ const columns = computed(() => [
align: 'left',
},
]);
const formatOpt = (row, { model, options }, prop) => {
const obj = row[model];
const option = options.find(({ id }) => id == obj);
return option ? `${obj}:${option[prop]}` : '';
};
</script>
<template>
<FetchData
@ -118,12 +112,9 @@ const formatOpt = (row, { model, options }, prop) => {
<VnSelect
v-model="row[col.model]"
:options="col.options"
option-value="id"
option-label="description"
:option-value="col.optionValue"
:option-label="col.optionLabel"
:filter-options="['id', 'description']"
:hide-selected="false"
:fill-input="false"
:display-value="formatOpt(row, col, 'description')"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
@ -138,8 +129,8 @@ const formatOpt = (row, { model, options }, prop) => {
<VnSelect
v-model="row[col.model]"
:options="col.options"
option-value="id"
option-label="code"
:option-value="col.optionValue"
:option-label="col.optionLabel"
/>
</QTd>
</template>
@ -248,11 +239,6 @@ const formatOpt = (row, { model, options }, prop) => {
}
}
</style>
<style lang="scss" scoped>
:deep(.q-table tr .q-td:nth-child(2) input) {
display: none;
}
</style>
<i18n>
en:
amount: Amount

View File

@ -41,9 +41,8 @@ const columns = computed(() => [
options: expenses.value,
model: 'expenseFk',
optionValue: 'id',
optionLabel: 'id',
optionLabel: (row) => `${row.id}: ${row.name}`,
Review

Este no funciona al cargar, pone undefined @alexm no consigo encontrar el porque, necesitaría que lo miremos.

Este no funciona al cargar, pone **undefined** @alexm no consigo encontrar el porque, necesitaría que lo miremos.
Review

Vale, pido los cambios hasta este archivo

Vale, pido los cambios hasta este archivo
sortable: true,
tabIndex: 1,
align: 'left',
},
{
@ -52,7 +51,6 @@ const columns = computed(() => [
field: (row) => row.taxableBase,
model: 'taxableBase',
sortable: true,
tabIndex: 2,
align: 'left',
},
{
@ -62,9 +60,8 @@ const columns = computed(() => [
options: sageTaxTypes.value,
model: 'taxTypeSageFk',
optionValue: 'id',
optionLabel: 'id',
optionLabel: (row) => `${row.id}: ${row.vat}`,
sortable: true,
tabindex: 3,
align: 'left',
},
{
@ -74,16 +71,14 @@ const columns = computed(() => [
options: sageTransactionTypes.value,
model: 'transactionTypeSageFk',
optionValue: 'id',
optionLabel: 'id',
optionLabel: (row) => `${row.id}: ${row.transaction}`,
sortable: true,
tabIndex: 4,
align: 'left',
},
{
name: 'rate',
label: t('Rate'),
sortable: true,
tabIndex: 5,
field: (row) => taxRate(row, row.taxTypeSageFk),
align: 'left',
},
@ -91,7 +86,6 @@ const columns = computed(() => [
name: 'foreignvalue',
label: t('Foreign value'),
sortable: true,
tabIndex: 6,
field: (row) => row.foreignValue,
align: 'left',
},
@ -124,12 +118,6 @@ function taxRate(invoiceInTax) {
return ((taxTypeSage / 100) * taxableBase).toFixed(2);
}
const formatOpt = (row, { model, options }, prop) => {
const obj = row[model];
const option = options.find(({ id }) => id == obj);
return option ? `${obj}:${option[prop]}` : '';
};
</script>
<template>
<FetchData
@ -173,8 +161,6 @@ const formatOpt = (row, { model, options }, prop) => {
:option-label="col.optionLabel"
:filter-options="['id', 'name']"
:tooltip="t('Create a new expense')"
:hide-selected="false"
:display-value="formatOpt(row, col, 'name')"
@keydown.tab="
row[col.model] = useAccountShortToStandard(
$event.target.value
@ -211,8 +197,6 @@ const formatOpt = (row, { model, options }, prop) => {
:option-value="col.optionValue"
:option-label="col.optionLabel"
:filter-options="['id', 'vat']"
:hide-selected="false"
:display-value="formatOpt(row, col, 'vat')"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
@ -235,9 +219,6 @@ const formatOpt = (row, { model, options }, prop) => {
:option-value="col.optionValue"
:option-label="col.optionLabel"
:filter-options="['id', 'transaction']"
:autofocus="col.tabIndex == 1"
:hide-selected="false"
:display-value="formatOpt(row, col, 'transaction')"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
@ -428,11 +409,6 @@ const formatOpt = (row, { model, options }, prop) => {
.bg {
background-color: var(--vn-light-gray);
}
:deep(.q-table tr td:nth-child(n + 4):nth-child(-n + 5) input) {
display: none;
}
@media (max-width: $breakpoint-xs) {
.q-dialog {
.q-card {