From 9956561e4c907a39d7199646c05dc4e34555bf58 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 24 Jun 2024 16:17:21 +0200 Subject: [PATCH 001/149] chore: refs #7300 wip: create reset function --- src/composables/useArrayData.js | 5 ++++ src/stores/useArrayDataStore.js | 41 +++++++++++++++++++++------------ 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index f97ade7bf..385cb6045 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -130,6 +130,10 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) { delete store[option]; } + function reset(opts = []) { + if (arrayDataStore.get(key)) arrayDataStore.reset(key, opts); + } + function cancelRequest() { if (canceller) { canceller.abort(); @@ -245,5 +249,6 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) { updateStateParams, isLoading, deleteOption, + reset, }; } diff --git a/src/stores/useArrayDataStore.js b/src/stores/useArrayDataStore.js index ebe32f8d0..0fe16d075 100644 --- a/src/stores/useArrayDataStore.js +++ b/src/stores/useArrayDataStore.js @@ -3,36 +3,47 @@ import { defineStore } from 'pinia'; export const useArrayDataStore = defineStore('arrayDataStore', () => { const state = ref({}); + const defaultOpts = { + filter: {}, + userFilter: {}, + userParams: {}, + url: '', + limit: 10, + skip: 0, + order: '', + data: ref(), + isLoading: false, + userParamsChanged: false, + exprBuilder: null, + searchUrl: 'params', + navigate: null, + }; function get(key) { return state.value[key]; } function set(key) { - state.value[key] = { - filter: {}, - userFilter: {}, - userParams: {}, - url: '', - limit: 10, - skip: 0, - order: '', - data: ref(), - isLoading: false, - userParamsChanged: false, - exprBuilder: null, - searchUrl: 'params', - navigate: null, - }; + state.value[key] = defaultOpts; } function clear(key) { delete state.value[key]; } + function reset(key, opts = []) { + let obj = state.value[key]; + if (!opts.length) obj = defaultOpts; + else + for (const opt in opts) { + if (Object.hasOwn(obj, opt)) obj[opt] = defaultOpts[opt]; + } + } + return { get, set, clear, + reset, }; }); From 4effba1580c4afa70c1fe2c01e3685a0b8e5b420 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 24 Jun 2024 16:38:41 -0300 Subject: [PATCH 002/149] Ticket dms --- src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + src/pages/Ticket/Card/TicketDms.vue | 13 +++++++++++++ src/router/modules/ticket.js | 11 ++++++++++- 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/pages/Ticket/Card/TicketDms.vue diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index b3a85eefa..63d5f630a 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -443,6 +443,7 @@ ticket: sms: Sms notes: Notes sale: Sale + dms: File management list: nickname: Nickname state: State diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index d03ee9d5c..92b77a351 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -441,6 +441,7 @@ ticket: sms: Sms notes: Notas sale: Lineas del pedido + dms: Gestión documental list: nickname: Alias state: Estado diff --git a/src/pages/Ticket/Card/TicketDms.vue b/src/pages/Ticket/Card/TicketDms.vue new file mode 100644 index 000000000..ae44fb795 --- /dev/null +++ b/src/pages/Ticket/Card/TicketDms.vue @@ -0,0 +1,13 @@ + + diff --git a/src/router/modules/ticket.js b/src/router/modules/ticket.js index 6cb7291dc..05e323d50 100644 --- a/src/router/modules/ticket.js +++ b/src/router/modules/ticket.js @@ -12,7 +12,7 @@ export default { redirect: { name: 'TicketMain' }, menus: { main: ['TicketList'], - card: ['TicketBoxing', 'TicketSms', 'TicketSale'], + card: ['TicketBoxing', 'TicketSms', 'TicketSale', 'TicketDms'], }, children: [ { @@ -93,6 +93,15 @@ export default { }, component: () => import('src/pages/Ticket/Card/TicketSms.vue'), }, + { + path: 'dms', + name: 'TicketDms', + meta: { + title: 'dms', + icon: 'cloud_upload', + }, + component: () => import('src/pages/Ticket/Card/TicketDms.vue'), + }, ], }, ], From c500dd6346479852457472558403e5bdfcf6a1d1 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 24 Jun 2024 16:58:26 -0300 Subject: [PATCH 003/149] Add allow import feature in VnDmsList --- src/components/common/VnDmsImportForm.vue | 81 +++++++++++++++++++++++ src/components/common/VnDmsList.vue | 12 ++++ src/pages/Ticket/Card/TicketDms.vue | 1 + 3 files changed, 94 insertions(+) create mode 100644 src/components/common/VnDmsImportForm.vue diff --git a/src/components/common/VnDmsImportForm.vue b/src/components/common/VnDmsImportForm.vue new file mode 100644 index 000000000..b31197bbc --- /dev/null +++ b/src/components/common/VnDmsImportForm.vue @@ -0,0 +1,81 @@ + + + + + +es: + Select document id: Introduzca id de gestion documental + Document: Documento + The document indentifier can't be empty: El número de documento no puede estar vacío + diff --git a/src/components/common/VnDmsList.vue b/src/components/common/VnDmsList.vue index 769ba9959..0576ba266 100644 --- a/src/components/common/VnDmsList.vue +++ b/src/components/common/VnDmsList.vue @@ -3,6 +3,7 @@ import { ref, computed } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import { useQuasar, QCheckbox, QBtn, QInput } from 'quasar'; +import VnDmsImportForm from 'src/components/common/VnDmsImportForm.vue'; import axios from 'axios'; import VnPaginate from 'components/ui/VnPaginate.vue'; @@ -18,6 +19,7 @@ const { t } = useI18n(); const rows = ref(); const dmsRef = ref(); const formDialog = ref({}); +const showImportDialog = ref(false); const $props = defineProps({ model: { @@ -45,6 +47,10 @@ const $props = defineProps({ type: String, required: true, }, + allowImport: { + type: Boolean, + default: false, + }, }); const dmsFilter = { @@ -373,9 +379,15 @@ function shouldRenderButton(button, isExternal = false) { :description="$props.description" /> + + + + + + - es: Download as CSV: Descargar como CSV diff --git a/src/pages/InvoiceOut/locale/en.yml b/src/pages/InvoiceOut/locale/en.yml new file mode 100644 index 000000000..5ad92ed09 --- /dev/null +++ b/src/pages/InvoiceOut/locale/en.yml @@ -0,0 +1,25 @@ +invoiceOutModule: + customer: Client + amount: Amount + company: Company +invoiceOutList: + tableVisibleColumns: + id: ID + ref: Reference + issued: Issued + created: Created + dueDate: Max date + invoiceOutSerial: Serial + ticket: Ticket + taxArea: Tax area +DownloadPdf: Download PDF +InvoiceOutSummary: Summary +negativeBases: + country: Country + clientId: Client ID + base: Base + ticketId: Ticket + active: Active + hasToInvoice: Has to invoice + verifiedData: Verified data + commercial: Commercial \ No newline at end of file diff --git a/src/pages/InvoiceOut/locale/es.yml b/src/pages/InvoiceOut/locale/es.yml index b936c7b7e..a05125630 100644 --- a/src/pages/InvoiceOut/locale/es.yml +++ b/src/pages/InvoiceOut/locale/es.yml @@ -1,2 +1,31 @@ Search invoice: Buscar factura emitida You can search by invoice reference: Puedes buscar por referencia de la factura +invoiceOutModule: + customer: Cliente + amount: Importe + company: Empresa +invoiceOutList: + tableVisibleColumns: + id: ID + ref: Referencia + issued: Fecha emisión + customer: Cliente + company: Empresa + amount: Importe + created: F. creación + dueDate: F. máxima + invoiceOutSerial: Serial + ticket: Ticket + taxArea: Area +DownloadPdf: Descargar PDF +InvoiceOutSummary: Resumen +negativeBases: + country: País + clientId: ID del cliente + client: Cliente + base: Base + ticketId: Ticket + active: Activo + hasToInvoice: Debe facturar + verifiedData: Datos verificados + commercial: Comercial \ No newline at end of file diff --git a/src/router/modules/invoiceOut.js b/src/router/modules/invoiceOut.js index 7c05b82e6..aac84573c 100644 --- a/src/router/modules/invoiceOut.js +++ b/src/router/modules/invoiceOut.js @@ -35,7 +35,7 @@ export default { name: 'InvoiceOutGlobal', meta: { title: 'globalInvoicing', - icon: 'contact_support', + icon: 'Date_Range', }, component: () => import('src/pages/InvoiceOut/InvoiceOutGlobal.vue'), }, From 5c36ad14f48fed04134221bb94f37431bfa6cf8a Mon Sep 17 00:00:00 2001 From: wbuezas Date: Tue, 2 Jul 2024 21:33:19 -0300 Subject: [PATCH 021/149] Ticket components --- src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + src/pages/Ticket/Card/TicketComponents.vue | 356 +++++++++++++++++++++ src/pages/Ticket/Card/TicketDescriptor.vue | 17 + src/pages/Ticket/locale/en.yml | 18 ++ src/pages/Ticket/locale/es.yml | 18 ++ src/router/modules/ticket.js | 10 + 7 files changed, 421 insertions(+) create mode 100644 src/pages/Ticket/Card/TicketComponents.vue diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 59cd1170a..c26100699 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -452,6 +452,7 @@ ticket: weeklyTickets: Weekly tickets services: Service tracking: Tracking + components: Components list: nickname: Nickname state: State diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index e35e3d41c..58b0d900b 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -451,6 +451,7 @@ ticket: weeklyTickets: Tickets programados services: Servicios tracking: Estados + components: Componentes list: nickname: Alias state: Estado diff --git a/src/pages/Ticket/Card/TicketComponents.vue b/src/pages/Ticket/Card/TicketComponents.vue new file mode 100644 index 000000000..85d2179a2 --- /dev/null +++ b/src/pages/Ticket/Card/TicketComponents.vue @@ -0,0 +1,356 @@ + + + diff --git a/src/pages/Ticket/Card/TicketDescriptor.vue b/src/pages/Ticket/Card/TicketDescriptor.vue index 5fb312b28..100e24058 100644 --- a/src/pages/Ticket/Card/TicketDescriptor.vue +++ b/src/pages/Ticket/Card/TicketDescriptor.vue @@ -66,6 +66,23 @@ const filter = { fields: ['id', 'name'], }, }, + { + relation: 'zone', + scope: { + fields: [ + 'agencyModeFk', + 'bonus', + 'hour', + 'id', + 'isVolumetric', + 'itemMaxSize', + 'm3Max', + 'name', + 'price', + 'travelingDays', + ], + }, + }, ], }; diff --git a/src/pages/Ticket/locale/en.yml b/src/pages/Ticket/locale/en.yml index 39aed4af7..90a3e67b7 100644 --- a/src/pages/Ticket/locale/en.yml +++ b/src/pages/Ticket/locale/en.yml @@ -159,6 +159,24 @@ service: addService: Add service quantityInfo: To create services with negative amounts mark the service on the source ticket and press the pay button. createRefundSuccess: 'The following refund ticket have been created: { ticketId }' +components: + item: Item + description: Description + quantity: Quantity + serie: Serie + components: Components + import: Import + total: Total + baseToCommission: Base to commission + totalWithoutVat: Total without VAT + zoneBreakdown: Zone breakdown + price: Price + bonus: Bonus + zone: Zone + volume: Volume + theoricalCost: Theorical cost + totalPrice: Total price + packages: Packages tracking: state: State worker: Worker diff --git a/src/pages/Ticket/locale/es.yml b/src/pages/Ticket/locale/es.yml index d5b50efc5..370d3433d 100644 --- a/src/pages/Ticket/locale/es.yml +++ b/src/pages/Ticket/locale/es.yml @@ -164,5 +164,23 @@ ticketSale: shipped: F. Envío agency: Agencia address: Consignatario +components: + item: Artículo + description: Descripción + quantity: Cantidad + serie: Serie + components: Componentes + import: Importe + total: Total + baseToCommission: Base comisionable + totalWithoutVat: Total sin IVA + zoneBreakdown: Desglose zona + price: Precio + bonus: Bonificación + zone: Zona + volume: Volúmen + theoricalCost: Porte teórico + totalPrice: Precio total + packages: Bultos Search ticket: Buscar tickets You can search by ticket id or alias: Puedes buscar por id o alias del ticket diff --git a/src/router/modules/ticket.js b/src/router/modules/ticket.js index 1e635470b..1a9a7d557 100644 --- a/src/router/modules/ticket.js +++ b/src/router/modules/ticket.js @@ -23,6 +23,7 @@ export default { 'TicketTracking', 'TicketVolume', 'TicketNotes', + 'TicketComponents', ], }, children: [ @@ -179,6 +180,15 @@ export default { }, component: () => import('src/pages/Ticket/Card/TicketVolume.vue'), }, + { + path: 'components', + name: 'TicketComponents', + meta: { + title: 'components', + icon: 'vn:components', + }, + component: () => import('src/pages/Ticket/Card/TicketComponents.vue'), + }, { path: 'observation', name: 'TicketNotes', From 34ee92ac2464c6af177a70fbb2d83e341c88df19 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Tue, 2 Jul 2024 21:46:45 -0300 Subject: [PATCH 022/149] Small change --- src/pages/Ticket/Card/TicketSaleTracking.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/Ticket/Card/TicketSaleTracking.vue b/src/pages/Ticket/Card/TicketSaleTracking.vue index a03f75387..86f391a1d 100644 --- a/src/pages/Ticket/Card/TicketSaleTracking.vue +++ b/src/pages/Ticket/Card/TicketSaleTracking.vue @@ -29,6 +29,7 @@ const itemShelvignsSales = ref([]); const shelvingsOptions = ref([]); const parkingsOptions = ref([]); const saleTrackingUrl = computed(() => `SaleTrackings/${route.params.id}/filter`); +const oldQuantity = ref(null); watch( () => route.params.id, @@ -191,10 +192,12 @@ const showShelving = async (sale) => { const updateQuantity = async (sale) => { try { + if (oldQuantity.value === sale.quantity) return; const params = { quantity: sale.quantity, }; await axios.patch(`ItemShelvingSales/${sale.id}`, params); + oldQuantity.value = null; } catch (error) { console.error(error); } @@ -431,7 +434,7 @@ const clickControled = (sale) => { {{ row.subName }} - + @@ -498,7 +501,7 @@ const clickControled = (sale) => { v-model.number="row.quantity" @keyup.enter="updateQuantity(row)" @blur="updateQuantity(row)" - @focus="edit.oldQuantity = row.quantity" + @focus="oldQuantity = row.quantity" /> From 10f5323b9a82fdc41afaec03b181532021fe9b73 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 3 Jul 2024 09:45:59 +0200 Subject: [PATCH 023/149] refactor: refs #6899 fix negativeBases call --- .../InvoiceOut/InvoiceOutNegativeBases.vue | 79 +++++++------------ src/stores/invoiceOutGlobal.js | 2 +- 2 files changed, 28 insertions(+), 53 deletions(-) diff --git a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue index d94661849..61e63a7a7 100644 --- a/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue +++ b/src/pages/InvoiceOut/InvoiceOutNegativeBases.vue @@ -1,41 +1,20 @@ + diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue index 4656980d9..de0dc50c3 100644 --- a/src/pages/Claim/Card/ClaimBasicData.vue +++ b/src/pages/Claim/Card/ClaimBasicData.vue @@ -30,7 +30,7 @@ function setClaimStates(data) { } async function getEnumValues() { - optionsList.value = [{ id: null, description: t('claim.basicData.null') }]; + optionsList.value = [{ id: null, description: t('claim.null') }]; const { data } = await axios.get(`Applications/get-enum-values`, { params: { schema: 'vn', @@ -39,7 +39,7 @@ async function getEnumValues() { }, }); for (let value of data) - optionsList.value.push({ id: value, description: t(`claim.basicData.${value}`) }); + optionsList.value.push({ id: value, description: t(`claim.${value}`) }); } getEnumValues(); @@ -77,17 +77,14 @@ const statesFilter = { - + { From c2333c9455b90395ac09d956ec901f0821b27724 Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 3 Jul 2024 17:53:37 +0200 Subject: [PATCH 029/149] chore: refs #7300 reset arrayData --- src/components/ui/VnFilterPanel.vue | 8 ++------ src/components/ui/VnPaginate.vue | 7 ++++--- src/components/ui/VnSearchbar.vue | 3 +-- src/composables/useArrayData.js | 9 ++++----- src/stores/useArrayDataStore.js | 23 ++++++++++++++++------- 5 files changed, 27 insertions(+), 23 deletions(-) diff --git a/src/components/ui/VnFilterPanel.vue b/src/components/ui/VnFilterPanel.vue index 5595d54ba..2ea51ed8b 100644 --- a/src/components/ui/VnFilterPanel.vue +++ b/src/components/ui/VnFilterPanel.vue @@ -112,9 +112,7 @@ async function search(evt) { isLoading.value = true; const filter = { ...userParams.value }; store.userParamsChanged = true; - store.filter.skip = 0; - store.skip = 0; - store.page = 1; + arrayData.reset(['skip', 'filter.skip', 'page']); const { params: newParams } = await arrayData.addFilter({ params: userParams.value }); userParams.value = newParams; @@ -138,9 +136,7 @@ async function reload() { async function clearFilters() { isLoading.value = true; store.userParamsChanged = true; - store.filter.skip = 0; - store.skip = 0; - store.page = 1; + arrayData.reset(['skip', 'filter.skip', 'page']); // Filtrar los params no removibles const removableFilters = Object.keys(userParams.value).filter((param) => $props.unremovableParams.includes(param) diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue index 9a2c06b0c..8e426b471 100644 --- a/src/components/ui/VnPaginate.vue +++ b/src/components/ui/VnPaginate.vue @@ -1,5 +1,5 @@ + + + + + + +es: + by: por + diff --git a/src/router/modules/ticket.js b/src/router/modules/ticket.js index 1e635470b..db61cd405 100644 --- a/src/router/modules/ticket.js +++ b/src/router/modules/ticket.js @@ -23,6 +23,7 @@ export default { 'TicketTracking', 'TicketVolume', 'TicketNotes', + 'TicketPicture', ], }, children: [ @@ -142,6 +143,15 @@ export default { }, component: () => import('src/pages/Ticket/Card/TicketLog.vue'), }, + { + path: 'picture', + name: 'TicketPicture', + meta: { + title: 'pictures', + icon: 'vn:photo', + }, + component: () => import('src/pages/Ticket/Card/TicketPicture.vue'), + }, { path: 'boxing', name: 'TicketBoxing', From 02ce4f2658d586e98a265c43cc9e0cfdbbc6f8da Mon Sep 17 00:00:00 2001 From: wbuezas Date: Wed, 3 Jul 2024 15:12:20 -0300 Subject: [PATCH 031/149] Small change --- src/pages/Ticket/Card/TicketComponents.vue | 13 ++++++++----- src/pages/Ticket/Card/TicketService.vue | 1 - 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/pages/Ticket/Card/TicketComponents.vue b/src/pages/Ticket/Card/TicketComponents.vue index 85d2179a2..5aeb6b0a5 100644 --- a/src/pages/Ticket/Card/TicketComponents.vue +++ b/src/pages/Ticket/Card/TicketComponents.vue @@ -37,7 +37,8 @@ watch( getTheoricalCost(); if (ticketData.value?.zone && ticketData.value?.zone?.isVolumetric) getTicketVolume(); - } + }, + { immediate: true } ); const salesFilter = computed(() => ({ @@ -134,7 +135,6 @@ const getComponentsSum = async () => { try { const { data } = await axios.get(`Tickets/${route.params.id}/getComponentsSum`); componentsList.value = data; - console.log('componentsList', componentsList.value); } catch (error) { console.error(error); } @@ -153,7 +153,6 @@ const getTicketVolume = async () => { try { if (!ticketData.value) return; const { data } = await axios.get(`Tickets/${ticketData.value.id}/getVolume`); - console.log('data volume: ', data); ticketVolume.value = data[0].volume; } catch (error) { console.error(error); @@ -218,8 +217,12 @@ onUnmounted(() => (stateStore.rightDrawer = false)); class="justify-center" horizontal > - {{ component.name }}: - {{ toCurrency(component.value, 'EUR', 3) }} + + {{ component.name }}: + + {{ + toCurrency(component.value, 'EUR', 3) + }} { params: { filter: JSON.stringify(filter) }, }); defaultTaxClass.value = data; - console.log('defaultTaxClass', defaultTaxClass.value); } catch (error) { console.error(error); } From 8baf5b14890741a5a1ec5e8b89292f499e35f237 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Wed, 3 Jul 2024 16:14:47 -0300 Subject: [PATCH 032/149] Apply right alignment to total and import columns --- src/pages/Ticket/Card/TicketComponents.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Ticket/Card/TicketComponents.vue b/src/pages/Ticket/Card/TicketComponents.vue index 5aeb6b0a5..b99da3f9b 100644 --- a/src/pages/Ticket/Card/TicketComponents.vue +++ b/src/pages/Ticket/Card/TicketComponents.vue @@ -339,7 +339,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));