refactor: refs #8277 rename entry control to pre-account in components and localization
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Jorge Penadés 2025-04-04 17:14:42 +02:00
parent cd7f9e15fc
commit f79d7e0d9f
5 changed files with 61 additions and 26 deletions

View File

@ -54,7 +54,7 @@ let dmsFk;
const columns = computed(() => [
{
name: 'id',
label: t('entry.control.id'),
label: t('entry.preAccount.id'),
isId: true,
chip: {
condition: () => true,
@ -62,7 +62,7 @@ const columns = computed(() => [
},
{
name: 'invoiceNumber',
label: t('entry.control.invoiceNumber'),
label: t('entry.preAccount.invoiceNumber'),
},
{
name: 'company',
@ -85,11 +85,11 @@ const columns = computed(() => [
},
{
name: 'gestDocFk',
label: t('entry.control.gestDocFk'),
label: t('entry.preAccount.gestDocFk'),
},
{
name: 'dmsType',
label: t('entry.control.dmsType'),
label: t('entry.preAccount.dmsType'),
columnFilter: {
component: 'select',
label: null,
@ -100,11 +100,11 @@ const columns = computed(() => [
},
{
name: 'reference',
label: t('entry.control.reference'),
label: t('entry.preAccount.reference'),
},
{
name: 'shipped',
label: t('entry.control.shipped'),
label: t('entry.preAccount.shipped'),
format: ({ shipped }, dashIfEmpty) => dashIfEmpty(toDate(shipped)),
columnFilter: {
component: 'date',
@ -113,7 +113,7 @@ const columns = computed(() => [
},
{
name: 'landed',
label: t('entry.control.landed'),
label: t('entry.preAccount.landed'),
format: ({ landed }, dashIfEmpty) => dashIfEmpty(toDate(landed)),
columnFilter: {
component: 'date',
@ -122,7 +122,7 @@ const columns = computed(() => [
},
{
name: 'invoiceInFk',
label: t('entry.control.invoiceInFk'),
label: t('entry.preAccount.invoiceInFk'),
},
{
name: 'supplier',
@ -146,7 +146,7 @@ const columns = computed(() => [
},
{
name: 'description',
label: t('entry.control.entryType'),
label: t('entry.preAccount.entryType'),
columnFilter: {
component: 'select',
label: null,
@ -158,7 +158,7 @@ const columns = computed(() => [
},
{
name: 'payDem',
label: t('entry.control.payDem'),
label: t('entry.preAccount.payDem'),
columnFilter: {
component: 'number',
name: 'payDem',
@ -166,7 +166,7 @@ const columns = computed(() => [
},
{
name: 'accountType',
label: t('entry.control.accountType'),
label: t('entry.preAccount.accountType'),
columnFilter: {
component: 'select',
name: 'accountType',
@ -186,18 +186,18 @@ const columns = computed(() => [
},
{
name: 'isAgricultural',
label: t('entry.control.isAgricultural'),
label: t('entry.preAccount.isAgricultural'),
component: 'checkbox',
isEditable: false,
},
{
name: 'isBooked',
label: t('entry.control.isBooked'),
label: t('entry.preAccount.isBooked'),
component: 'checkbox',
},
{
name: 'received',
label: t('entry.control.received'),
label: t('entry.preAccount.received'),
component: 'checkbox',
isEditable: false,
},
@ -215,7 +215,7 @@ watch(selectedRows, (nVal, oVal) => {
if (nVal.length > oVal.length && nVal.at(-1).invoiceInFk)
quasar.dialog({
component: VnConfirm,
componentProps: { title: t('entry.control.hasInvoice') },
componentProps: { title: t('entry.preAccount.hasInvoice') },
});
});
@ -295,6 +295,7 @@ async function createInvoice(isAgricultural) {
dmsFk,
isAgricultural,
});
notify(t('entry.preAccount.success'), 'positive');
} catch (e) {
throw e;
} finally {
@ -352,8 +353,8 @@ async function createInvoice(isAgricultural) {
<VnSearchbar
:data-key
:url
:label="t('entry.control.search')"
:info="t('entry.control.searchInfo')"
:label="t('entry.preAccount.search')"
:info="t('entry.preAccount.searchInfo')"
:search-remove-params="false"
/>
<VnTable
@ -376,16 +377,18 @@ async function createInvoice(isAgricultural) {
@on-fetch="
(data) => (totalAmount = data?.reduce((acc, entry) => acc + entry.amount, 0))
"
auto-load
>
<template #top-left>
<QBtn
data-cy="preAccount_btn"
icon="account_balance"
color="primary"
class="q-mr-sm"
:disable="!selectedRows.length"
@click="preAccount"
>
<QTooltip>{{ t('entry.control.preAccount') }}</QTooltip>
<QTooltip>{{ t('entry.preAccount.preAccount') }}</QTooltip>
</QBtn>
<VnInputNumber
v-model="daysAgo"
@ -395,7 +398,7 @@ async function createInvoice(isAgricultural) {
:decimal-places="0"
@update:model-value="filterByDaysAgo"
debounce="500"
:title="t('entry.control.daysAgo')"
:title="t('entry.preAccount.daysAgo')"
/>
</template>
<template #column-id="{ row }">
@ -428,8 +431,8 @@ async function createInvoice(isAgricultural) {
</VnTable>
<VnConfirm
ref="updateDialog"
:title="t('entry.control.dialog.title')"
:message="t('entry.control.dialog.message')"
:title="t('entry.preAccount.dialog.title')"
:message="t('entry.preAccount.dialog.message')"
>
<template #actions>
<QBtn

View File

@ -118,7 +118,7 @@ entry:
searchInfo: You can search by entry reference
descriptorMenu:
showEntryReport: Show entry report
control:
preAccount:
gestDocFk: Gestdoc
dmsType: Gestdoc type
invoiceNumber: Entry ref.
@ -139,8 +139,9 @@ entry:
daysAgo: Max 365 days
search: Search
searchInfo: You can search by supplier name or nickname
preAccount: Pre-account
btn: Pre-account
hasInvoice: This entry has already an invoice in
success: It has been successfully pre-accounted
dialog:
title: Pre-account entries
message: Do you want the invoice to inherit the entry document?

View File

@ -69,7 +69,7 @@ entry:
observationType: Tipo de observación
search: Buscar entradas
searchInfo: Puedes buscar por referencia de entrada
control:
preAccount:
gestDocFk: Gestdoc
dmsType: Tipo gestdoc
invoiceNumber: Ref. Entrada
@ -90,8 +90,9 @@ entry:
daysAgo: Máximo 365 días
search: Buscar
searchInfo: Puedes buscar por nombre o alias de proveedor
preAccount: Precontabilizar
btn: Precontabilizar
hasInvoice: Esta entrada ya tiene una f. recibida
success: Se ha precontabilizado correctamente
dialog:
title: Precontabilizar entradas
message: ¿Desea que la factura herede el documento de la entrada?

View File

@ -153,7 +153,7 @@ export default {
component: () => import('src/pages/Entry/EntryWasteRecalc.vue'),
},
{
path: 'control',
path: 'pre-account',
name: 'EntryPreAccount',
meta: {
title: 'entryPreAccount',

View File

@ -0,0 +1,30 @@
/// <reference types="cypress" />
describe('Entry PreAccount Functionality', () => {
beforeEach(() => {
cy.login('administrative');
cy.visit('/#/entry/pre-account');
});
it('should handle entries with different suppliers or companies', () => {
cy.selectRows([1, 4]);
cy.dataCy('preAccount_btn').click();
cy.checkNotification('Entries must have the same supplier and company');
});
it("should pre-account without questions if it's agricultural", () => {
cy.selectRows([2]);
cy.dataCy('preAccount_btn').click();
cy.checkNotification('It has been successfully pre-accounted');
});
it.only('should upload the document and pre-account', () => {
cy.selectRows([1]);
cy.dataCy('preAccount_btn').click();
cy.dataCy('Reference_input').type('{selectall}234343fh', { delay: 0 });
cy.dataCy('VnDms_inputFile').selectFile('test/cypress/fixtures/image.jpg', {
force: true,
});
cy.get('[data-cy="FormModelPopup_save"]').click();
cy.checkNotification('It has been successfully pre-accounted');
});
});