+
(stateStore.rightDrawer = true));
{{ row.item.name }}
{{ row.item.subName }}
-
+
{{ packingTypeVolume?.[rowIndex]?.volume }}
diff --git a/src/pages/Ticket/TicketFilter.vue b/src/pages/Ticket/TicketFilter.vue
index c82c0067f..5da2a858c 100644
--- a/src/pages/Ticket/TicketFilter.vue
+++ b/src/pages/Ticket/TicketFilter.vue
@@ -46,7 +46,12 @@ const getGroupedStates = (data) => {
"
auto-load
/>
- (agencies = data)" auto-load />
+ (agencies = data)"
+ auto-load
+ />
(warehouses = data)" auto-load />
@@ -74,10 +79,20 @@ const getGroupedStates = (data) => {
-
+
-
+
diff --git a/src/pages/Ticket/TicketList.vue b/src/pages/Ticket/TicketList.vue
index 33b841d2d..c2d8f39f3 100644
--- a/src/pages/Ticket/TicketList.vue
+++ b/src/pages/Ticket/TicketList.vue
@@ -1,6 +1,6 @@
@@ -456,7 +495,7 @@ function setReference(data) {
urlCreate: 'Tickets/new',
title: t('ticketList.createTicket'),
onDataSaved: ({ id }) => tableRef.redirect(id),
- formInitialData: { clientId: null },
+ formInitialData,
}"
default-mode="table"
:columns="columns"
@@ -538,11 +577,9 @@ function setReference(data) {
:label="t('ticketList.client')"
v-model="data.clientId"
:options="clientsOptions"
- option-value="id"
- option-label="name"
hide-selected
required
- @update:model-value="(client) => onClientSelected(data)"
+ @update:model-value="() => onClientSelected(data)"
:sort-by="'id ASC'"
>
@@ -564,7 +601,6 @@ function setReference(data) {
:label="t('basicData.address')"
v-model="data.addressId"
:options="addressesOptions"
- option-value="id"
option-label="nickname"
hide-selected
map-options
@@ -610,6 +646,9 @@ function setReference(data) {
{{ scope.opt?.city }}
+
+ {{ `#${scope.opt?.id}` }}
+
@@ -633,8 +672,6 @@ function setReference(data) {
:label="t('globals.warehouse')"
v-model="data.warehouseId"
:options="warehousesOptions"
- option-value="id"
- option-label="name"
hide-selected
required
@update:model-value="() => fetchAvailableAgencies(data)"
@@ -694,7 +731,6 @@ function setReference(data) {
:label="t('ticketList.company')"
v-model="dialogData.companyFk"
:options="companiesOptions"
- option-value="id"
option-label="code"
hide-selected
>
@@ -705,7 +741,6 @@ function setReference(data) {
:label="t('ticketList.bank')"
v-model="dialogData.bankFk"
:options="accountingOptions"
- option-value="id"
option-label="bank"
hide-selected
@update:model-value="setReference"
diff --git a/src/pages/Worker/Card/WorkerBasicData.vue b/src/pages/Worker/Card/WorkerBasicData.vue
index 56a9548c6..a78983e5c 100644
--- a/src/pages/Worker/Card/WorkerBasicData.vue
+++ b/src/pages/Worker/Card/WorkerBasicData.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/test/cypress/integration/client/clientAddress.spec.js b/test/cypress/integration/client/clientAddress.spec.js
index 8673c9083..5d82aa4bc 100644
--- a/test/cypress/integration/client/clientAddress.spec.js
+++ b/test/cypress/integration/client/clientAddress.spec.js
@@ -17,7 +17,7 @@ describe('Client consignee', () => {
const addressName = 'test';
cy.dataCy('Consignee_input').type(addressName);
cy.dataCy('Location_select').click();
- cy.get('[role="listbox"] .q-item:nth-child(1)').click();
+ cy.getOption();
cy.dataCy('Street address_input').type('TEST ADDRESS');
cy.get('.q-btn-group > .q-btn--standard').click();
cy.location('href').should('contain', '#/customer/1107/address');
diff --git a/test/cypress/integration/ticket/ticketFilter.spec.js b/test/cypress/integration/ticket/ticketFilter.spec.js
new file mode 100644
index 000000000..2e5a3f3ce
--- /dev/null
+++ b/test/cypress/integration/ticket/ticketFilter.spec.js
@@ -0,0 +1,15 @@
+///
+describe('TicketFilter', () => {
+ beforeEach(() => {
+ cy.login('developer');
+ cy.viewport(1920, 1080);
+ cy.visit('/#/ticket/list');
+ });
+
+ it('use search button', function () {
+ cy.waitForElement('.q-page');
+ cy.get('[data-cy="Customer ID_input"]').type('1105');
+ cy.searchBtnFilterPanel();
+ cy.location('href').should('contain', '#/ticket/15/summary');
+ });
+});
diff --git a/test/cypress/integration/ticket/ticketList.spec.js b/test/cypress/integration/ticket/ticketList.spec.js
index 593021e6e..c9b3092a8 100644
--- a/test/cypress/integration/ticket/ticketList.spec.js
+++ b/test/cypress/integration/ticket/ticketList.spec.js
@@ -1,6 +1,6 @@
///
describe('TicketList', () => {
- const firstRow = 'tbody > :nth-child(1)';
+ const firstRow = 'tbody.q-virtual-scroll__content tr:nth-child(1)';
beforeEach(() => {
cy.login('developer');
@@ -9,15 +9,14 @@ describe('TicketList', () => {
});
const searchResults = (search) => {
- cy.dataCy('vn-searchbar').find('input').focus();
- if (search) cy.dataCy('vn-searchbar').find('input').type(search);
+ if (search) cy.typeSearchbar().type(search);
cy.dataCy('vn-searchbar').find('input').type('{enter}');
- cy.dataCy('ticketListTable').should('exist');
+ // cy.dataCy('ticketListTable').should('exist');
cy.get(firstRow).should('exist');
};
it('should search results', () => {
- cy.dataCy('ticketListTable').should('not.exist');
+ // cy.dataCy('ticketListTable').should('not.exist');
cy.get('.q-field__control').should('exist');
searchResults();
});
@@ -27,7 +26,7 @@ describe('TicketList', () => {
cy.window().then((win) => {
cy.stub(win, 'open').as('windowOpen');
});
- cy.get(firstRow).find('.q-btn:first').click();
+ cy.get(firstRow).should('be.visible').find('.q-btn:first').click();
cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/);
});
@@ -38,6 +37,21 @@ describe('TicketList', () => {
cy.get('.summaryBody').should('exist');
});
+ it('filter client and create ticket', () => {
+ cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketSearchbar');
+ searchResults();
+
+ cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketFilter');
+ cy.dataCy('Customer ID_input').clear('1');
+ cy.dataCy('Customer ID_input').type('1101{enter}');
+
+ cy.get('[data-cy="vnTableCreateBtn"] > .q-btn__content > .q-icon').click();
+ cy.dataCy('Customer_select').should('have.value', 'Bruce Wayne');
+ cy.dataCy('Address_select').click();
+
+ cy.getOption().click();
+ cy.dataCy('Address_select').should('have.value', 'Bruce Wayne');
+ });
it('Client list create new client', () => {
cy.dataCy('vnTableCreateBtn').should('exist');
cy.dataCy('vnTableCreateBtn').click();
diff --git a/test/cypress/integration/ticket/ticketSale.spec.js b/test/cypress/integration/ticket/ticketSale.spec.js
index b59765ca6..805198857 100644
--- a/test/cypress/integration/ticket/ticketSale.spec.js
+++ b/test/cypress/integration/ticket/ticketSale.spec.js
@@ -112,7 +112,6 @@ describe('TicketSale', () => {
cy.dataCy('ticketSaleTransferBtn').click();
cy.dataCy('ticketTransferPopup').should('exist');
cy.dataCy('ticketTransferNewTicketBtn').click();
- //check the new ticket has been created succesfully
cy.get('.q-item > .q-item__label').should('not.have.text', ' #32');
});
@@ -138,7 +137,7 @@ describe('TicketSale', () => {
it('update price', () => {
const price = Number((Math.random() * 99 + 1).toFixed(2));
cy.waitForElement(firstRow);
- cy.get(':nth-child(10) > .q-btn').click();
+ cy.get('[data-col-field="price"]').find('.q-btn').click();
cy.waitForElement('[data-cy="ticketEditManaProxy"]');
cy.dataCy('ticketEditManaProxy').should('exist');
cy.waitForElement('[data-cy="Price_input"]');
@@ -147,15 +146,14 @@ describe('TicketSale', () => {
cy.dataCy('saveManaBtn').click();
handleVnConfirm();
- cy.get(':nth-child(10) > .q-btn > .q-btn__content').should(
- 'have.text',
- `ā¬${price}`,
- );
+ cy.get('[data-col-field="price"]')
+ .find('.q-btn > .q-btn__content')
+ .should('have.text', `ā¬${price}`);
});
- it('update dicount', () => {
+ it('update discount', () => {
const discount = Math.floor(Math.random() * 100) + 1;
selectFirstRow();
- cy.get(':nth-child(11) > .q-btn').click();
+ cy.get('[data-col-field="discount"]').find('.q-btn').click();
cy.waitForElement('[data-cy="ticketEditManaProxy"]');
cy.dataCy('ticketEditManaProxy').should('exist');
cy.waitForElement('[data-cy="Disc_input"]');
@@ -164,26 +162,24 @@ describe('TicketSale', () => {
cy.dataCy('saveManaBtn').click();
handleVnConfirm();
- cy.get(':nth-child(11) > .q-btn > .q-btn__content').should(
- 'have.text',
- `${discount}.00%`,
- );
+ cy.get('[data-col-field="discount"]')
+ .find('.q-btn > .q-btn__content')
+ .should('have.text', `${discount}.00%`);
});
it('change concept', () => {
- const quantity = Math.floor(Math.random() * 100) + 1;
+ const concept = Math.floor(Math.random() * 100) + 1;
cy.waitForElement(firstRow);
- cy.get(':nth-child(8) > .row').click();
- cy.get(
- '.q-menu > [data-v-ca3f07a4=""] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="undefined_input"]',
- )
- .type(quantity)
+ cy.get('[data-col-field="item"]').click();
+ cy.get('.q-menu')
+ .find('[data-cy="undefined_input"]')
+ .type(concept)
.type('{enter}');
handleVnConfirm();
- cy.get(':nth-child(8) >.row').should('contain.text', `${quantity}`);
+ cy.get('[data-col-field="item"]').should('contain.text', `${concept}`);
});
- it('changequantity ', () => {
+ it('change quantity ', () => {
const quantity = Math.floor(Math.random() * 100) + 1;
cy.waitForElement(firstRow);
cy.dataCy('ticketSaleQuantityInput').clear();
@@ -200,7 +196,7 @@ describe('TicketSale', () => {
});
function handleVnConfirm() {
- cy.get('[data-cy="VnConfirm_confirm"] > .q-btn__content > .block').click();
+ cy.get('[data-cy="VnConfirm_confirm"]').click();
cy.waitForElement('.q-notification__message');
cy.get('.q-notification__message').should('be.visible');
diff --git a/test/cypress/integration/vnComponent/UserPanel.spec.js b/test/cypress/integration/vnComponent/UserPanel.spec.js
index e83d07954..25724e873 100644
--- a/test/cypress/integration/vnComponent/UserPanel.spec.js
+++ b/test/cypress/integration/vnComponent/UserPanel.spec.js
@@ -18,7 +18,7 @@ describe('UserPanel', () => {
cy.get(userWarehouse).should('have.value', 'VNL').click();
// Actualizo la opción
- getOption(3);
+ cy.getOption(3);
//Compruebo la notificación
cy.get('.q-notification').should('be.visible');
@@ -26,7 +26,7 @@ describe('UserPanel', () => {
//Restauro el valor
cy.get(userWarehouse).click();
- getOption(2);
+ cy.getOption(2);
});
it('should notify when update user company', () => {
const userCompany =
@@ -39,7 +39,7 @@ describe('UserPanel', () => {
cy.get(userCompany).should('have.value', 'Warehouse One').click();
//Actualizo la opción
- getOption(2);
+ cy.getOption(2);
//Compruebo la notificación
cy.get('.q-notification').should('be.visible');
@@ -47,12 +47,6 @@ describe('UserPanel', () => {
//Restauro el valor
cy.get(userCompany).click();
- getOption(1);
+ cy.getOption(1);
});
});
-
-function getOption(index) {
- cy.waitForElement('[role="listbox"]');
- const option = `[role="listbox"] .q-item:nth-child(${index})`;
- cy.get(option).click();
-}
diff --git a/test/cypress/integration/vnComponent/VnLocation.spec.js b/test/cypress/integration/vnComponent/VnLocation.spec.js
index 986cbcaaf..ee49d6065 100644
--- a/test/cypress/integration/vnComponent/VnLocation.spec.js
+++ b/test/cypress/integration/vnComponent/VnLocation.spec.js
@@ -88,7 +88,7 @@ describe('VnLocation', () => {
cy.get(
firstOption.concat(' > .q-item__section > .q-item__label--caption'),
).should('have.text', postCodeLabel);
- cy.get(firstOption).click();
+ cy.getOption();
cy.get('.q-btn-group > .q-btn--standard > .q-btn__content > .q-icon').click();
cy.reload();
cy.waitForElement('.q-form');
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index 096a29dc1..dfec341cd 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -393,6 +393,22 @@ Cypress.Commands.add('clickButtonWithIcon', (iconClass) => {
cy.wrap($btn).click();
});
});
+
Cypress.Commands.add('clickButtonWithText', (buttonText) => {
cy.get('.q-btn').contains(buttonText).click();
});
+
+Cypress.Commands.add('getOption', (index = 1) => {
+ cy.waitForElement('[role="listbox"]');
+ cy.get(`[role="listbox"] .q-item:nth-child(${index})`).click();
+});
+
+Cypress.Commands.add('searchBtnFilterPanel', () => {
+ cy.get(
+ '.q-scrollarea__content > .q-btn--standard > .q-btn__content > .q-icon',
+ ).click();
+});
+
+Cypress.Commands.add('waitRequest', (alias, cb) => {
+ cy.wait(alias).then(cb);
+});