From 48f10707400afd1ddedb843f236dd6fc28d5b8bd Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 5 Nov 2024 12:52:53 +0100 Subject: [PATCH 001/293] feat(VnLog): add descriptors --- src/components/common/VnJsonValue.vue | 63 ++++++++++++++++++--------- src/components/common/VnLog.vue | 59 +++++++++++-------------- src/stores/useDescriptorStore.js | 29 ++++++++++++ 3 files changed, 98 insertions(+), 53 deletions(-) create mode 100644 src/stores/useDescriptorStore.js diff --git a/src/components/common/VnJsonValue.vue b/src/components/common/VnJsonValue.vue index a2e858d0d..408d16d1a 100644 --- a/src/components/common/VnJsonValue.vue +++ b/src/components/common/VnJsonValue.vue @@ -1,67 +1,86 @@ @@ -85,4 +104,8 @@ updateValue(); color: #cd7c7c; font-style: italic; } +.json-link { + text-decoration: underline; + cursor: pointer; +} diff --git a/src/components/common/VnLog.vue b/src/components/common/VnLog.vue index 8c71c0997..7b65a8a88 100644 --- a/src/components/common/VnLog.vue +++ b/src/components/common/VnLog.vue @@ -598,33 +598,17 @@ watch( /> - - - {{ prop.nameI18n }}: - - - ,  - - - -
+ - {{ prop.nameI18n }}: + v-if=" + prop2Index < log.props.length + " + class="q-mr-xs" + >, - #{{ prop.val.id }} - + { + const descriptors = ref({}); + const loaded = ref(false); + + function set() { + const files = import.meta.glob(`src/**/*DescriptorProxy.vue`); + for (const file in files) { + descriptors.value[file.split('/').at(-1).slice(0, -19).toLowerCase() + 'Fk'] = + defineAsyncComponent(() => import(file)); + } + loaded.value = true; + } + + function get() { + if (!loaded.value) set(); + } + + function has(name) { + get(); + return descriptors.value[name]; + } + + return { + has, + }; +}); From a6a27237341f27db158378a45d064b6458d33139 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 27 Jan 2025 14:21:09 +0100 Subject: [PATCH 002/293] 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 51afa21fa4a5acc986d0ae3a7dbbe9a90a115e06 Mon Sep 17 00:00:00 2001 From: jtubau Date: Mon, 10 Feb 2025 13:41:03 +0100 Subject: [PATCH 003/293] feat: refs #8440 add VehicleNotes component and update routing --- src/pages/Route/Vehicle/Card/VehicleNotes.vue | 34 +++++++++++++++++++ src/router/modules/route.js | 11 +++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/pages/Route/Vehicle/Card/VehicleNotes.vue diff --git a/src/pages/Route/Vehicle/Card/VehicleNotes.vue b/src/pages/Route/Vehicle/Card/VehicleNotes.vue new file mode 100644 index 000000000..320e9150d --- /dev/null +++ b/src/pages/Route/Vehicle/Card/VehicleNotes.vue @@ -0,0 +1,34 @@ + + + \ No newline at end of file diff --git a/src/router/modules/route.js b/src/router/modules/route.js index 835324d20..86e0b39cc 100644 --- a/src/router/modules/route.js +++ b/src/router/modules/route.js @@ -166,7 +166,7 @@ const vehicleCard = { component: () => import('src/pages/Route/Vehicle/Card/VehicleCard.vue'), redirect: { name: 'VehicleSummary' }, meta: { - menu: ['VehicleBasicData'], + menu: ['VehicleBasicData', 'VehicleNotes'], }, children: [ { @@ -187,6 +187,15 @@ const vehicleCard = { }, component: () => import('src/pages/Route/Vehicle/Card/VehicleBasicData.vue'), }, + { + name: 'VehicleNotes', + path: 'notes', + meta: { + title: 'notes', + icon: 'vn:notes', + }, + component: () => import('src/pages/Route/Vehicle/Card/VehicleNotes.vue'), + } ], }; From 62e8b5b30749b95cc9cbb71f517ed62b581feca4 Mon Sep 17 00:00:00 2001 From: jtubau Date: Wed, 12 Feb 2025 14:40:17 +0100 Subject: [PATCH 004/293] feat: refs #8440 add delete functionality to notes and update required attributes --- src/components/ui/VnNotes.vue | 55 ++++++++++++++----- src/pages/Route/Vehicle/Card/VehicleNotes.vue | 3 +- 2 files changed, 43 insertions(+), 15 deletions(-) diff --git a/src/components/ui/VnNotes.vue b/src/components/ui/VnNotes.vue index ec6289a67..cc0f78532 100644 --- a/src/components/ui/VnNotes.vue +++ b/src/components/ui/VnNotes.vue @@ -25,13 +25,16 @@ const $attrs = computed(() => { return rest; }); -const isRequired = computed(() => { - return Object.keys($attrs).includes('required') +const isRequired = ref(() => { + return Object.keys($attrs).includes('required'); +}); +const isDeletable = ref(() => { + return Object.keys($attrs).includes('removable'); }); const $props = defineProps({ url: { type: String, default: null }, - saveUrl: {type: String, default: null}, + saveUrl: { type: String, default: null }, filter: { type: Object, default: () => {} }, body: { type: Object, default: () => {} }, addNote: { type: Boolean, default: false }, @@ -52,6 +55,11 @@ function handleClick(e) { else insert(); } +async function deleteNote(e) { + await axios.delete(`${$props.url}/${e.id}`); + await vnPaginateRef.value.fetch(); +} + async function insert() { if (!newNote.text || ($props.selectType && !newNote.observationTypeFk)) return; @@ -65,7 +73,7 @@ async function insert() { } function confirmAndUpdate() { - if(!newNote.text && originalText) + if (!newNote.text && originalText) quasar .dialog({ component: VnConfirm, @@ -88,11 +96,17 @@ async function update() { ...body, ...{ notes: newNote.text }, }; - await axios.patch(`${$props.saveUrl ?? `${$props.url}/${$props.body.workerFk}`}`, newBody); + await axios.patch( + `${$props.saveUrl ?? `${$props.url}/${$props.body.workerFk}`}`, + newBody, + ); } onBeforeRouteLeave((to, from, next) => { - if ((newNote.text && !$props.justInput) || (newNote.text !== originalText) && $props.justInput) + if ( + (newNote.text && !$props.justInput) || + (newNote.text !== originalText && $props.justInput) + ) quasar.dialog({ component: VnConfirm, componentProps: { @@ -104,12 +118,11 @@ onBeforeRouteLeave((to, from, next) => { else next(); }); -function fetchData([ data ]) { +function fetchData([data]) { newNote.text = data?.notes; originalText = data?.notes; emit('onFetch', data); } - From 3de0ebeccd7383d2f2f6fafaf7f7c31614a03e14 Mon Sep 17 00:00:00 2001 From: jtubau Date: Wed, 12 Feb 2025 14:52:05 +0100 Subject: [PATCH 005/293] refactor: refs #8440 remove unnecessary computed properties --- src/components/ui/VnNotes.vue | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/components/ui/VnNotes.vue b/src/components/ui/VnNotes.vue index cc0f78532..1663f6eb2 100644 --- a/src/components/ui/VnNotes.vue +++ b/src/components/ui/VnNotes.vue @@ -25,13 +25,6 @@ const $attrs = computed(() => { return rest; }); -const isRequired = ref(() => { - return Object.keys($attrs).includes('required'); -}); -const isDeletable = ref(() => { - return Object.keys($attrs).includes('removable'); -}); - const $props = defineProps({ url: { type: String, default: null }, saveUrl: { type: String, default: null }, 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 006/293] 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) { +