refactor: refs #7936 locale
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Jorge Penadés 2024-11-27 09:54:56 +01:00
parent aba33a617e
commit 953f6f4af3
11 changed files with 85 additions and 93 deletions

View File

@ -230,7 +230,9 @@ function sanitizer(params) {
const getLocale = (label) => {
const param = label.split('.').at(-1);
const globalLocale = `globals.params.${param}`;
return te(globalLocale) ? t(globalLocale) : t(`params.${param}`);
if (te(globalLocale)) return t(globalLocale);
else if (te(t(`params.${param}`)));
else return t(`${route.meta.moduleName}.params.${param}`);
};
</script>

View File

@ -335,6 +335,12 @@ globals:
from: From
to: To
supplierFk: Supplier
supplierRef: Supplier ref
serial: Serial
amount: Importe
awbCode: AWB
correctedFk: Rectified
correctingFk: Rectificative
changePass: Change password
deleteConfirmTitle: Delete selected elements
changeState: Change state

View File

@ -339,6 +339,10 @@ globals:
from: Desde
to: Hasta
supplierFk: Proveedor
supplierRef: Ref. proveedor
serial: Serie
amount: Importe
awbCode: AWB
changePass: Cambiar contraseña
deleteConfirmTitle: Eliminar los elementos seleccionados
changeState: Cambiar estado

View File

@ -262,7 +262,7 @@ function deleteFile(dmsFk) {
</VnRow>
<VnRow>
<VnSelect
:label="t('invoiceIn.summary.sage')"
:label="t('InvoiceIn.summary.sage')"
v-model="data.withholdingSageFk"
:options="sageWithholdings"
option-value="id"

View File

@ -355,13 +355,13 @@ const createInvoiceInCorrection = async () => {
</QItem>
</template>
<template #body="{ entity }">
<VnLv :label="t('invoiceIn.list.issued')" :value="toDate(entity.issued)" />
<VnLv :label="t('Invoicein.list.issued')" :value="toDate(entity.issued)" />
<VnLv
:label="t('invoiceIn.summary.bookedDate')"
:label="t('Invoicein.summary.bookedDate')"
:value="toDate(entity.booked)"
/>
<VnLv :label="t('invoiceIn.list.amount')" :value="toCurrency(totalAmount)" />
<VnLv :label="t('invoiceIn.list.supplier')">
<VnLv :label="t('Invoicein.list.amount')" :value="toCurrency(totalAmount)" />
<VnLv :label="t('Invoicein.list.supplier')">
<template #value>
<span class="link">
{{ entity?.supplier?.nickname }}
@ -378,7 +378,7 @@ const createInvoiceInCorrection = async () => {
color="primary"
:to="routes.getSupplier(entity.supplierFk)"
>
<QTooltip>{{ t('invoiceIn.list.supplier') }}</QTooltip>
<QTooltip>{{ t('Invoicein.list.supplier') }}</QTooltip>
</QBtn>
<QBtn
size="md"

View File

@ -26,14 +26,14 @@ const intrastatTotals = ref({ amount: 0, net: 0, stems: 0 });
const vatColumns = ref([
{
name: 'expense',
label: 'invoiceIn.summary.expense',
label: 'InvoiceIn.summary.expense',
field: (row) => row.expenseFk,
sortable: true,
align: 'left',
},
{
name: 'landed',
label: 'invoiceIn.summary.taxableBase',
label: 'InvoiceIn.summary.taxableBase',
field: (row) => row.taxableBase,
format: (value) => toCurrency(value),
sortable: true,
@ -41,7 +41,7 @@ const vatColumns = ref([
},
{
name: 'vat',
label: 'invoiceIn.summary.sageVat',
label: 'InvoiceIn.summary.sageVat',
field: (row) => {
if (row.taxTypeSage) return `#${row.taxTypeSage.id} : ${row.taxTypeSage.vat}`;
},
@ -51,7 +51,7 @@ const vatColumns = ref([
},
{
name: 'transaction',
label: 'invoiceIn.summary.sageTransaction',
label: 'InvoiceIn.summary.sageTransaction',
field: (row) => {
if (row.transactionTypeSage)
return `#${row.transactionTypeSage.id} : ${row.transactionTypeSage?.transaction}`;
@ -62,7 +62,7 @@ const vatColumns = ref([
},
{
name: 'rate',
label: 'invoiceIn.summary.rate',
label: 'InvoiceIn.summary.rate',
field: (row) => taxRate(row.taxableBase, row.taxTypeSage?.rate),
format: (value) => toCurrency(value),
sortable: true,
@ -70,7 +70,7 @@ const vatColumns = ref([
},
{
name: 'currency',
label: 'invoiceIn.summary.currency',
label: 'InvoiceIn.summary.currency',
field: (row) => row.foreignValue,
format: (val) => val && toCurrency(val, currency.value),
sortable: true,
@ -81,21 +81,21 @@ const vatColumns = ref([
const dueDayColumns = ref([
{
name: 'date',
label: 'invoiceIn.summary.dueDay',
label: 'InvoiceIn.summary.dueDay',
field: (row) => toDate(row.dueDated),
sortable: true,
align: 'left',
},
{
name: 'bank',
label: 'invoiceIn.summary.bank',
label: 'InvoiceIn.summary.bank',
field: (row) => row.bank.bank,
sortable: true,
align: 'left',
},
{
name: 'amount',
label: 'invoiceIn.list.amount',
label: 'InvoiceIn.list.amount',
field: (row) => row.amount,
format: (value) => toCurrency(value),
sortable: true,
@ -103,7 +103,7 @@ const dueDayColumns = ref([
},
{
name: 'landed',
label: 'invoiceIn.summary.foreignValue',
label: 'InvoiceIn.summary.foreignValue',
field: (row) => row.foreignValue,
format: (val) => val && toCurrency(val, currency.value),
sortable: true,
@ -114,7 +114,7 @@ const dueDayColumns = ref([
const intrastatColumns = ref([
{
name: 'code',
label: 'invoiceIn.summary.code',
label: 'InvoiceIn.summary.code',
field: (row) => {
return `${row.intrastat.id}: ${row.intrastat?.description}`;
},
@ -123,21 +123,21 @@ const intrastatColumns = ref([
},
{
name: 'amount',
label: 'invoiceIn.list.amount',
label: 'InvoiceIn.list.amount',
field: (row) => toCurrency(row.amount),
sortable: true,
align: 'left',
},
{
name: 'net',
label: 'invoiceIn.summary.net',
label: 'InvoiceIn.summary.net',
field: (row) => row.net,
sortable: true,
align: 'left',
},
{
name: 'stems',
label: 'invoiceIn.summary.stems',
label: 'InvoiceIn.summary.stems',
field: (row) => row.stems,
format: (value) => value,
sortable: true,
@ -145,7 +145,7 @@ const intrastatColumns = ref([
},
{
name: 'landed',
label: 'invoiceIn.summary.country',
label: 'InvoiceIn.summary.country',
field: (row) => row.country?.code,
format: (value) => value,
sortable: true,
@ -210,7 +210,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
/>
</QCardSection>
<VnLv
:label="t('invoiceIn.list.supplier')"
:label="t('InvoiceIn.list.supplier')"
:value="entity.supplier?.name"
>
<template #value>
@ -221,14 +221,14 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
</template>
</VnLv>
<VnLv
:label="t('invoiceIn.list.supplierRef')"
:label="t('InvoiceIn.list.supplierRef')"
:value="entity.supplierRef"
/>
<VnLv
:label="t('invoiceIn.summary.currency')"
:label="t('InvoiceIn.summary.currency')"
:value="entity.currency?.code"
/>
<VnLv :label="t('invoiceIn.serial')" :value="`${entity.serial}`" />
<VnLv :label="t('InvoiceIn.serial')" :value="`${entity.serial}`" />
</QCard>
<QCard class="vn-one">
<QCardSection class="q-pa-none">
@ -239,19 +239,19 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
</QCardSection>
<VnLv
:ellipsis-value="false"
:label="t('invoiceIn.summary.issued')"
:label="t('InvoiceIn.summary.issued')"
:value="toDate(entity.issued)"
/>
<VnLv
:label="t('invoiceIn.summary.operated')"
:label="t('InvoiceIn.summary.operated')"
:value="toDate(entity.operated)"
/>
<VnLv
:label="t('invoiceIn.summary.bookEntried')"
:label="t('InvoiceIn.summary.bookEntried')"
:value="toDate(entity.bookEntried)"
/>
<VnLv
:label="t('invoiceIn.summary.bookedDate')"
:label="t('InvoiceIn.summary.bookedDate')"
:value="toDate(entity.booked)"
/>
</QCard>
@ -263,18 +263,18 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
/>
</QCardSection>
<VnLv
:label="t('invoiceIn.summary.sage')"
:label="t('InvoiceIn.summary.sage')"
:value="entity.sageWithholding?.withholding"
/>
<VnLv
:label="t('invoiceIn.summary.vat')"
:label="t('InvoiceIn.summary.vat')"
:value="entity.expenseDeductible?.name"
/>
<VnLv
:label="t('invoiceIn.card.company')"
:label="t('InvoiceIn.card.company')"
:value="entity.company?.code"
/>
<VnLv :label="t('invoiceIn.isBooked')" :value="invoiceIn?.isBooked" />
<VnLv :label="t('InvoiceIn.isBooked')" :value="invoiceIn?.isBooked" />
</QCard>
<QCard class="vn-one">
<QCardSection class="q-pa-none">
@ -285,11 +285,11 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
</QCardSection>
<QCardSection class="q-pa-none">
<VnLv
:label="t('invoiceIn.summary.taxableBase')"
:label="t('InvoiceIn.summary.taxableBase')"
:value="toCurrency(entity.totals.totalTaxableBase)"
/>
<VnLv label="Total" :value="toCurrency(entity.totals.totalVat)" />
<VnLv :label="t('invoiceIn.summary.dueTotal')">
<VnLv :label="t('InvoiceIn.summary.dueTotal')">
<template #value>
<QChip
dense
@ -297,8 +297,8 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
:color="amountsNotMatch ? 'negative' : 'transparent'"
:title="
amountsNotMatch
? t('invoiceIn.summary.noMatch')
: t('invoiceIn.summary.dueTotal')
? t('InvoiceIn.summary.noMatch')
: t('InvoiceIn.summary.dueTotal')
"
>
{{ toCurrency(entity.totals.totalDueDay) }}
@ -309,7 +309,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
</QCard>
<!--Vat-->
<QCard v-if="entity.invoiceInTax.length" class="vat">
<VnTitle :url="getLink('vat')" :text="t('invoiceIn.card.vat')" />
<VnTitle :url="getLink('vat')" :text="t('InvoiceIn.card.vat')" />
<QTable
:columns="vatColumns"
:rows="entity.invoiceInTax"
@ -357,7 +357,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
</QCard>
<!--Due Day-->
<QCard v-if="entity.invoiceInDueDay.length" class="due-day">
<VnTitle :url="getLink('due-day')" :text="t('invoiceIn.card.dueDay')" />
<VnTitle :url="getLink('due-day')" :text="t('InvoiceIn.card.dueDay')" />
<QTable :columns="dueDayColumns" :rows="entity.invoiceInDueDay" flat>
<template #header="dueDayProps">
<QTr :props="dueDayProps" class="bg">
@ -395,7 +395,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
<QCard v-if="entity.invoiceInIntrastat.length">
<VnTitle
:url="getLink('intrastat')"
:text="t('invoiceIn.card.intrastat')"
:text="t('InvoiceIn.card.intrastat')"
/>
<QTable
:columns="intrastatColumns"

View File

@ -83,7 +83,7 @@ const redirectToInvoiceInBasicData = (__, { id }) => {
</template>
</VnSelect>
<VnInput
:label="t('invoiceIn.list.supplierRef')"
:label="t('InvoiceIn.list.supplierRef')"
v-model="data.supplierRef"
/>
</VnRow>
@ -97,10 +97,10 @@ const redirectToInvoiceInBasicData = (__, { id }) => {
map-options
hide-selected
:required="true"
:rules="validate('invoiceIn.companyFk')"
:rules="validate('InvoiceIn.companyFk')"
/>
<VnInputDate
:label="t('invoiceIn.summary.issued')"
:label="t('InvoiceIn.summary.issued')"
v-model="data.issued"
/>
</VnRow>

View File

@ -27,7 +27,7 @@ const activities = ref([]);
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params, searchFn }">
<template #body="{ params, searchFn, getLocale }">
<QItem>
<QItemSection>
<VnInputDate
@ -52,7 +52,7 @@ const activities = ref([]);
v-model="params.supplierFk"
url="Suppliers"
:fields="['id', 'nickname']"
:label="t('params.supplierFk')"
:label="getLocale('supplierFk')"
option-label="nickname"
dense
outlined
@ -63,7 +63,7 @@ const activities = ref([]);
<QItem>
<QItemSection>
<VnInput
:label="t('params.supplierRef')"
:label="getLocale('supplierRef')"
v-model="params.supplierRef"
is-outlined
lazy-rules
@ -73,7 +73,7 @@ const activities = ref([]);
<QItem>
<QItemSection>
<VnInput
:label="t('params.fi')"
:label="getLocale('fi')"
v-model="params.fi"
is-outlined
lazy-rules
@ -83,7 +83,7 @@ const activities = ref([]);
<QItem>
<QItemSection>
<VnInput
:label="t('params.serial')"
:label="getLocale('serial')"
v-model="params.serial"
is-outlined
lazy-rules
@ -93,7 +93,7 @@ const activities = ref([]);
<QItem>
<QItemSection>
<VnInput
:label="t('params.account')"
:label="getLocale('account')"
v-model="params.account"
is-outlined
lazy-rules
@ -103,7 +103,7 @@ const activities = ref([]);
<QItem>
<QItemSection>
<VnInput
:label="t('params.awb')"
:label="getLocale('globals.params.awbCode')"
v-model="params.awbCode"
is-outlined
lazy-rules
@ -113,7 +113,7 @@ const activities = ref([]);
<QItem>
<QItemSection>
<VnInputNumber
:label="t('Amount')"
:label="t('globals.amount')"
v-model="params.amount"
is-outlined
/>
@ -136,7 +136,7 @@ const activities = ref([]);
<QItem>
<QItemSection>
<QCheckbox
:label="t('invoiceIn.isBooked')"
:label="t('InvoiceIn.isBooked')"
v-model="params.isBooked"
@update:model-value="searchFn()"
toggle-indeterminate
@ -157,40 +157,11 @@ const activities = ref([]);
en:
params:
search: Id or supplier name
supplierRef: Supplier ref.
supplierFk: Supplier
fi: Supplier fiscal id
amount: Amount
created: Created
awb: AWB
dued: Dued
serialNumber: Serial Number
serial: Serial
account: Ledger account
isBooked: is booked
correctedFk: Rectified
issued: Issued
awbCode: AWB
correctingFk: Rectificative
es:
params:
search: Id o nombre proveedor
supplierRef: Ref. proveedor
supplierFk: Proveedor
fi: CIF proveedor
serialNumber: Num. serie
serial: Serie
awb: AWB
amount: Importe
issued: Emitida
isBooked: Contabilizada
account: Cuenta contable
created: Creada
dued: Vencida
correctedFk: Rectificada
correctingFk: Rectificativa
Amount: Importe
Issued: Fecha factura
Id or supplier: Id o proveedor
More options: Más opciones
</i18n>

View File

@ -32,7 +32,7 @@ const cols = computed(() => [
{
align: 'left',
name: 'supplierFk',
label: t('invoiceIn.list.supplier'),
label: t('InvoiceIn.list.supplier'),
columnFilter: {
component: 'select',
attrs: {
@ -45,16 +45,16 @@ const cols = computed(() => [
{
align: 'left',
name: 'supplierRef',
label: t('invoiceIn.list.supplierRef'),
label: t('InvoiceIn.list.supplierRef'),
},
{
align: 'left',
name: 'serial',
label: t('invoiceIn.serial'),
label: t('InvoiceIn.serial'),
},
{
align: 'left',
label: t('invoiceIn.list.issued'),
label: t('InvoiceIn.list.issued'),
name: 'issued',
component: null,
columnFilter: {
@ -65,18 +65,18 @@ const cols = computed(() => [
{
align: 'left',
name: 'isBooked',
label: t('invoiceIn.isBooked'),
label: t('InvoiceIn.isBooked'),
columnFilter: false,
},
{
align: 'left',
name: 'awbCode',
label: t('invoiceIn.list.awb'),
label: t('InvoiceIn.list.awb'),
},
{
align: 'left',
name: 'amount',
label: t('invoiceIn.list.amount'),
label: t('InvoiceIn.list.amount'),
format: ({ amount }) => toCurrency(amount),
},
{
@ -163,7 +163,7 @@ const cols = computed(() => [
</template>
</VnSelect>
<VnInput
:label="t('invoiceIn.list.supplierRef')"
:label="t('InvoiceIn.list.supplierRef')"
v-model="data.supplierRef"
/>
<VnSelect
@ -175,7 +175,7 @@ const cols = computed(() => [
option-label="code"
:required="true"
/>
<VnInputDate :label="t('invoiceIn.summary.issued')" v-model="data.issued" />
<VnInputDate :label="t('InvoiceIn.summary.issued')" v-model="data.issued" />
</template>
</VnTable>
</template>

View File

@ -1,4 +1,4 @@
invoiceIn:
InvoiceIn:
serial: Serial
isBooked: Is booked
list:
@ -39,3 +39,8 @@ invoiceIn:
net: Net
stems: Stems
country: Country
params:
search: Id or supplier name
account: Ledger account
correctingFk: Rectificative
isBooked: Is booked

View File

@ -1,4 +1,4 @@
invoiceIn:
InvoiceIn:
serial: Serie
isBooked: Contabilizada
list:
@ -38,3 +38,7 @@ invoiceIn:
net: Neto
stems: Tallos
country: País
params:
search: Id o nombre proveedor
account: Cuenta contable
correctingFk: Rectificativa