diff --git a/src/boot/qformMixin.js b/src/boot/qformMixin.js index 0bf1f9795..fc7852369 100644 --- a/src/boot/qformMixin.js +++ b/src/boot/qformMixin.js @@ -1,28 +1,11 @@ import { getCurrentInstance } from 'vue'; -const filterAvailableInput = (element) => { - return element.classList.contains('q-field__native') && !element.disabled; -}; -const filterAvailableText = (element) => { - return ( - element.__vueParentComponent.type.name === 'QInput' && - element.__vueParentComponent?.attrs?.class !== 'vn-input-date' - ); -}; - export default { mounted: function () { const vm = getCurrentInstance(); if (vm.type.name === 'QForm') { if (!['searchbarForm', 'filterPanelForm'].includes(this.$el?.id)) { - // AUTOFOCUS - const elementsArray = Array.from(this.$el.elements); - const availableInputs = elementsArray.filter(filterAvailableInput); - const firstInputElement = availableInputs.find(filterAvailableText); - - if (firstInputElement) { - firstInputElement.focus(); - } + // TODO: AUTOFOCUS IS NOT FOCUSING const that = this; this.$el.addEventListener('keyup', function (evt) { if (evt.key === 'Enter') { diff --git a/src/components/VnTable/VnFilter.vue b/src/components/VnTable/VnFilter.vue index 285e2338e..b30cb6af4 100644 --- a/src/components/VnTable/VnFilter.vue +++ b/src/components/VnTable/VnFilter.vue @@ -45,7 +45,7 @@ const defaultAttrs = { }; const forceAttrs = { - label: $props.showTitle ? '' : $props.column.label, + label: $props.showTitle ? '' : columnFilter.value?.label ?? $props.column.label, }; const selectComponent = { diff --git a/src/components/VnTable/VnVisibleColumn.vue b/src/components/VnTable/VnVisibleColumn.vue index e3bb52637..6d9fd2c33 100644 --- a/src/components/VnTable/VnVisibleColumn.vue +++ b/src/components/VnTable/VnVisibleColumn.vue @@ -81,7 +81,7 @@ async function fetchViewConfigData() { return; } } catch (err) { - console.err('Error fetching config view data', err); + console.error('Error fetching config view data', err); } } diff --git a/src/components/common/TableVisibleColumns.vue b/src/components/common/TableVisibleColumns.vue index a4e4afafe..9a6c70ef0 100644 --- a/src/components/common/TableVisibleColumns.vue +++ b/src/components/common/TableVisibleColumns.vue @@ -84,7 +84,7 @@ const fetchViewConfigData = async () => { setUserConfigViewData(defaultColumns); } } catch (err) { - console.err('Error fetching config view data', err); + console.error('Error fetching config view data', err); } }; diff --git a/src/pages/Entry/MyEntries.vue b/src/pages/Entry/MyEntries.vue index e100ed565..e6974a04b 100644 --- a/src/pages/Entry/MyEntries.vue +++ b/src/pages/Entry/MyEntries.vue @@ -15,32 +15,65 @@ const columns = computed(() => [ name: 'id', label: t('customer.extendedList.tableVisibleColumns.id'), columnFilter: false, + isTitle: true, }, { + visible: false, + align: 'right', + label: t('shipped'), + name: 'shipped', + columnFilter: { + name: 'fromShipped', + label: t('fromShipped'), + component: 'date', + }, + format: ({ shipped }) => toDate(shipped), + }, + { + visible: false, align: 'left', label: t('shipped'), name: 'shipped', columnFilter: { + name: 'toShipped', + label: t('toShipped'), component: 'date', }, format: ({ shipped }) => toDate(shipped), cardVisible: true, }, { - align: 'left', - label: t('landed'), - name: 'from', - cardVisible: false, - columnFilter: { - component: 'date', - }, - format: ({ landed }) => toDate(landed), + align: 'right', + label: t('shipped'), + name: 'shipped', + columnFilter: false, + format: ({ shipped }) => toDate(shipped), }, { - align: 'left', + align: 'right', + label: t('landed'), + name: 'landed', + columnFilter: false, + format: ({ landed }) => toDate(landed), + }, + + { + align: 'right', label: t('globals.wareHouseIn'), - name: 'warehouseInName', + name: 'warehouseInFk', + format: (row) => row.warehouseInName, cardVisible: true, + columnFilter: { + component: 'select', + attrs: { + url: 'warehouses', + fields: ['id', 'name'], + optionLabel: 'name', + optionValue: 'id', + }, + alias: 't', + inWhere: true, + }, }, { align: 'left', @@ -77,7 +110,14 @@ const printBuys = (rowId) => { :label="t('Search entries')" :info="t('You can search by entry reference')" /> - + diff --git a/src/pages/Entry/locale/en.yml b/src/pages/Entry/locale/en.yml index 677c3c055..df78b17c9 100644 --- a/src/pages/Entry/locale/en.yml +++ b/src/pages/Entry/locale/en.yml @@ -8,4 +8,6 @@ entryFilter: reference: Reference landed: Landed shipped: Shipped +fromShipped: Shipped(from) +toShipped: Shipped(to) printBuys: Print buys diff --git a/src/pages/Entry/locale/es.yml b/src/pages/Entry/locale/es.yml index 10b77c2ee..4308722fb 100644 --- a/src/pages/Entry/locale/es.yml +++ b/src/pages/Entry/locale/es.yml @@ -12,4 +12,6 @@ entryFilter: landed: F. llegada shipped: F. salida +fromShipped: F. salida(desde) +toShipped: F. salida(hasta) Print buys: Imprimir etiquetas diff --git a/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue b/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue index 68dc5be4b..0d279de06 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInDescriptor.vue @@ -207,8 +207,14 @@ async function cloneInvoice() { const isAdministrative = () => hasAny(['administrative']); -const isAgricultural = () => - invoiceIn.value?.supplier?.sageWithholdingFk === config.value[0]?.sageWithholdingFk; +const isAgricultural = () => { + console.error(config); + if (!config.value) return false; + return ( + invoiceIn.value?.supplier?.sageFarmerWithholdingFk === + config?.value[0]?.sageWithholdingFk + ); +}; function showPdfInvoice() { if (isAgricultural()) openReport(`InvoiceIns/${entityId.value}/invoice-in-pdf`); diff --git a/src/pages/Travel/Card/TravelDescriptorMenuItems.vue b/src/pages/Travel/Card/TravelDescriptorMenuItems.vue index 1bb80ff01..bd2561211 100644 --- a/src/pages/Travel/Card/TravelDescriptorMenuItems.vue +++ b/src/pages/Travel/Card/TravelDescriptorMenuItems.vue @@ -38,7 +38,7 @@ const cloneTravelWithEntries = async () => { notify('globals.dataSaved', 'positive'); router.push({ name: 'TravelBasicData', params: { id: data.id } }); } catch (err) { - console.err('Error cloning travel with entries'); + console.error('Error cloning travel with entries'); } }; diff --git a/test/cypress/integration/entry/myEntry.spec.js b/test/cypress/integration/entry/myEntry.spec.js index 8edd3a11c..dca74dec2 100644 --- a/test/cypress/integration/entry/myEntry.spec.js +++ b/test/cypress/integration/entry/myEntry.spec.js @@ -7,7 +7,6 @@ describe('EntryMy when is supplier', () => { cy.stub(win, 'open'); }, }); - cy.waitForElement('.q-page', 6000); }); it('should open buyLabel when is supplier', () => { diff --git a/test/cypress/integration/invoiceIn/invoiceInCorrective.spec.js b/test/cypress/integration/invoiceIn/invoiceInCorrective.spec.js index efe5550c3..5bf9a89e5 100644 --- a/test/cypress/integration/invoiceIn/invoiceInCorrective.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInCorrective.spec.js @@ -1,7 +1,7 @@ /// describe('InvoiceInCorrective', () => { - const createRectificative = '.q-menu > .q-list > :nth-child(4) > .q-item__section'; + const createRectificative = '.q-menu > .q-list > :nth-child(6) > .q-item__section'; const rectificativeSection = '.q-drawer-container .q-list > a:nth-child(6)'; const saveDialog = '.q-card > .q-card__actions > .q-btn--standard '; diff --git a/test/cypress/integration/route/routeList.spec.js b/test/cypress/integration/route/routeList.spec.js index f28bc984d..afc0fc395 100644 --- a/test/cypress/integration/route/routeList.spec.js +++ b/test/cypress/integration/route/routeList.spec.js @@ -26,6 +26,6 @@ describe('Route', () => { cy.get(getRowColumn(1, 4) + getVnSelect).type('{downArrow}{enter}'); cy.get(getRowColumn(1, 5) + getVnSelect).type('{downArrow}{enter}'); cy.get('button[title="Save"]').click(); - cy.get('.q-notification__message').should('have.text', 'Data created'); + cy.get('.q-notification__message').should('have.text', 'Data saved'); }); });