From a6a27237341f27db158378a45d064b6458d33139 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 27 Jan 2025 14:21:09 +0100 Subject: [PATCH 01/55] feat: refs #8463 cardDescriptorBeta --- src/components/common/VnCardBeta.vue | 75 +++-- src/components/ui/CardDescriptorBeta.vue | 262 ++++++++++++++++++ src/pages/Order/Card/OrderCard.vue | 30 ++ src/pages/Order/Card/OrderDescriptor.vue | 45 +-- src/pages/Order/Card/OrderDescriptorProxy.vue | 7 +- src/pages/Order/Card/OrderSummary.vue | 3 +- 6 files changed, 358 insertions(+), 64 deletions(-) create mode 100644 src/components/ui/CardDescriptorBeta.vue diff --git a/src/components/common/VnCardBeta.vue b/src/components/common/VnCardBeta.vue index a1f07ff17..2579bf623 100644 --- a/src/components/common/VnCardBeta.vue +++ b/src/components/common/VnCardBeta.vue @@ -1,5 +1,5 @@ diff --git a/src/components/ui/CardDescriptorBeta.vue b/src/components/ui/CardDescriptorBeta.vue new file mode 100644 index 000000000..b2bac234d --- /dev/null +++ b/src/components/ui/CardDescriptorBeta.vue @@ -0,0 +1,262 @@ + + + + + + + diff --git a/src/pages/Order/Card/OrderCard.vue b/src/pages/Order/Card/OrderCard.vue index 823815f59..b371509c6 100644 --- a/src/pages/Order/Card/OrderCard.vue +++ b/src/pages/Order/Card/OrderCard.vue @@ -1,12 +1,42 @@ diff --git a/src/pages/Order/Card/OrderDescriptor.vue b/src/pages/Order/Card/OrderDescriptor.vue index 0d5f0146f..4c2384f92 100644 --- a/src/pages/Order/Card/OrderDescriptor.vue +++ b/src/pages/Order/Card/OrderDescriptor.vue @@ -6,10 +6,11 @@ import { toCurrency, toDate } from 'src/filters'; import { useState } from 'src/composables/useState'; import useCardDescription from 'src/composables/useCardDescription'; -import CardDescriptor from 'components/ui/CardDescriptor.vue'; import VnLv from 'src/components/ui/VnLv.vue'; import FetchData from 'components/FetchData.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; +import OrderCard from './OrderCard.vue'; +import CardDescriptorBeta from 'src/components/ui/CardDescriptorBeta.vue'; const DEFAULT_ITEMS = 0; @@ -26,37 +27,13 @@ const state = useState(); const { t } = useI18n(); const data = ref(useCardDescription()); const getTotalRef = ref(); +const total = ref(0); const entityId = computed(() => { return $props.id || route.params.id; }); -const filter = { - include: [ - { relation: 'agencyMode', scope: { fields: ['name'] } }, - { - relation: 'address', - scope: { fields: ['nickname'] }, - }, - { relation: 'rows', scope: { fields: ['id'] } }, - { - relation: 'client', - scope: { - fields: [ - 'salesPersonFk', - 'name', - 'isActive', - 'isFreezed', - 'isTaxDataChecked', - ], - include: { - relation: 'salesPersonUser', - scope: { fields: ['id', 'name'] }, - }, - }, - }, - ], -}; +const orderTotal = computed(() => state.get('orderTotal') ?? 0); const setData = (entity) => { if (!entity) return; @@ -68,9 +45,6 @@ const setData = (entity) => { const getConfirmationValue = (isConfirmed) => { return t(isConfirmed ? 'globals.confirmed' : 'order.summary.notConfirmed'); }; - -const orderTotal = computed(() => state.get('orderTotal') ?? 0); -const total = ref(0); diff --git a/src/pages/Order/Card/OrderDescriptorProxy.vue b/src/pages/Order/Card/OrderDescriptorProxy.vue index 04ebb054a..7b3d1a871 100644 --- a/src/pages/Order/Card/OrderDescriptorProxy.vue +++ b/src/pages/Order/Card/OrderDescriptorProxy.vue @@ -12,6 +12,11 @@ const $props = defineProps({ diff --git a/src/pages/Order/Card/OrderSummary.vue b/src/pages/Order/Card/OrderSummary.vue index a289688e4..bef97bc0f 100644 --- a/src/pages/Order/Card/OrderSummary.vue +++ b/src/pages/Order/Card/OrderSummary.vue @@ -13,6 +13,7 @@ import FetchedTags from 'components/ui/FetchedTags.vue'; import VnTitle from 'src/components/common/VnTitle.vue'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import OrderDescriptorMenu from 'pages/Order/Card/OrderDescriptorMenu.vue'; +import OrderDescriptorProxy from './OrderDescriptorProxy.vue'; const { t } = useI18n(); const route = useRoute(); @@ -106,7 +107,7 @@ async function handleConfirm() { From 658bd015caa50faaa47cca00c0f3767de21f5e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 14 Feb 2025 12:41:11 +0100 Subject: [PATCH 02/55] feat: refs #8529 invoiceIn move deductible field from head to lines --- .../InvoiceIn/Card/InvoiceInBasicData.vue | 28 ++++--------------- src/pages/InvoiceIn/Card/InvoiceInSummary.vue | 4 --- src/pages/InvoiceIn/Card/InvoiceInVat.vue | 15 ++++++++++ 3 files changed, 20 insertions(+), 27 deletions(-) diff --git a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue index 905ddebb2..9fe365a38 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue @@ -143,20 +143,12 @@ function deleteFile(dmsFk) { - - + option-label="withholding" + />
- - - @@ -313,7 +296,6 @@ function deleteFile(dmsFk) { supplierFk: Proveedor Expedition date: Fecha expedición Operation date: Fecha operación - Undeductible VAT: Iva no deducible Document: Documento Download file: Descargar archivo Entry date: Fecha asiento diff --git a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue index d358601d3..f2393a56d 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue @@ -272,10 +272,6 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`; :label="t('invoiceIn.summary.sage')" :value="entity.sageWithholding?.withholding" /> - [ sortable: true, align: 'left', }, + { + name: 'isDeductible', + label: t('Deductible'), + field: (row) => row.isDeductible, + model: 'isDeductible', + align: 'center', + }, { name: 'sageiva', label: t('Sage iva'), @@ -119,6 +126,7 @@ const filter = { 'foreignValue', 'taxTypeSageFk', 'transactionTypeSageFk', + 'isDeductible', ], where: { invoiceInFk: route.params.id, @@ -227,6 +235,11 @@ function setCursor(ref) { + + \ No newline at end of file From 816a6197c72bd11b3e44a10d700569738491e937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Mon, 3 Mar 2025 18:05:19 +0100 Subject: [PATCH 06/55] feat: refs #8529 enhance InvoiceInVat component with data-cy attribute for isDeductible checkbox --- src/pages/InvoiceIn/Card/InvoiceInVat.vue | 5 ++++- .../invoiceIn/invoiceInBasicData.spec.js | 6 +----- .../invoiceIn/invoiceInDescriptor.spec.js | 4 ++-- .../integration/invoiceIn/invoiceInVat.spec.js | 13 ++++++++++++- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/pages/InvoiceIn/Card/InvoiceInVat.vue b/src/pages/InvoiceIn/Card/InvoiceInVat.vue index 0f8f9a6c5..7077c9a59 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInVat.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInVat.vue @@ -237,7 +237,10 @@ function setCursor(ref) { diff --git a/src/components/ui/VnDescriptor.vue b/src/components/ui/VnDescriptor.vue new file mode 100644 index 000000000..0aad35448 --- /dev/null +++ b/src/components/ui/VnDescriptor.vue @@ -0,0 +1,298 @@ + + + + + + + + + en: + globals: + copyId: Copy ID + es: + globals: + copyId: Copiar ID + diff --git a/src/pages/Order/Card/OrderDescriptor.vue b/src/pages/Order/Card/OrderDescriptor.vue index 133d328c0..15e8cf070 100644 --- a/src/pages/Order/Card/OrderDescriptor.vue +++ b/src/pages/Order/Card/OrderDescriptor.vue @@ -4,8 +4,6 @@ import { useRoute } from 'vue-router'; import { useI18n } from 'vue-i18n'; import { toCurrency, toDate } from 'src/filters'; import { useState } from 'src/composables/useState'; -import filter from './OrderFilter.js'; -import CardDescriptor from 'components/ui/CardDescriptor.vue'; import VnLv from 'src/components/ui/VnLv.vue'; import FetchData from 'components/FetchData.vue'; import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue'; @@ -57,14 +55,11 @@ const getConfirmationValue = (isConfirmed) => { /> diff --git a/src/pages/Worker/WorkerFilter.vue b/src/pages/Worker/WorkerFilter.vue index 8210ba0e3..44dfd32b4 100644 --- a/src/pages/Worker/WorkerFilter.vue +++ b/src/pages/Worker/WorkerFilter.vue @@ -35,7 +35,7 @@ const getLocale = (label) => { diff --git a/src/pages/Zone/ZoneDeliveryPanel.vue b/src/pages/Zone/ZoneDeliveryPanel.vue index a8cb05afc..fc5c04b41 100644 --- a/src/pages/Zone/ZoneDeliveryPanel.vue +++ b/src/pages/Zone/ZoneDeliveryPanel.vue @@ -95,8 +95,7 @@ watch( :filter-options="['code']" hide-selected dense - outlined - rounded + filled map-key="geoFk" data-cy="ZoneDeliveryDaysPostcodeSelect" > @@ -128,8 +127,7 @@ watch( option-label="name" hide-selected dense - outlined - rounded + filled data-cy="ZoneDeliveryDaysAgencySelect" />
diff --git a/test/cypress/integration/vnComponent/VnLog.spec.js b/test/cypress/integration/vnComponent/VnLog.spec.js index e857457a7..ae0013150 100644 --- a/test/cypress/integration/vnComponent/VnLog.spec.js +++ b/test/cypress/integration/vnComponent/VnLog.spec.js @@ -25,7 +25,7 @@ describe('VnLog', () => { it('should show claimDescriptor', () => { cy.dataCy('iconLaunch-claimFk').first().click(); - cy.dataCy('cardDescriptor_subtitle').contains('1'); + cy.dataCy('vnDescriptor_subtitle').contains('1'); cy.dataCy('iconLaunch-claimFk').first().click(); }); }); diff --git a/test/cypress/integration/worker/workerPda.spec.js b/test/cypress/integration/worker/workerPda.spec.js index 31ec19eda..2623e81cf 100644 --- a/test/cypress/integration/worker/workerPda.spec.js +++ b/test/cypress/integration/worker/workerPda.spec.js @@ -1,23 +1,80 @@ describe('WorkerPda', () => { - const select = '[data-cy="pda-dialog-select"]'; + const deviceId = 4; beforeEach(() => { - cy.viewport(1920, 1080); cy.login('developer'); cy.visit(`/#/worker/1110/pda`); }); - it('assign pda', () => { - cy.addBtnClick(); - cy.get(select).click(); - cy.get(select).type('{downArrow}{enter}'); - cy.get('.q-notification__message').should('have.text', 'Data created'); + it('assign and delete pda', () => { + creatNewPDA(); + cy.checkNotification('Data created'); + cy.visit(`/#/worker/1110/pda`); + removeNewPDA(); + cy.checkNotification('PDA deallocated'); }); - it('delete pda', () => { - cy.get('.btn-delete').click(); - cy.get( - '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block' - ).click(); - cy.get('.q-notification__message').should('have.text', 'PDA deallocated'); + it('send and download pdf to docuware', () => { + //Send + cy.intercept('POST', '/api/Docuwares/upload-pda-pdf', (req) => { + req.reply({ + statusCode: 200, + body: {}, + }); + }); + + creatNewPDA(); + + cy.dataCy('workerPda-send').click(); + cy.clickConfirm(); + cy.checkNotification('PDF sended to signed'); + + //Download + cy.intercept('POST', /\/api\/Docuwares\/Jones%20Jessica\/checkFile/, (req) => { + req.reply({ + statusCode: 200, + body: { + id: deviceId, + state: 'Firmado', + }, + }); + }); + cy.get('#st-actions').contains('refresh').click(); + cy.intercept('GET', '/api/Docuwares/download-pda-pdf**', (req) => { + req.reply({ + statusCode: 200, + body: {}, + }); + }); + + cy.dataCy('workerPda-download').click(); + removeNewPDA(); }); + + it('send 2 pdfs to docuware', () => { + cy.intercept('POST', '/api/Docuwares/upload-pda-pdf', (req) => { + req.reply({ + statusCode: 200, + body: {}, + }); + }); + + creatNewPDA(); + creatNewPDA(2); + cy.selectRows([1, 2]); + cy.get('#st-actions').contains('Send').click(); + cy.checkNotification('PDF sended to signed'); + + removeNewPDA(); + }); + + function creatNewPDA(id = deviceId) { + cy.addBtnClick(); + cy.selectOption('[data-cy="pda-dialog-select"]', id); + cy.saveCard(); + } + + function removeNewPDA() { + cy.dataCy('workerPda-remove').first().click(); + cy.clickConfirm(); + } }); diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index de25959b2..fe8d38e79 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -371,7 +371,7 @@ Cypress.Commands.add('validateContent', (selector, expectedValue) => { }); Cypress.Commands.add('openActionsDescriptor', () => { - cy.get('[data-cy="cardDescriptor"] [data-cy="descriptor-more-opts"]').click(); + cy.get('[data-cy="vnDescriptor"] [data-cy="descriptor-more-opts"]').click(); }); Cypress.Commands.add('openUserPanel', () => { @@ -466,16 +466,16 @@ Cypress.Commands.add('validateDescriptor', (toCheck = {}) => { const popupSelector = popup ? '[role="menu"] ' : ''; - if (title) cy.get(`${popupSelector}[data-cy="cardDescriptor_title"]`).contains(title); + if (title) cy.get(`${popupSelector}[data-cy="vnDescriptor_title"]`).contains(title); if (description) - cy.get(`${popupSelector}[data-cy="cardDescriptor_description"]`).contains( + cy.get(`${popupSelector}[data-cy="vnDescriptor_description"]`).contains( description, ); if (subtitle) - cy.get(`${popupSelector}[data-cy="cardDescriptor_subtitle"]`).contains(subtitle); + cy.get(`${popupSelector}[data-cy="vnDescriptor_subtitle"]`).contains(subtitle); for (const index in listbox) - cy.get(`${popupSelector}[data-cy="cardDescriptor_listbox"] > *`) + cy.get(`${popupSelector}[data-cy="vnDescriptor_listbox"] > *`) .eq(index) .should('contain.text', listbox[index]); }); From 88c61c8a856b79bd289efaaa022ead0b26f1334c Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 24 Mar 2025 14:27:18 +0100 Subject: [PATCH 47/55] fix: warmFix quasar build async function --- src/composables/downloadFile.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/composables/downloadFile.js b/src/composables/downloadFile.js index 302836e09..0c4e8edb6 100644 --- a/src/composables/downloadFile.js +++ b/src/composables/downloadFile.js @@ -5,18 +5,19 @@ import { exportFile } from 'quasar'; const { getTokenMultimedia } = useSession(); const token = getTokenMultimedia(); -const appUrl = (await getUrl('', 'lilium')).replace('/#/', ''); export async function downloadFile(id, model = 'dms', urlPath = '/downloadFile', url) { + const appUrl = await getAppUrl(); const response = await axios.get( url ?? `${appUrl}/api/${model}/${id}${urlPath}?access_token=${token}`, - { responseType: 'blob' } + { responseType: 'blob' }, ); download(response); } export async function downloadDocuware(url, params) { + const appUrl = await getAppUrl(); const response = await axios.get(`${appUrl}/api/` + url, { responseType: 'blob', params, @@ -32,3 +33,7 @@ function download(response) { exportFile(filename, response.data); } + +async function getAppUrl() { + return (await getUrl('', 'lilium')).replace('/#/', ''); +} From 535fe011f61f3511ff5cc2df7c1a942cb668c97e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Mon, 24 Mar 2025 17:51:29 +0100 Subject: [PATCH 48/55] feat: refs #8529 add isDeductible column and localization for InvoiceIn summary --- src/pages/InvoiceIn/Card/InvoiceInSummary.vue | 16 ++++++++++++++++ src/pages/InvoiceIn/Card/InvoiceInVat.vue | 3 +-- src/pages/InvoiceIn/locale/en.yml | 1 + src/pages/InvoiceIn/locale/es.yml | 1 + .../invoiceIn/invoiceInDescriptor.spec.js | 3 --- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue index 4f1140a9a..d5fded4bc 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInSummary.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInSummary.vue @@ -40,6 +40,13 @@ const vatColumns = ref([ sortable: true, align: 'left', }, + { + name: 'isDeductible', + label: 'invoiceIn.isDeductible', + field: (row) => row.isDeductible, + sortable: true, + align: 'center', + }, { name: 'vat', label: 'invoiceIn.summary.sageVat', @@ -331,6 +338,15 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`; +