#7936 improve InvoiceIn #1004
|
@ -6,7 +6,7 @@ import { useRoute } from 'vue-router';
|
||||||
import toDate from 'filters/toDate';
|
import toDate from 'filters/toDate';
|
||||||
import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue';
|
import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t, te } = useI18n();
|
||||||
const $props = defineProps({
|
const $props = defineProps({
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
@ -226,6 +226,12 @@ function sanitizer(params) {
|
||||||
}
|
}
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getLocale = (label) => {
|
||||||
|
const param = label.split('.').at(-1);
|
||||||
|
|||||||
|
const globalLocale = `globals.params.${param}`;
|
||||||
|
return te(globalLocale) ? t(globalLocale) : t(`params.${param}`);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -274,7 +280,12 @@ function sanitizer(params) {
|
||||||
:removable="!unremovableParams?.includes(chip.label)"
|
:removable="!unremovableParams?.includes(chip.label)"
|
||||||
@remove="remove(chip.label)"
|
@remove="remove(chip.label)"
|
||||||
>
|
>
|
||||||
<slot name="tags" :tag="chip" :format-fn="formatValue">
|
<slot
|
||||||
|
name="tags"
|
||||||
|
:tag="chip"
|
||||||
|
:format-fn="formatValue"
|
||||||
|
:get-locale="getLocale"
|
||||||
|
>
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
<strong>{{ chip.label }}:</strong>
|
<strong>{{ chip.label }}:</strong>
|
||||||
<span>"{{ formatValue(chip.value) }}"</span>
|
<span>"{{ formatValue(chip.value) }}"</span>
|
||||||
|
@ -287,6 +298,7 @@ function sanitizer(params) {
|
||||||
:params="userParams"
|
:params="userParams"
|
||||||
:tags="customTags"
|
:tags="customTags"
|
||||||
:format-fn="formatValue"
|
:format-fn="formatValue"
|
||||||
|
:get-locale="getLocale"
|
||||||
:search-fn="search"
|
:search-fn="search"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -294,7 +306,12 @@ function sanitizer(params) {
|
||||||
<QSeparator />
|
<QSeparator />
|
||||||
</QList>
|
</QList>
|
||||||
<QList dense class="list q-gutter-y-sm q-mt-sm">
|
<QList dense class="list q-gutter-y-sm q-mt-sm">
|
||||||
<slot name="body" :params="sanitizer(userParams)" :search-fn="search"></slot>
|
<slot
|
||||||
|
name="body"
|
||||||
|
:params="sanitizer(userParams)"
|
||||||
|
:get-locale="getLocale"
|
||||||
|
:search-fn="search"
|
||||||
|
></slot>
|
||||||
</QList>
|
</QList>
|
||||||
</QForm>
|
</QForm>
|
||||||
<QInnerLoading
|
<QInnerLoading
|
||||||
|
|
|
@ -331,6 +331,10 @@ globals:
|
||||||
fi: FI
|
fi: FI
|
||||||
myTeam: My team
|
myTeam: My team
|
||||||
departmentFk: Department
|
departmentFk: Department
|
||||||
|
companyFk: Company
|
||||||
|
from: From
|
||||||
|
to: To
|
||||||
|
supplierFk: Supplier
|
||||||
changePass: Change password
|
changePass: Change password
|
||||||
deleteConfirmTitle: Delete selected elements
|
deleteConfirmTitle: Delete selected elements
|
||||||
changeState: Change state
|
changeState: Change state
|
||||||
|
|
|
@ -335,6 +335,10 @@ globals:
|
||||||
SSN: NSS
|
SSN: NSS
|
||||||
fi: NIF
|
fi: NIF
|
||||||
myTeam: Mi equipo
|
myTeam: Mi equipo
|
||||||
|
companyFk: Empresa
|
||||||
|
from: Desde
|
||||||
|
to: Hasta
|
||||||
|
supplierFk: Proveedor
|
||||||
changePass: Cambiar contraseña
|
changePass: Cambiar contraseña
|
||||||
deleteConfirmTitle: Eliminar los elementos seleccionados
|
deleteConfirmTitle: Eliminar los elementos seleccionados
|
||||||
changeState: Cambiar estado
|
changeState: Cambiar estado
|
||||||
|
|
|
@ -21,21 +21,29 @@ const activities = ref([]);
|
||||||
@on-fetch="(data) => (activities = data)"
|
@on-fetch="(data) => (activities = data)"
|
||||||
/>
|
/>
|
||||||
<VnFilterPanel :data-key="dataKey" :search-button="true">
|
<VnFilterPanel :data-key="dataKey" :search-button="true">
|
||||||
<template #tags="{ tag, formatFn }">
|
<template #tags="{ tag, formatFn, getLocale }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
<strong>{{ t(`params.${tag.label}`) }}: </strong>
|
<strong>{{ getLocale(tag.label) }}: </strong>
|
||||||
<span>{{ formatFn(tag.value) }}</span>
|
<span>{{ formatFn(tag.value) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #body="{ params, searchFn }">
|
<template #body="{ params, searchFn }">
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate :label="t('From')" v-model="params.from" is-outlined />
|
<VnInputDate
|
||||||
|
:label="t('globals.from')"
|
||||||
|
v-model="params.from"
|
||||||
|
is-outlined
|
||||||
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<VnInputDate :label="t('To')" v-model="params.to" is-outlined />
|
<VnInputDate
|
||||||
|
:label="t('globals.to')"
|
||||||
|
v-model="params.to"
|
||||||
|
is-outlined
|
||||||
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
|
@ -45,7 +53,6 @@ const activities = ref([]);
|
||||||
url="Suppliers"
|
url="Suppliers"
|
||||||
:fields="['id', 'nickname']"
|
:fields="['id', 'nickname']"
|
||||||
:label="t('params.supplierFk')"
|
:label="t('params.supplierFk')"
|
||||||
option-value="id"
|
|
||||||
option-label="nickname"
|
option-label="nickname"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
|
@ -112,6 +119,20 @@ const activities = ref([]);
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
|
<QItem>
|
||||||
|
<QItemSection>
|
||||||
|
<VnSelect
|
||||||
|
v-model="params.companyFk"
|
||||||
|
:label="t('globals.company')"
|
||||||
|
url="Companies"
|
||||||
|
option-label="code"
|
||||||
|
:fields="['id', 'code']"
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
rounded
|
||||||
|
/>
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
|
@ -120,8 +141,6 @@ const activities = ref([]);
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
toggle-indeterminate
|
toggle-indeterminate
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
|
||||||
<QItemSection>
|
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('params.correctingFk')"
|
:label="t('params.correctingFk')"
|
||||||
v-model="params.correctingFk"
|
v-model="params.correctingFk"
|
||||||
|
@ -141,7 +160,6 @@ en:
|
||||||
supplierRef: Supplier ref.
|
supplierRef: Supplier ref.
|
||||||
supplierFk: Supplier
|
supplierFk: Supplier
|
||||||
fi: Supplier fiscal id
|
fi: Supplier fiscal id
|
||||||
clientFk: Customer
|
|
||||||
amount: Amount
|
amount: Amount
|
||||||
created: Created
|
created: Created
|
||||||
awb: AWB
|
awb: AWB
|
||||||
|
@ -152,17 +170,13 @@ en:
|
||||||
isBooked: is booked
|
isBooked: is booked
|
||||||
correctedFk: Rectified
|
correctedFk: Rectified
|
||||||
issued: Issued
|
issued: Issued
|
||||||
to: To
|
|
||||||
from: From
|
|
||||||
awbCode: AWB
|
awbCode: AWB
|
||||||
correctingFk: Rectificative
|
correctingFk: Rectificative
|
||||||
supplierActivityFk: Supplier activity
|
|
||||||
es:
|
es:
|
||||||
params:
|
params:
|
||||||
search: Id o nombre proveedor
|
search: Id o nombre proveedor
|
||||||
supplierRef: Ref. proveedor
|
supplierRef: Ref. proveedor
|
||||||
supplierFk: Proveedor
|
supplierFk: Proveedor
|
||||||
clientFk: Cliente
|
|
||||||
fi: CIF proveedor
|
fi: CIF proveedor
|
||||||
serialNumber: Num. serie
|
serialNumber: Num. serie
|
||||||
serial: Serie
|
serial: Serie
|
||||||
|
@ -175,11 +189,6 @@ es:
|
||||||
dued: Vencida
|
dued: Vencida
|
||||||
correctedFk: Rectificada
|
correctedFk: Rectificada
|
||||||
correctingFk: Rectificativa
|
correctingFk: Rectificativa
|
||||||
supplierActivityFk: Actividad proveedor
|
|
||||||
from: Desde
|
|
||||||
to: Hasta
|
|
||||||
From: Desde
|
|
||||||
To: Hasta
|
|
||||||
Amount: Importe
|
Amount: Importe
|
||||||
Issued: Fecha factura
|
Issued: Fecha factura
|
||||||
Id or supplier: Id o proveedor
|
Id or supplier: Id o proveedor
|
||||||
|
|
|
@ -79,6 +79,18 @@ const cols = computed(() => [
|
||||||
label: t('invoiceIn.list.amount'),
|
label: t('invoiceIn.list.amount'),
|
||||||
format: ({ amount }) => toCurrency(amount),
|
format: ({ amount }) => toCurrency(amount),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'companyFk',
|
||||||
|
label: t('globals.company'),
|
||||||
|
columnFilter: {
|
||||||
|
component: 'select',
|
||||||
|
attrs: {
|
||||||
|
url: 'Companies',
|
||||||
|
fields: ['id', 'code'],
|
||||||
|
optionLabel: 'code',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
align: 'right',
|
align: 'right',
|
||||||
name: 'tableActions',
|
name: 'tableActions',
|
||||||
|
|
Loading…
Reference in New Issue
Se usa en varios sitios