diff --git a/src/components/EntityCalendar.vue b/src/components/EntityCalendar.vue new file mode 100644 index 000000000..e6e54a832 --- /dev/null +++ b/src/components/EntityCalendar.vue @@ -0,0 +1,152 @@ + + + + + \ No newline at end of file diff --git a/src/components/EntityCalendarGrid.vue b/src/components/EntityCalendarGrid.vue new file mode 100644 index 000000000..09ccaad07 --- /dev/null +++ b/src/components/EntityCalendarGrid.vue @@ -0,0 +1,126 @@ + + + \ No newline at end of file diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index 3b2507f1e..0cbe541fc 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -186,7 +186,7 @@ onMounted(() => { if ($props.focusOnMount) setTimeout(() => vnSelectRef.value.showPopup(), 300); }); -const someIsLoading = computed(() => isLoading.value || arrayData?.isLoading?.value); +const someIsLoading = computed(() => isLoading.value || !!arrayData?.isLoading?.value); function findKeyInOptions() { if (!$props.options) return; return filter($props.modelValue, $props.options)?.length; @@ -376,7 +376,7 @@ function getCaption(opt) { > - - diff --git a/src/router/modules/entry.js b/src/router/modules/entry.js index 02eea8c6c..da380313b 100644 --- a/src/router/modules/entry.js +++ b/src/router/modules/entry.js @@ -85,6 +85,7 @@ export default { 'EntryLatestBuys', 'EntryStockBought', 'EntryWasteRecalc', + 'EntryPreAccount', ], }, component: RouterView, @@ -94,6 +95,7 @@ export default { name: 'EntryMain', path: '', component: () => import('src/components/common/VnModule.vue'), + props: (route) => ({ leftDrawer: route.name !== 'EntryPreAccount' }), redirect: { name: 'EntryIndexMain' }, children: [ { @@ -150,6 +152,15 @@ export default { }, component: () => import('src/pages/Entry/EntryWasteRecalc.vue'), }, + { + path: 'pre-account', + name: 'EntryPreAccount', + meta: { + title: 'entryPreAccount', + icon: 'account_balance', + }, + component: () => import('src/pages/Entry/EntryPreAccount.vue'), + }, ], }, ], diff --git a/src/router/modules/route.js b/src/router/modules/route.js index 2b7cfc5be..08ba1701f 100644 --- a/src/router/modules/route.js +++ b/src/router/modules/route.js @@ -170,6 +170,7 @@ const vehicleCard = { 'VehicleBasicData', 'VehicleNotes', 'VehicleDms', + 'VehicleEvents' ], }, children: [ @@ -209,6 +210,15 @@ const vehicleCard = { }, component: () => import('src/pages/Route/Vehicle/VehicleDms.vue'), }, + { + name: 'VehicleEvents', + path: 'events', + meta: { + title: 'calendar', + icon: 'vn:calendar', + }, + component: () => import('src/pages/Route/Vehicle/Card/VehicleEvents.vue'), + }, ], }; diff --git a/test/cypress/integration/entry/entryPreAccount.spec.js b/test/cypress/integration/entry/entryPreAccount.spec.js new file mode 100644 index 000000000..59fa4ee45 --- /dev/null +++ b/test/cypress/integration/entry/entryPreAccount.spec.js @@ -0,0 +1,48 @@ +/// +describe('Entry PreAccount Functionality', () => { + beforeEach(() => { + cy.login('administrative'); + cy.visit('/#/entry/pre-account'); + }); + + it("should pre-account without questions if it's agricultural", () => { + selectRowsByCol('id', [2]); + cy.dataCy('preAccount_btn').click(); + cy.checkNotification('It has been successfully pre-accounted'); + }); + + it("should ask to upload a doc. if it's not agricultural and doesn't have doc. ", () => { + selectRowsByCol('id', [3]); + 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.dataCy('FormModelPopup_save').click(); + cy.checkNotification('It has been successfully pre-accounted'); + }); + + it('should ask to inherit the doc. and open VnDms popup if user choose "no"', () => { + selectRowsByCol('id', [101]); + cy.dataCy('preAccount_btn').click(); + cy.dataCy('updateFileNo').click(); + cy.get('#formModel').should('be.visible'); + }); + + it('should ask to inherit the doc. and open VnDms popup if user choose "yes" and pre-account', () => { + selectRowsByCol('id', [101]); + cy.dataCy('preAccount_btn').click(); + cy.dataCy('updateFileYes').click(); + cy.checkNotification('It has been successfully pre-accounted'); + }); +}); + +function selectRowsByCol(col = 'id', vals = []) { + for (const val of vals) { + const regex = new RegExp(`^\\s*(${val})\\s*$`); + cy.contains(`[data-col-field="${col}"]`, regex) + .parent() + .find('td > .q-checkbox') + .click(); + } +} diff --git a/test/cypress/integration/item/itemTax.spec.js b/test/cypress/integration/item/itemTax.spec.js index 971e3a732..10c3ee889 100644 --- a/test/cypress/integration/item/itemTax.spec.js +++ b/test/cypress/integration/item/itemTax.spec.js @@ -6,7 +6,7 @@ describe('Item tax', () => { }); it('should modify the tax for Spain', () => { - cy.dataCy('Class_select').eq(1).type('General VAT{enter}'); + cy.dataCy('Class_select').eq(1).type('IVA General{enter}'); cy.dataCy('crudModelDefaultSaveBtn').click(); cy.checkNotification('Data saved'); }); diff --git a/test/cypress/integration/route/vehicle/vehicleEvents.spec.js b/test/cypress/integration/route/vehicle/vehicleEvents.spec.js new file mode 100644 index 000000000..f03e11b29 --- /dev/null +++ b/test/cypress/integration/route/vehicle/vehicleEvents.spec.js @@ -0,0 +1,27 @@ +describe('Vehicle', () => { + + beforeEach(() => { + cy.viewport(1920, 1080); + cy.login('deliveryAssistant'); + cy.visit(`/#/route/vehicle/3/events`); + }); + + it('should add, edit and delete a vehicle event', () => { + cy.get('.q-page-sticky > div > .q-btn').click(); + cy.dataCy('Started_inputDate').type('01/01/2001'); + cy.dataCy('Finished_inputDate').type('08/02/2001'); + cy.get(':nth-child(5)').find('[data-cy="Description_input"]').clear().type('Test'); + cy.selectOption('[data-cy="State_input"]', 3); + cy.get('.q-mt-lg > .q-btn--standard').click(); + + cy.get('.q-current-day > .q-calendar-month__day--content > .q-btn').click(); + cy.dataCy('Started_inputDate').clear().type('03/02/2001'); + cy.dataCy('Finished_inputDate').clear().type('15/03/2001'); + cy.get(':nth-child(5)').find('[data-cy="Description_input"]').clear().type('Test2'); + cy.selectOption('[data-cy="State_input"]', 5); + cy.get('.q-mt-lg > .q-btn--standard').click(); + + cy.dataCy('delete_event').eq(0).click(); + cy.dataCy('VnConfirm_confirm').click(); + }); +}); \ No newline at end of file