diff --git a/src/pages/Customer/Card/CustomerDescriptor.vue b/src/pages/Customer/Card/CustomerDescriptor.vue index ce402541d..d7a8a59a1 100644 --- a/src/pages/Customer/Card/CustomerDescriptor.vue +++ b/src/pages/Customer/Card/CustomerDescriptor.vue @@ -192,6 +192,7 @@ const debtWarning = computed(() => { query: { createForm: JSON.stringify({ clientFk: entity.id, + addressId: entity.defaultAddressFk, }), }, }" diff --git a/src/pages/Item/Card/ItemDiary.vue b/src/pages/Item/Card/ItemDiary.vue index c2f2c19a0..4b6775183 100644 --- a/src/pages/Item/Card/ItemDiary.vue +++ b/src/pages/Item/Card/ItemDiary.vue @@ -125,7 +125,7 @@ onMounted(async () => { inventoriedDate.value = (await axios.get('Configs/findOne')).data?.inventoried || today; - if (query.warehouseFk) ref.warehouseFk = query.warehouseFk; + if (query.warehouseFk) ref.warehouseFk = +query.warehouseFk; else if (!ref.warehouseFk && user.value) ref.warehouseFk = user.value.warehouseFk; if (ref.date) showWhatsBeforeInventory.value = true; ref.itemFk = route.params.id; @@ -143,7 +143,7 @@ onMounted(async () => { const fetchItemBalances = async () => await arrayDataItemBalances.fetch({}); const getBadgeAttrs = (_date) => { - const isSameDate = date.isSameDate(today.value, _date); + const isSameDate = date.isSameDate(today, _date); const attrs = { 'text-color': isSameDate ? 'black' : 'white', color: isSameDate ? 'warning' : 'transparent', @@ -153,8 +153,6 @@ const getBadgeAttrs = (_date) => { const scrollToToday = async () => { await nextTick(); - const today = Date.vnNew(); - today.setHours(0, 0, 0, 0); const todayCell = document.querySelector(`td[data-date="${today.toISOString()}"]`); if (todayCell) { todayCell.scrollIntoView({ behavior: 'smooth', block: 'center' }); diff --git a/src/pages/Order/OrderList.vue b/src/pages/Order/OrderList.vue index 6e4f0aac8..21cb5ed7e 100644 --- a/src/pages/Order/OrderList.vue +++ b/src/pages/Order/OrderList.vue @@ -81,7 +81,7 @@ const columns = computed(() => [ label: t('module.created'), component: 'date', cardVisible: true, - format: (row) => toDateTimeFormat(row?.landed), + format: (row) => toDateTimeFormat(row?.created), columnField: { component: null, }, diff --git a/test/cypress/integration/client/clientList.spec.js b/test/cypress/integration/client/clientList.spec.js index dcded63b0..c0f22b34b 100644 --- a/test/cypress/integration/client/clientList.spec.js +++ b/test/cypress/integration/client/clientList.spec.js @@ -62,7 +62,7 @@ describe('Client list', () => { it('Client founded create order', () => { const search = 'Jessica Jones'; cy.searchByLabel('Name', search); - cy.openActionDescriptor('New order'); + cy.clickButtonWith('icon', 'icon-basketadd'); cy.waitForElement('#formModel'); cy.waitForElement('.q-form'); cy.checkValueForm(1, search); diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 6a436c1eb..2c93fbf84 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -289,40 +289,13 @@ Cypress.Commands.add('openActionDescriptor', (opt) => { cy.openActionsDescriptor(); const listItem = '[role="menu"] .q-list .q-item'; cy.contains(listItem, opt).click(); - 1; }); Cypress.Commands.add('openActionsDescriptor', () => { cy.get('[data-cy="descriptor-more-opts"]').click(); }); -Cypress.Commands.add('clickButtonsDescriptor', (id) => { - cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`) - .invoke('removeAttr', 'target') - .click(); -}); - -Cypress.Commands.add('openActionDescriptor', (opt) => { - cy.openActionsDescriptor(); - const listItem = '[role="menu"] .q-list .q-item'; - cy.contains(listItem, opt).click(); - 1; -}); - -Cypress.Commands.add('clickButtonsDescriptor', (id) => { - cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`) - .invoke('removeAttr', 'target') - .click(); -}); - -Cypress.Commands.add('openActionDescriptor', (opt) => { - cy.openActionsDescriptor(); - const listItem = '[role="menu"] .q-list .q-item'; - cy.contains(listItem, opt).click(); - 1; -}); - -Cypress.Commands.add('clickButtonsDescriptor', (id) => { +Cypress.Commands.add('clickButtonDescriptor', (id) => { cy.get(`.actions > .q-card__actions> .q-btn:nth-child(${id})`) .invoke('removeAttr', 'target') .click(); @@ -374,3 +347,21 @@ Cypress.Commands.add('addBtnClick', () => { .and('be.visible') .click(); }); + +Cypress.Commands.add('clickButtonWith', (type, value) => { + switch (type) { + case 'icon': + cy.clickButtonWithIcon(value); + break; + + default: + cy.clickButtonWithText(value); + break; + } +}); +Cypress.Commands.add('clickButtonWithIcon', (iconClass) => { + cy.get(`.q-icon.${iconClass}`).parent().click(); +}); +Cypress.Commands.add('clickButtonWithText', (buttonText) => { + cy.get('.q-btn').contains(buttonText).click(); +});