#7936 improve InvoiceIn #1004

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

View File

@ -6,7 +6,7 @@ import { useRoute } from 'vue-router';
import toDate from 'filters/toDate';
import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue';
const { t } = useI18n();
const { t, te } = useI18n();
const $props = defineProps({
modelValue: {
type: Object,
@ -226,6 +226,12 @@ function sanitizer(params) {
}
return params;
}
const getLocale = (label) => {
const param = label.split('.').at(-1);
Review

Se usa en varios sitios

Se usa en varios sitios
const globalLocale = `globals.params.${param}`;
return te(globalLocale) ? t(globalLocale) : t(`params.${param}`);
};
</script>
<template>
@ -274,7 +280,12 @@ function sanitizer(params) {
:removable="!unremovableParams?.includes(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">
<strong>{{ chip.label }}:</strong>
<span>"{{ formatValue(chip.value) }}"</span>
@ -287,6 +298,7 @@ function sanitizer(params) {
:params="userParams"
:tags="customTags"
:format-fn="formatValue"
:get-locale="getLocale"
:search-fn="search"
/>
</div>
@ -294,7 +306,12 @@ function sanitizer(params) {
<QSeparator />
</QList>
<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>
</QForm>
<QInnerLoading

View File

@ -331,6 +331,10 @@ globals:
fi: FI
myTeam: My team
departmentFk: Department
companyFk: Company
from: From
to: To
supplierFk: Supplier
changePass: Change password
deleteConfirmTitle: Delete selected elements
changeState: Change state

View File

@ -335,6 +335,10 @@ globals:
SSN: NSS
fi: NIF
myTeam: Mi equipo
companyFk: Empresa
from: Desde
to: Hasta
supplierFk: Proveedor
changePass: Cambiar contraseña
deleteConfirmTitle: Eliminar los elementos seleccionados
changeState: Cambiar estado

View File

@ -21,21 +21,29 @@ const activities = ref([]);
@on-fetch="(data) => (activities = data)"
/>
<VnFilterPanel :data-key="dataKey" :search-button="true">
<template #tags="{ tag, formatFn }">
<template #tags="{ tag, formatFn, getLocale }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>
<strong>{{ getLocale(tag.label) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params, searchFn }">
<QItem>
<QItemSection>
<VnInputDate :label="t('From')" v-model="params.from" is-outlined />
<VnInputDate
:label="t('globals.from')"
v-model="params.from"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate :label="t('To')" v-model="params.to" is-outlined />
<VnInputDate
:label="t('globals.to')"
v-model="params.to"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
@ -45,7 +53,6 @@ const activities = ref([]);
url="Suppliers"
:fields="['id', 'nickname']"
:label="t('params.supplierFk')"
option-value="id"
option-label="nickname"
dense
outlined
@ -112,6 +119,20 @@ const activities = ref([]);
/>
</QItemSection>
</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>
<QItemSection>
<QCheckbox
@ -120,8 +141,6 @@ const activities = ref([]);
@update:model-value="searchFn()"
toggle-indeterminate
/>
</QItemSection>
<QItemSection>
<QCheckbox
:label="t('params.correctingFk')"
v-model="params.correctingFk"
@ -141,7 +160,6 @@ en:
supplierRef: Supplier ref.
supplierFk: Supplier
fi: Supplier fiscal id
clientFk: Customer
amount: Amount
created: Created
awb: AWB
@ -152,17 +170,13 @@ en:
isBooked: is booked
correctedFk: Rectified
issued: Issued
to: To
from: From
awbCode: AWB
correctingFk: Rectificative
supplierActivityFk: Supplier activity
es:
params:
search: Id o nombre proveedor
supplierRef: Ref. proveedor
supplierFk: Proveedor
clientFk: Cliente
fi: CIF proveedor
serialNumber: Num. serie
serial: Serie
@ -175,11 +189,6 @@ es:
dued: Vencida
correctedFk: Rectificada
correctingFk: Rectificativa
supplierActivityFk: Actividad proveedor
from: Desde
to: Hasta
From: Desde
To: Hasta
Amount: Importe
Issued: Fecha factura
Id or supplier: Id o proveedor

View File

@ -79,6 +79,18 @@ const cols = computed(() => [
label: t('invoiceIn.list.amount'),
format: ({ amount }) => toCurrency(amount),
},
{
name: 'companyFk',
label: t('globals.company'),
columnFilter: {
component: 'select',
attrs: {
url: 'Companies',
fields: ['id', 'code'],
optionLabel: 'code',
},
},
},
{
align: 'right',
name: 'tableActions',