From 81e6870f711a63055ea72bcfae3877f97987360a Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 28 May 2024 16:59:59 +0200 Subject: [PATCH 001/105] refs #6553 front section trad --- src/i18n/locale/en.yml | 2 +- src/i18n/locale/es.yml | 1 + src/pages/Worker/Card/WorkerBusiness.vue | 120 +++++++++++++++++++++++ src/router/modules/worker.js | 10 ++ 4 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 src/pages/Worker/Card/WorkerBusiness.vue diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 2b46649e1..0a27312a4 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -830,7 +830,7 @@ worker: calendar: Calendar timeControl: Time control locker: Locker - + business: Business list: name: Name email: Email diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index a8b9ecd51..03eb708c5 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -828,6 +828,7 @@ worker: calendar: Calendario timeControl: Control de horario locker: Taquilla + business: Contrato list: name: Nombre email: Email diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue new file mode 100644 index 000000000..2c3eb459b --- /dev/null +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -0,0 +1,120 @@ + + + + + + + diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js index 384978d13..02ec255da 100644 --- a/src/router/modules/worker.js +++ b/src/router/modules/worker.js @@ -14,6 +14,7 @@ export default { main: ['WorkerList', 'WorkerDepartment'], card: [ 'WorkerBasicData', + 'WorkerBusiness', 'WorkerNotes', 'WorkerPda', 'WorkerNotificationsManager', @@ -86,6 +87,15 @@ export default { }, component: () => import('src/pages/Worker/Card/WorkerBasicData.vue'), }, + { + path: 'business', + name: 'WorkerBusiness', + meta: { + title: 'business', + icon: 'handshake', + }, + component: () => import('src/pages/Worker/Card/WorkerBusiness.vue'), + }, { path: 'notes', name: 'NotesCard', From 0e691436e98dbffe22bbdbad1bbe643e9f3c054f Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 29 May 2024 14:20:49 +0200 Subject: [PATCH 002/105] refs #6553 fix front trad --- src/i18n/locale/en.yml | 18 ++++ src/i18n/locale/es.yml | 17 ++++ src/pages/Worker/Card/WorkerBusiness.vue | 101 +++++++++++++++++++---- 3 files changed, 119 insertions(+), 17 deletions(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 0a27312a4..614b5abe0 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -901,6 +901,24 @@ worker: iban: IBAN bankEntity: Swift / BIC imageNotFound: Image not found + business: + tableVisibleColumns: + started: Start Date + ended: End Date + company: Company + reasondEnd: Reason for Termination + department: Department + professionalCategory: Professional Category + calendarType: Work Calendar + workCenter: Work Center + payrollCategories: Contract Category + occupationCode: Contribution Code + rate: Rate + businessType: Contract Type + amount: Salary + basicSalary: Transport Workers Salary + notes: Notes + wagon: pageTitles: wagons: Wagons diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 03eb708c5..3410ee1d5 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -890,6 +890,23 @@ worker: iban: IBAN bankEntity: Swift / BIC imageNotFound: No se ha encontrado la imagen + business: + tableVisibleColumns: + started: Fecha inicio + ended: Fecha fin + company: Empresa + reasondEnd: Motivo finalización + department: Departamento + professionalCategory: Categoria profesional + calendarType: Calendario laboral + workCenter: Centro + payrollCategories: Categoria contrato + occupationCode: Cotización + rate: Tarifa + businessType: Contrato + amount: Salario + basicSalary: Salario transportistas + notes: Notas wagon: pageTitles: wagons: Vagones diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 2c3eb459b..7c0cfaab3 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -1,12 +1,14 @@ @@ -99,19 +173,12 @@ const columns = computed(() => [ From 6205feaca4fb1bb44d119bbbfa95d8ea99902d34 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 29 May 2024 16:37:05 +0200 Subject: [PATCH 003/105] refs #6553 fix front ibject --- src/pages/Worker/Card/WorkerBusiness.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 7c0cfaab3..8a52618db 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -41,7 +41,7 @@ const columns = computed(() => [ { align: 'left', label: t('worker.business.tableVisibleColumns.reasondEnd'), - name: 'reasondEndFk', + name: 'reasonEndFk', component: 'select', attrs: { url: 'BusinessReasonEnds', @@ -117,7 +117,7 @@ const columns = computed(() => [ component: 'select', attrs: { url: 'OccupationCodes', - fields: ['id', 'name'], + fields: ['code', 'name'], }, disable: false, cardVisible: true, From 8f1ddb08b3b16f0e70db9f98c848246cc2c4311f Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 31 May 2024 10:32:51 +0200 Subject: [PATCH 004/105] refs #6553 filterBusiness --- src/pages/Worker/Card/WorkerBusiness.vue | 59 ++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 8a52618db..172a1a6a1 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -9,6 +9,64 @@ const { t } = useI18n(); const route = useRoute(); const tableRef = ref(); const entityId = computed(() => route.params.id); +const businessFilter = { + include: [ + { + relation: 'department', + scope: { + fields: ['id', 'name'], + }, + }, + { + relation: 'workCenter', + scope: { + fields: ['id', 'name'], + }, + }, + { + relation: 'companyCode', + scope: { + fields: ['id', 'code'], + }, + }, + { + relation: 'reasonEnd', + scope: { + fields: ['id', 'reason'], + }, + }, + { + relation: 'occupationCode', + scope: { + fields: ['code', 'name'], + }, + }, + { + relation: 'workerBusinessProfessionalCategory', + scope: { + fields: ['id', 'description'], + }, + }, + { + relation: 'calendarType', + scope: { + fields: ['id', 'description'], + }, + }, + { + relation: 'workerBusinessType', + scope: { + fields: ['id', 'name'], + }, + }, + { + relation: 'workerBusinessAgreement', + scope: { + fields: ['id', 'name'], + }, + }, + ], +}; const columns = computed(() => [ { align: 'left', @@ -176,6 +234,7 @@ const columns = computed(() => [ :url="`Workers/${entityId}/Business`" order="id DESC" :columns="columns" + :user-filter="businessFilter" default-mode="card" auto-load :right-search="false" From 6e261b7793648260911acc104cb4b9060af54874 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 3 Jun 2024 14:38:48 +0200 Subject: [PATCH 005/105] refs #6553 fix business summary traductions --- src/i18n/locale/en.yml | 23 ++++++---- src/i18n/locale/es.yml | 16 +++++++ src/pages/Worker/Card/WorkerBusiness.vue | 17 +++++++ src/pages/Worker/Card/WorkerSummary.vue | 58 ++++++++++++++++++++++++ 4 files changed, 106 insertions(+), 8 deletions(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 5562fea1c..a9be22d7d 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -863,15 +863,22 @@ worker: role: Role sipExtension: Extension locker: Locker - fiDueDate: Fecha de caducidad del DNI - sex: Sexo - seniority: Antigüedad + fiDueDate: DNI expiration date + sex: Sex + seniority: Antiquity fi: DNI/NIE/NIF - birth: Fecha de nacimiento - isFreelance: Autónomo - isSsDiscounted: Bonificación SS - hasMachineryAuthorized: Autorizado para llevar maquinaria - isDisable: Trabajador desactivado + birth: Date of birth + isFreelance: Autonomous + isSsDiscounted: Bonus SS + hasMachineryAuthorized: Authorized to carry machinery + isDisable: Disabled worker + business: Business + started: Start Date + ended: End Date + reasonEnd: Reason for Termination + department: Deparment + workerBusinessCategory: Professional Category + notes: Notes notificationsManager: activeNotifications: Active notifications availableNotifications: Available notifications diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 543239bbf..17e61371a 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -861,6 +861,22 @@ worker: role: Rol sipExtension: Extensión locker: Taquilla + fiDueDate: Fecha de caducidad del DNI + sex: Sexo + seniority: Antigüedad + fi: DNI/NIE/NIF + birth: Fecha de nacimiento + isFreelance: Autónomo + isSsDiscounted: Bonificación SS + hasMachineryAuthorized: Autorizado para llevar maquinaria + isDisable: Trabajador desactivado + business: Contrato + started: Fecha de incio + ended: Finalización + reasonEnd: Razón de finalización + department: Departamento + workerBusinessCategory: Categoria profesional + notes: Notas notificationsManager: activeNotifications: Notificaciones activas availableNotifications: Notificaciones disponibles diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 172a1a6a1..782772095 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -75,6 +75,7 @@ const columns = computed(() => [ format: ({ started }) => toDate(started), component: VnInputDate, cardVisible: true, + created: true, }, { align: 'left', @@ -83,6 +84,7 @@ const columns = computed(() => [ format: ({ ended }) => toDate(ended), component: VnInputDate, cardVisible: true, + created: true, }, { align: 'left', @@ -95,6 +97,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -119,6 +122,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -131,6 +135,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -143,6 +148,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -155,6 +161,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -179,6 +186,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -199,6 +207,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -207,6 +216,7 @@ const columns = computed(() => [ component: 'input', disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -215,6 +225,7 @@ const columns = computed(() => [ component: 'input', disable: false, cardVisible: true, + created: true, }, { align: 'left', @@ -232,6 +243,12 @@ const columns = computed(() => [ ref="tableRef" data-key="WorkerBusiness" :url="`Workers/${entityId}/Business`" + :create="{ + urlCreate: `Workers/${entityId}/Business`, + title: 'Create business', + onDataSaved: ({ id }) => tableRef.redirect(id), + formInitialData: {}, + }" order="id DESC" :columns="columns" :user-filter="businessFilter" diff --git a/src/pages/Worker/Card/WorkerSummary.vue b/src/pages/Worker/Card/WorkerSummary.vue index 6d6dde97b..ed7eb5856 100644 --- a/src/pages/Worker/Card/WorkerSummary.vue +++ b/src/pages/Worker/Card/WorkerSummary.vue @@ -61,6 +61,31 @@ const filter = { { relation: 'sip', }, + { + relation: 'business', + scope: { + include: [ + { + relation: 'department', + scope: { + fields: ['id', 'name'], + }, + }, + { + relation: 'reasonEnd', + scope: { + fields: ['id', 'reason'], + }, + }, + { + relation: 'workerBusinessProfessionalCategory', + scope: { + fields: ['id', 'description'], + }, + }, + ], + }, + }, ], }; @@ -164,6 +189,39 @@ const filter = { + + + + + + + + + + From f4792d7921ef16f690adffd975722a93902a2012 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 5 Jun 2024 10:35:14 +0200 Subject: [PATCH 006/105] fix: refs #6553 label css --- src/pages/Worker/Card/WorkerBusiness.vue | 33 ++++++++++++++---------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 782772095..cd0dee7d8 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -67,6 +67,7 @@ const businessFilter = { }, ], }; + const columns = computed(() => [ { align: 'left', @@ -75,7 +76,7 @@ const columns = computed(() => [ format: ({ started }) => toDate(started), component: VnInputDate, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -84,20 +85,22 @@ const columns = computed(() => [ format: ({ ended }) => toDate(ended), component: VnInputDate, cardVisible: true, - created: true, + create: true, }, { align: 'left', - label: t('worker.business.tableVisibleColumns.company'), name: 'companyCodeFk', component: 'select', attrs: { url: 'Companies', fields: ['code'], + optionLabel: 'code', + label: t('worker.business.tableVisibleColumns.company'), }, + event: { 'update:modelValue': (a, b) => console.log(a, b) }, disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -122,7 +125,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -135,7 +138,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -148,7 +151,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -161,15 +164,15 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', label: t('worker.business.tableVisibleColumns.payrollCategories'), - name: 'payrollCategoriesFk', + name: 'workerBusinessCategoryFk', component: 'select', attrs: { - url: 'BusinessReasonEnd', + url: 'payrollCategories', fields: ['id', 'description'], }, disable: false, @@ -183,10 +186,11 @@ const columns = computed(() => [ attrs: { url: 'OccupationCodes', fields: ['code', 'name'], + optionValue: 'code', }, disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -207,7 +211,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -216,7 +220,7 @@ const columns = computed(() => [ component: 'input', disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -225,7 +229,7 @@ const columns = computed(() => [ component: 'input', disable: false, cardVisible: true, - created: true, + create: true, }, { align: 'left', @@ -255,6 +259,7 @@ const columns = computed(() => [ default-mode="card" auto-load :right-search="false" + card-class="grid-two" > From db3ff0416c88b44d951553dc9fdc524144825850 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 5 Jun 2024 14:31:08 +0200 Subject: [PATCH 007/105] refs #6553 fix names --- src/components/VnTable/VnTable.vue | 2 +- src/pages/Worker/Card/WorkerBusiness.vue | 47 +++++++++++++++++------- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 93bcfdddb..e08290cd3 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -561,7 +561,7 @@ defineExpose({ display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, max-content)); max-width: 100%; - margin: 0 auto; + margin: 1em auto; overflow: scroll; white-space: wrap; width: 100%; diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index cd0dee7d8..412f6fb9c 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -71,7 +71,9 @@ const businessFilter = { const columns = computed(() => [ { align: 'left', - label: t('worker.business.tableVisibleColumns.started'), + attrs: { + label: t('worker.business.tableVisibleColumns.started'), + }, name: 'started', format: ({ started }) => toDate(started), component: VnInputDate, @@ -80,7 +82,9 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.ended'), + attrs: { + label: t('worker.business.tableVisibleColumns.ended'), + }, name: 'ended', format: ({ ended }) => toDate(ended), component: VnInputDate, @@ -104,24 +108,26 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.reasondEnd'), name: 'reasonEndFk', component: 'select', attrs: { url: 'BusinessReasonEnds', fields: ['id', 'reason'], + optionLabel: 'reason', + label: t('worker.business.tableVisibleColumns.reasondEnd'), }, disable: false, cardVisible: true, }, { align: 'left', - label: t('worker.business.tableVisibleColumns.department'), name: 'departmentFk', component: 'select', attrs: { url: 'Departments', fields: ['id', 'name'], + optionLabel: 'name', + label: t('worker.business.tableVisibleColumns.department'), }, disable: false, cardVisible: true, @@ -129,12 +135,13 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.professionalCategory'), name: 'professionalCategoryFk', component: 'select', attrs: { url: 'WorkerBusinessProfessionalCategories', fields: ['id', 'description', 'code'], + optionLabel: 'description', + label: t('worker.business.tableVisibleColumns.professionalCategory'), }, disable: false, cardVisible: true, @@ -142,12 +149,13 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.calendarType'), name: 'calendarTypeFk', component: 'select', attrs: { url: 'CalendarTypes', fields: ['id', 'description'], + optionLabel: 'description', + label: t('worker.business.tableVisibleColumns.calendarType'), }, disable: false, cardVisible: true, @@ -155,12 +163,13 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.workCenter'), name: 'workCenterFk', component: 'select', attrs: { url: 'WorkCenters', fields: ['id', 'name'], + optionLabel: 'name', + label: t('worker.business.tableVisibleColumns.workCenter'), }, disable: false, cardVisible: true, @@ -168,25 +177,26 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.payrollCategories'), name: 'workerBusinessCategoryFk', component: 'select', attrs: { url: 'payrollCategories', fields: ['id', 'description'], + optionLabel: 'description', + label: t('worker.business.tableVisibleColumns.payrollCategories'), }, disable: false, cardVisible: true, }, { align: 'left', - label: t('worker.business.tableVisibleColumns.occupationCode'), name: 'occupationCodeFk', component: 'select', attrs: { url: 'OccupationCodes', fields: ['code', 'name'], optionValue: 'code', + label: t('worker.business.tableVisibleColumns.occupationCode'), }, disable: false, cardVisible: true, @@ -194,20 +204,23 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.rate'), name: 'rate', + attrs: { + label: t('worker.business.tableVisibleColumns.rate'), + }, component: 'input', disable: false, cardVisible: true, }, { align: 'left', - label: t('worker.business.tableVisibleColumns.businessType'), name: 'workerBusinessTypeFk', component: 'select', attrs: { url: 'WorkerBusinessTypes', fields: ['id', 'name'], + optionValue: 'name', + label: t('worker.business.tableVisibleColumns.businessType'), }, disable: false, cardVisible: true, @@ -215,7 +228,9 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.amount'), + attrs: { + label: t('worker.business.tableVisibleColumns.amount'), + }, name: 'amount', component: 'input', disable: false, @@ -224,7 +239,9 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.basicSalary'), + attrs: { + label: t('worker.business.tableVisibleColumns.basicSalary'), + }, name: 'basicSalary', component: 'input', disable: false, @@ -233,7 +250,9 @@ const columns = computed(() => [ }, { align: 'left', - label: t('worker.business.tableVisibleColumns.notes'), + attrs: { + label: t('worker.business.tableVisibleColumns.notes'), + }, name: 'notes', component: 'input', disable: false, From 8490f244382715ef0a04f0d7414afa9efff60633 Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 10 Jun 2024 09:23:33 +0200 Subject: [PATCH 008/105] refs #6553 fix reactivateWorker --- src/i18n/locale/en.yml | 2 +- src/i18n/locale/es.yml | 2 +- src/pages/Worker/Card/WorkerBusiness.vue | 36 +++++++++++++++++++----- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 4d96d948a..5a6058a63 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -915,7 +915,7 @@ worker: started: Start Date ended: End Date company: Company - reasondEnd: Reason for Termination + reasonEnd: Reason for Termination department: Department professionalCategory: Professional Category calendarType: Work Calendar diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 155b59053..802559fcf 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -913,7 +913,7 @@ worker: started: Fecha inicio ended: Fecha fin company: Empresa - reasondEnd: Motivo finalización + reasonEnd: Motivo finalización department: Departamento professionalCategory: Categoria profesional calendarType: Calendario laboral diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 412f6fb9c..b5e7a4e96 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -5,7 +5,11 @@ import { useRoute } from 'vue-router'; import VnTable from 'components/VnTable/VnTable.vue'; import { toDate } from 'src/filters'; import VnInputDate from 'src/components/common/VnInputDate.vue'; +import worker from 'src/router/modules/worker'; +import { useQuasar } from 'quasar'; + const { t } = useI18n(); +const quasar = useQuasar(); const route = useRoute(); const tableRef = ref(); const entityId = computed(() => route.params.id); @@ -68,6 +72,22 @@ const businessFilter = { ], }; +async function reactivateWorker(value) { + if (value === null) return; + quasar + .dialog({ + message: t('Do you want to reactivate the user?'), + ok: { + push: true, + color: 'primary', + }, + cancel: true, + }) + .onOk(async () => { + worker.isDisable = false; + }); +} + const columns = computed(() => [ { align: 'left', @@ -80,10 +100,12 @@ const columns = computed(() => [ cardVisible: true, create: true, }, + { align: 'left', attrs: { label: t('worker.business.tableVisibleColumns.ended'), + '@update:model-value': 'reactivateWorker()', }, name: 'ended', format: ({ ended }) => toDate(ended), @@ -98,13 +120,12 @@ const columns = computed(() => [ attrs: { url: 'Companies', fields: ['code'], + optionValue: 'id', optionLabel: 'code', label: t('worker.business.tableVisibleColumns.company'), }, - event: { 'update:modelValue': (a, b) => console.log(a, b) }, disable: false, cardVisible: true, - create: true, }, { align: 'left', @@ -114,7 +135,7 @@ const columns = computed(() => [ url: 'BusinessReasonEnds', fields: ['id', 'reason'], optionLabel: 'reason', - label: t('worker.business.tableVisibleColumns.reasondEnd'), + label: t('worker.business.tableVisibleColumns.reasonEnd'), }, disable: false, cardVisible: true, @@ -187,6 +208,7 @@ const columns = computed(() => [ }, disable: false, cardVisible: true, + create: true, }, { align: 'left', @@ -218,8 +240,7 @@ const columns = computed(() => [ component: 'select', attrs: { url: 'WorkerBusinessTypes', - fields: ['id', 'name'], - optionValue: 'name', + fields: ['code', 'name'], label: t('worker.business.tableVisibleColumns.businessType'), }, disable: false, @@ -278,10 +299,11 @@ const columns = computed(() => [ default-mode="card" auto-load :right-search="false" - card-class="grid-two" + card-class="grid-two q-gutter-x-md" > - +es: + Do you want to reactivate the user?: desea reactivar el usuario? From 8d6075468210ad182de7575184b0210443b450a5 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 14 Jun 2024 14:50:01 +0200 Subject: [PATCH 009/105] fix(WorkerBusiness): fix card label --- src/pages/Worker/Card/WorkerBusiness.vue | 89 +++++++++--------------- 1 file changed, 32 insertions(+), 57 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index b5e7a4e96..3985d079e 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import VnTable from 'components/VnTable/VnTable.vue'; import { toDate } from 'src/filters'; -import VnInputDate from 'src/components/common/VnInputDate.vue'; import worker from 'src/router/modules/worker'; import { useQuasar } from 'quasar'; @@ -63,12 +62,12 @@ const businessFilter = { fields: ['id', 'name'], }, }, - { - relation: 'workerBusinessAgreement', - scope: { - fields: ['id', 'name'], - }, - }, + // { Falla + // relation: 'workerBusinessAgreement', + // scope: { + // fields: ['id', 'name'], + // }, + // }, ], }; @@ -90,67 +89,59 @@ async function reactivateWorker(value) { const columns = computed(() => [ { - align: 'left', - attrs: { - label: t('worker.business.tableVisibleColumns.started'), - }, name: 'started', + label: t('worker.business.tableVisibleColumns.started'), + align: 'left', format: ({ started }) => toDate(started), - component: VnInputDate, + component: 'date', cardVisible: true, create: true, }, { - align: 'left', - attrs: { - label: t('worker.business.tableVisibleColumns.ended'), - '@update:model-value': 'reactivateWorker()', - }, name: 'ended', + label: t('worker.business.tableVisibleColumns.ended'), + align: 'left', format: ({ ended }) => toDate(ended), - component: VnInputDate, + component: 'date', cardVisible: true, create: true, }, { + label: t('worker.business.tableVisibleColumns.company'), align: 'left', name: 'companyCodeFk', component: 'select', attrs: { url: 'Companies', fields: ['code'], - optionValue: 'id', optionLabel: 'code', - label: t('worker.business.tableVisibleColumns.company'), + optionValue: 'code', }, - disable: false, cardVisible: true, }, { align: 'left', name: 'reasonEndFk', component: 'select', + label: t('worker.business.tableVisibleColumns.reasonEnd'), attrs: { url: 'BusinessReasonEnds', fields: ['id', 'reason'], optionLabel: 'reason', - label: t('worker.business.tableVisibleColumns.reasonEnd'), }, - disable: false, cardVisible: true, }, { align: 'left', name: 'departmentFk', component: 'select', + label: t('worker.business.tableVisibleColumns.department'), attrs: { url: 'Departments', fields: ['id', 'name'], optionLabel: 'name', - label: t('worker.business.tableVisibleColumns.department'), }, - disable: false, cardVisible: true, create: true, }, @@ -158,13 +149,12 @@ const columns = computed(() => [ align: 'left', name: 'professionalCategoryFk', component: 'select', + label: t('worker.business.tableVisibleColumns.professionalCategory'), attrs: { url: 'WorkerBusinessProfessionalCategories', fields: ['id', 'description', 'code'], optionLabel: 'description', - label: t('worker.business.tableVisibleColumns.professionalCategory'), }, - disable: false, cardVisible: true, create: true, }, @@ -172,13 +162,12 @@ const columns = computed(() => [ align: 'left', name: 'calendarTypeFk', component: 'select', + label: t('worker.business.tableVisibleColumns.calendarType'), attrs: { url: 'CalendarTypes', fields: ['id', 'description'], optionLabel: 'description', - label: t('worker.business.tableVisibleColumns.calendarType'), }, - disable: false, cardVisible: true, create: true, }, @@ -186,13 +175,12 @@ const columns = computed(() => [ align: 'left', name: 'workCenterFk', component: 'select', + label: t('worker.business.tableVisibleColumns.workCenter'), attrs: { url: 'WorkCenters', fields: ['id', 'name'], optionLabel: 'name', - label: t('worker.business.tableVisibleColumns.workCenter'), }, - disable: false, cardVisible: true, create: true, }, @@ -200,13 +188,12 @@ const columns = computed(() => [ align: 'left', name: 'workerBusinessCategoryFk', component: 'select', + label: t('worker.business.tableVisibleColumns.payrollCategories'), attrs: { url: 'payrollCategories', fields: ['id', 'description'], optionLabel: 'description', - label: t('worker.business.tableVisibleColumns.payrollCategories'), }, - disable: false, cardVisible: true, create: true, }, @@ -214,69 +201,55 @@ const columns = computed(() => [ align: 'left', name: 'occupationCodeFk', component: 'select', + label: t('worker.business.tableVisibleColumns.occupationCode'), attrs: { url: 'OccupationCodes', fields: ['code', 'name'], optionValue: 'code', - label: t('worker.business.tableVisibleColumns.occupationCode'), }, - disable: false, cardVisible: true, create: true, }, { align: 'left', name: 'rate', - attrs: { - label: t('worker.business.tableVisibleColumns.rate'), - }, + label: t('worker.business.tableVisibleColumns.rate'), component: 'input', - disable: false, cardVisible: true, }, { align: 'left', name: 'workerBusinessTypeFk', component: 'select', + label: t('worker.business.tableVisibleColumns.businessType'), attrs: { url: 'WorkerBusinessTypes', fields: ['code', 'name'], - label: t('worker.business.tableVisibleColumns.businessType'), }, - disable: false, cardVisible: true, create: true, }, { align: 'left', - attrs: { - label: t('worker.business.tableVisibleColumns.amount'), - }, + label: t('worker.business.tableVisibleColumns.amount'), name: 'amount', component: 'input', - disable: false, cardVisible: true, create: true, }, { align: 'left', - attrs: { - label: t('worker.business.tableVisibleColumns.basicSalary'), - }, + label: t('worker.business.tableVisibleColumns.basicSalary'), name: 'basicSalary', component: 'input', - disable: false, cardVisible: true, create: true, }, { - align: 'left', - attrs: { - label: t('worker.business.tableVisibleColumns.notes'), - }, name: 'notes', + label: t('worker.business.tableVisibleColumns.notes'), + align: 'left', component: 'input', - disable: false, cardVisible: true, }, ]); @@ -287,20 +260,22 @@ const columns = computed(() => [ ref="tableRef" data-key="WorkerBusiness" :url="`Workers/${entityId}/Business`" + save-url="/Businesses/crud" :create="{ urlCreate: `Workers/${entityId}/Business`, title: 'Create business', - onDataSaved: ({ id }) => tableRef.redirect(id), + onDataSaved: () => tableRef.reload(), formInitialData: {}, }" order="id DESC" :columns="columns" - :user-filter="businessFilter" + :filter="businessFilter" default-mode="card" auto-load :right-search="false" card-class="grid-two q-gutter-x-md" - > + :is-editable="true" + /> From 81591b4f67db4cd0e3a57f9d596fb20f66ce629f Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 14 Jun 2024 15:01:12 +0200 Subject: [PATCH 010/105] fix: use model --- src/pages/Worker/Card/WorkerBusiness.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 3985d079e..f17c9cbcb 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -275,6 +275,7 @@ const columns = computed(() => [ :right-search="false" card-class="grid-two q-gutter-x-md" :is-editable="true" + :use-model="true" /> From 41e1d365f3a05fdf9f21c34e95a29c07f81fabe9 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 19 Jun 2024 08:06:03 +0200 Subject: [PATCH 011/105] refs #6553 fix relations --- src/pages/Worker/Card/WorkerBusiness.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index f17c9cbcb..17085f02c 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -147,7 +147,7 @@ const columns = computed(() => [ }, { align: 'left', - name: 'professionalCategoryFk', + name: 'workerBusinessProfessionalCategoryFk', component: 'select', label: t('worker.business.tableVisibleColumns.professionalCategory'), attrs: { @@ -173,7 +173,7 @@ const columns = computed(() => [ }, { align: 'left', - name: 'workCenterFk', + name: 'workcenterFk', component: 'select', label: t('worker.business.tableVisibleColumns.workCenter'), attrs: { From 68d1d0dbb07e7cbccb5a0d2600bfbea536a2442a Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 20 Jun 2024 13:58:14 +0200 Subject: [PATCH 012/105] refs #6553 function --- src/pages/Worker/Card/WorkerBusiness.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 17085f02c..fbf43f63a 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -106,6 +106,7 @@ const columns = computed(() => [ component: 'date', cardVisible: true, create: true, + 'update:modelValue': reactivateWorker(), }, { label: t('worker.business.tableVisibleColumns.company'), From 8f925401d525aa2fd615d598efd81323bf31cf56 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 25 Jun 2024 10:17:52 +0200 Subject: [PATCH 013/105] refs #6553 fix VnTable --- src/pages/Worker/Card/WorkerBusiness.vue | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index fbf43f63a..bb1cfd990 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -4,7 +4,6 @@ import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import VnTable from 'components/VnTable/VnTable.vue'; import { toDate } from 'src/filters'; -import worker from 'src/router/modules/worker'; import { useQuasar } from 'quasar'; const { t } = useI18n(); @@ -29,7 +28,7 @@ const businessFilter = { { relation: 'companyCode', scope: { - fields: ['id', 'code'], + fields: ['code'], }, }, { @@ -71,8 +70,9 @@ const businessFilter = { ], }; -async function reactivateWorker(value) { - if (value === null) return; +async function reactivateWorker(business) { + console.log('value: ', business); + if (business === null) return; quasar .dialog({ message: t('Do you want to reactivate the user?'), @@ -83,7 +83,7 @@ async function reactivateWorker(value) { cancel: true, }) .onOk(async () => { - worker.isDisable = false; + business.isDisable = false; }); } @@ -106,7 +106,6 @@ const columns = computed(() => [ component: 'date', cardVisible: true, create: true, - 'update:modelValue': reactivateWorker(), }, { label: t('worker.business.tableVisibleColumns.company'), @@ -120,6 +119,7 @@ const columns = computed(() => [ optionValue: 'code', }, cardVisible: true, + create: true, }, { align: 'left', @@ -217,6 +217,7 @@ const columns = computed(() => [ label: t('worker.business.tableVisibleColumns.rate'), component: 'input', cardVisible: true, + create: true, }, { align: 'left', @@ -225,7 +226,7 @@ const columns = computed(() => [ label: t('worker.business.tableVisibleColumns.businessType'), attrs: { url: 'WorkerBusinessTypes', - fields: ['code', 'name'], + fields: ['id', 'name'], }, cardVisible: true, create: true, @@ -277,6 +278,7 @@ const columns = computed(() => [ card-class="grid-two q-gutter-x-md" :is-editable="true" :use-model="true" + @save-changes="reactivateWorker" /> From 97ce44242c34fd5f4aec318c7c45216aa301b011 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 3 Sep 2024 13:58:14 +0200 Subject: [PATCH 014/105] refs #6553 fix business summary --- src/pages/Worker/Card/WorkerBusiness.vue | 62 +----------------------- src/pages/Worker/Card/WorkerSummary.vue | 2 +- 2 files changed, 3 insertions(+), 61 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index bb1cfd990..3aa32b2f1 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -11,64 +11,6 @@ const quasar = useQuasar(); const route = useRoute(); const tableRef = ref(); const entityId = computed(() => route.params.id); -const businessFilter = { - include: [ - { - relation: 'department', - scope: { - fields: ['id', 'name'], - }, - }, - { - relation: 'workCenter', - scope: { - fields: ['id', 'name'], - }, - }, - { - relation: 'companyCode', - scope: { - fields: ['code'], - }, - }, - { - relation: 'reasonEnd', - scope: { - fields: ['id', 'reason'], - }, - }, - { - relation: 'occupationCode', - scope: { - fields: ['code', 'name'], - }, - }, - { - relation: 'workerBusinessProfessionalCategory', - scope: { - fields: ['id', 'description'], - }, - }, - { - relation: 'calendarType', - scope: { - fields: ['id', 'description'], - }, - }, - { - relation: 'workerBusinessType', - scope: { - fields: ['id', 'name'], - }, - }, - // { Falla - // relation: 'workerBusinessAgreement', - // scope: { - // fields: ['id', 'name'], - // }, - // }, - ], -}; async function reactivateWorker(business) { console.log('value: ', business); @@ -271,14 +213,14 @@ const columns = computed(() => [ }" order="id DESC" :columns="columns" - :filter="businessFilter" default-mode="card" auto-load + :disable-option="{ table: true }" :right-search="false" card-class="grid-two q-gutter-x-md" :is-editable="true" :use-model="true" - @save-changes="reactivateWorker" + @save-changes="reactivateWorker(entityId)" /> diff --git a/src/pages/Worker/Card/WorkerSummary.vue b/src/pages/Worker/Card/WorkerSummary.vue index df8d01bfc..57d2036fe 100644 --- a/src/pages/Worker/Card/WorkerSummary.vue +++ b/src/pages/Worker/Card/WorkerSummary.vue @@ -212,7 +212,7 @@ const filter = { Date: Fri, 6 Sep 2024 07:15:25 +0200 Subject: [PATCH 015/105] refs #6553 fix business slot --- src/i18n/locale/en.yml | 1 + src/i18n/locale/es.yml | 1 + src/pages/Worker/Card/WorkerBusiness.vue | 41 +++++++++++++----------- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index bddaf9196..73707b9be 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -260,6 +260,7 @@ globals: ticketsMonitor: Tickets monitor clientsActionsMonitor: Clients and actions serial: Serial + business: Business created: Created worker: Worker now: Now diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index f42738a8a..ba4de742e 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -264,6 +264,7 @@ globals: ticketsMonitor: Monitor de tickets clientsActionsMonitor: Clientes y acciones serial: Facturas por serie + business: Contratos created: Fecha creación worker: Trabajador now: Ahora diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 3aa32b2f1..007eb415d 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -5,6 +5,7 @@ import { useRoute } from 'vue-router'; import VnTable from 'components/VnTable/VnTable.vue'; import { toDate } from 'src/filters'; import { useQuasar } from 'quasar'; +import VnInputTime from 'components/common/VnInputTime.vue'; const { t } = useI18n(); const quasar = useQuasar(); @@ -12,23 +13,22 @@ const route = useRoute(); const tableRef = ref(); const entityId = computed(() => route.params.id); -async function reactivateWorker(business) { - console.log('value: ', business); - if (business === null) return; - quasar - .dialog({ - message: t('Do you want to reactivate the user?'), - ok: { - push: true, - color: 'primary', - }, - cancel: true, - }) - .onOk(async () => { - business.isDisable = false; - }); +async function reactivateWorker(data) { + console.log('value: ', data); + // if (business === null) return; + // quasar + // .dialog({ + // message: t('Do you want to reactivate the user?'), + // ok: { + // push: true, + // color: 'primary', + // }, + // cancel: true, + // }) + // .onOk(async () => { + // business.isDisable = false; + // }); } - const columns = computed(() => [ { name: 'started', @@ -220,8 +220,13 @@ const columns = computed(() => [ card-class="grid-two q-gutter-x-md" :is-editable="true" :use-model="true" - @save-changes="reactivateWorker(entityId)" - /> + @on-data-saved="tableRef.reactivateWorker()" + > + + From 02129591cfbd2351a671f9cbc3e0e2f7bc0d6196 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 10 Sep 2024 08:42:56 +0200 Subject: [PATCH 016/105] refs #6553 workerBusiness --- src/pages/Worker/Card/WorkerBusiness.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 007eb415d..1f03f1ed3 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -4,11 +4,9 @@ import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import VnTable from 'components/VnTable/VnTable.vue'; import { toDate } from 'src/filters'; -import { useQuasar } from 'quasar'; -import VnInputTime from 'components/common/VnInputTime.vue'; +import VnInputDate from 'src/components/common/VnInputDate.vue'; const { t } = useI18n(); -const quasar = useQuasar(); const route = useRoute(); const tableRef = ref(); const entityId = computed(() => route.params.id); @@ -223,7 +221,7 @@ const columns = computed(() => [ @on-data-saved="tableRef.reactivateWorker()" > From f7fb18cf0aaec68a7edb6a9abb86cd498f47f611 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 10 Sep 2024 15:02:21 +0200 Subject: [PATCH 017/105] refs #6553 workerBusiness --- src/components/CrudModel.vue | 2 +- src/components/VnTable/VnTable.vue | 1 + src/pages/Worker/Card/WorkerBusiness.vue | 50 +++++++++++++++--------- src/pages/Worker/Card/WorkerSummary.vue | 2 +- 4 files changed, 35 insertions(+), 20 deletions(-) diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index 33c831e3f..df4af5875 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -182,7 +182,7 @@ async function saveChanges(data) { hasChanges.value = false; isLoading.value = false; - emit('saveChanges', data); + emit('saveChanges', changes); quasar.notify({ type: 'positive', message: t('globals.dataSaved'), diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 5876dd39b..76e1d7821 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -258,6 +258,7 @@ function stopEventPropagation(event) { function reload(params) { selected.value = []; CrudModelRef.value.reload(params); + emit('saveChanges', params); } function columnName(col) { diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 1f03f1ed3..2c1800043 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -4,28 +4,42 @@ import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import VnTable from 'components/VnTable/VnTable.vue'; import { toDate } from 'src/filters'; -import VnInputDate from 'src/components/common/VnInputDate.vue'; +import { useQuasar } from 'quasar'; +import axios from 'axios'; const { t } = useI18n(); const route = useRoute(); const tableRef = ref(); const entityId = computed(() => route.params.id); +const quasar = useQuasar(); async function reactivateWorker(data) { - console.log('value: ', data); - // if (business === null) return; - // quasar - // .dialog({ - // message: t('Do you want to reactivate the user?'), - // ok: { - // push: true, - // color: 'primary', - // }, - // cancel: true, - // }) - // .onOk(async () => { - // business.isDisable = false; - // }); + console.log('value: ', data.updates[0].data.ended); + console.log('data: ', entityId.value); + // const filter = { + // where: { id: entityId.value }, + // }; + // console.log('filter: ', filter); + const { worker } = await axios.get(`Workers`, { + params: { + filter: JSON.stringify({ id: entityId.value }), + }, + }); + console.log('worker', worker); + if (!data.updates[0].data.ended) { + quasar + .dialog({ + message: t('Do you want to reactivate the user?'), + ok: { + push: true, + color: 'primary', + }, + cancel: true, + }) + .onOk(async () => { + worker.isDisable = false; + }); + } } const columns = computed(() => [ { @@ -218,12 +232,12 @@ const columns = computed(() => [ card-class="grid-two q-gutter-x-md" :is-editable="true" :use-model="true" - @on-data-saved="tableRef.reactivateWorker()" + @save-changes="(data) => reactivateWorker(data)" > - diff --git a/src/pages/Worker/Card/WorkerSummary.vue b/src/pages/Worker/Card/WorkerSummary.vue index 839b1b26c..066dd4b33 100644 --- a/src/pages/Worker/Card/WorkerSummary.vue +++ b/src/pages/Worker/Card/WorkerSummary.vue @@ -225,7 +225,7 @@ const filter = { Date: Fri, 13 Sep 2024 13:46:53 +0200 Subject: [PATCH 018/105] refs #6553 fix reactivateWorker --- src/pages/Worker/Card/WorkerBusiness.vue | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/pages/Worker/Card/WorkerBusiness.vue b/src/pages/Worker/Card/WorkerBusiness.vue index 2c1800043..dfe3a502b 100644 --- a/src/pages/Worker/Card/WorkerBusiness.vue +++ b/src/pages/Worker/Card/WorkerBusiness.vue @@ -13,20 +13,11 @@ const tableRef = ref(); const entityId = computed(() => route.params.id); const quasar = useQuasar(); -async function reactivateWorker(data) { - console.log('value: ', data.updates[0].data.ended); - console.log('data: ', entityId.value); - // const filter = { - // where: { id: entityId.value }, - // }; - // console.log('filter: ', filter); - const { worker } = await axios.get(`Workers`, { - params: { - filter: JSON.stringify({ id: entityId.value }), - }, - }); - console.log('worker', worker); - if (!data.updates[0].data.ended) { +async function reactivateWorker() { + const hasToReactive = tableRef.value.CrudModelRef.formData.find( + (data) => !data.ended + ); + if (hasToReactive) { quasar .dialog({ message: t('Do you want to reactivate the user?'), @@ -37,7 +28,9 @@ async function reactivateWorker(data) { cancel: true, }) .onOk(async () => { - worker.isDisable = false; + await axios.patch(`Workers/${entityId.value}`, { + isDisable: false, + }); }); } } From 4d602aadfdff4734fc5d6d18bc8f443aaa8dfdfd Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 11 Nov 2024 11:53:28 +0100 Subject: [PATCH 019/105] feat: refs #7134 #7134 Create SupplierBalance layout --- src/pages/Supplier/Card/SupplierBalance.vue | 329 ++++++++++++++++++++ 1 file changed, 329 insertions(+) create mode 100644 src/pages/Supplier/Card/SupplierBalance.vue diff --git a/src/pages/Supplier/Card/SupplierBalance.vue b/src/pages/Supplier/Card/SupplierBalance.vue new file mode 100644 index 000000000..bc6e987fc --- /dev/null +++ b/src/pages/Supplier/Card/SupplierBalance.vue @@ -0,0 +1,329 @@ + + + + + +en: + bill: 'N/INV {ref}' +es: + Company: Empresa + Total by company: Total por empresa + New payment: Añadir pago + Date: Fecha + Creation date: Fecha de creación + Employee: Empleado + Reference: Referencia + bill: 'N/FRA {ref}' + Bank: Caja + Debit: Debe + Havings: Haber + Balance: Balance + Conciliated: Conciliado + Send compensation: Enviar compensación + Do you want to report compensation to the supplier by mail?: ¿Desea informar de la compensación al cliente por correo? + + + From 8d2ad235fbf2088d8b7a43b238f5fda63220dd05 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 11 Nov 2024 11:54:53 +0100 Subject: [PATCH 020/105] feat: refs #7134 #7134 Create new route --- src/router/modules/Supplier.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/router/modules/Supplier.js b/src/router/modules/Supplier.js index 143d7c824..86fb8cf77 100644 --- a/src/router/modules/Supplier.js +++ b/src/router/modules/Supplier.js @@ -21,6 +21,7 @@ export default { 'SupplierAccounts', 'SupplierContacts', 'SupplierAddresses', + 'SupplierBalance', 'SupplierConsumption', 'SupplierAgencyTerm', 'SupplierDms', @@ -144,6 +145,16 @@ export default { component: () => import('src/pages/Supplier/Card/SupplierAddressesCreate.vue'), }, + { + path: 'balance', + name: 'SupplierBalance', + meta: { + title: 'balance', + icon: 'balance', + }, + component: () => + import('src/pages/Supplier/Card/SupplierBalance.vue'), + }, { path: 'consumption', name: 'SupplierConsumption', From da99d8250423e9c2fd5d94bafa0ad07c7a14f182 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 11 Nov 2024 11:55:28 +0100 Subject: [PATCH 021/105] perf: refs #7134 #7134 global dialog newPayment and composable getRisk --- src/components/CreateNewPayment.vue | 333 ++++++++++++++++++ src/composables/getRisk.js | 22 ++ src/pages/Customer/Card/CustomerBalance.vue | 2 +- .../components/CustomerNewPayment.vue | 2 +- .../Supplier/composables/getSupplierRisk.js | 12 + 5 files changed, 369 insertions(+), 2 deletions(-) create mode 100644 src/components/CreateNewPayment.vue create mode 100644 src/composables/getRisk.js create mode 100644 src/pages/Supplier/composables/getSupplierRisk.js diff --git a/src/components/CreateNewPayment.vue b/src/components/CreateNewPayment.vue new file mode 100644 index 000000000..2267d5643 --- /dev/null +++ b/src/components/CreateNewPayment.vue @@ -0,0 +1,333 @@ + + + + + +es: + New payment: Añadir pago + Date: Fecha + Company: Empresa + Bank: Caja + Amount: Importe + Reference: Referencia + Cash: Efectivo + Delivered amount: Cantidad entregada + Amount to return: Cantidad a devolver + View recipt: Ver recibido + Send email: Enviar correo + Compensation: Compensación + Compensation account: Cuenta para compensar + Supplier Compensation Reference: ({supplierId}) Ntro Proveedor {supplierName} + Client Compensation Reference: ({clientId}) Ntro Cliente {clientName} + There is no assigned email for this client: No hay correo asignado para este cliente + Amount exceeded: Según ley contra el fraude no se puede recibir cobros por importe igual o superior a {maxAmount} + diff --git a/src/composables/getRisk.js b/src/composables/getRisk.js new file mode 100644 index 000000000..6c7f75ad2 --- /dev/null +++ b/src/composables/getRisk.js @@ -0,0 +1,22 @@ +import axios from 'axios'; + +export async function getClientRisk(_filter) { + const filter = { + ..._filter, + include: { relation: 'company', scope: { fields: ['code'] } }, + }; + + return await axios(`ClientRisks`, { + params: { filter: JSON.stringify(filter) }, + }); +} +export async function getSupplierRisk(_filter) { + const filter = { + ..._filter, + include: { relation: 'company', scope: { fields: ['code'] } }, + }; + + return await axios(`ClientRisks`, { + params: { filter: JSON.stringify(filter) }, + }); +} diff --git a/src/pages/Customer/Card/CustomerBalance.vue b/src/pages/Customer/Card/CustomerBalance.vue index f6fc3eed2..a45ebc778 100644 --- a/src/pages/Customer/Card/CustomerBalance.vue +++ b/src/pages/Customer/Card/CustomerBalance.vue @@ -5,7 +5,7 @@ import { useRoute } from 'vue-router'; import { useAcl } from 'src/composables/useAcl'; import axios from 'axios'; import { useQuasar } from 'quasar'; -import { getClientRisk } from '../composables/getClientRisk'; +import { getClientRisk } from 'src/composables/getRisk'; import { toCurrency, toDate, toDateHourMin } from 'src/filters'; import { useState } from 'composables/useState'; diff --git a/src/pages/Customer/components/CustomerNewPayment.vue b/src/pages/Customer/components/CustomerNewPayment.vue index 291f28642..2267d5643 100644 --- a/src/pages/Customer/components/CustomerNewPayment.vue +++ b/src/pages/Customer/components/CustomerNewPayment.vue @@ -3,7 +3,7 @@ import { onBeforeMount, reactive, ref } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; import axios from 'axios'; -import { getClientRisk } from '../composables/getClientRisk'; +import { getClientRisk } from 'src/composables/getRisk'; import { useDialogPluginComponent } from 'quasar'; import { usePrintService } from 'composables/usePrintService'; diff --git a/src/pages/Supplier/composables/getSupplierRisk.js b/src/pages/Supplier/composables/getSupplierRisk.js new file mode 100644 index 000000000..ebaf545ee --- /dev/null +++ b/src/pages/Supplier/composables/getSupplierRisk.js @@ -0,0 +1,12 @@ +import axios from 'axios'; + +export async function getClientRisk(_filter) { + const filter = { + ..._filter, + include: { relation: 'company', scope: { fields: ['code'] } }, + }; + + return await axios(`ClientRisks`, { + params: { filter: JSON.stringify(filter) }, + }); +} From 7b8093c048d0c0d17eaaddb1dd515a3644fda799 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 11 Nov 2024 14:22:18 +0100 Subject: [PATCH 022/105] feat: refs #7134 #7134 split newPayment --- src/pages/Supplier/Card/SupplierBalance.vue | 12 ++- .../Supplier/Card/SupplierNewPayment.vue} | 77 +++++++++++++++---- 2 files changed, 70 insertions(+), 19 deletions(-) rename src/{components/CreateNewPayment.vue => pages/Supplier/Card/SupplierNewPayment.vue} (83%) diff --git a/src/pages/Supplier/Card/SupplierBalance.vue b/src/pages/Supplier/Card/SupplierBalance.vue index bc6e987fc..9f36b8707 100644 --- a/src/pages/Supplier/Card/SupplierBalance.vue +++ b/src/pages/Supplier/Card/SupplierBalance.vue @@ -18,7 +18,7 @@ import VnInput from 'components/common/VnInput.vue'; import VnSubToolbar from 'components/ui/VnSubToolbar.vue'; import VnFilter from 'components/VnTable/VnFilter.vue'; -import CreateNewPayment from 'src/components/CreateNewPayment.vue'; +import SupplierNewPayment from 'src/pages/Supplier/Card/SupplierNewPayment.vue'; import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue'; const { openConfirmationModal } = useVnConfirm(); @@ -36,6 +36,7 @@ const supplierRisk = ref([]); const tableRef = ref(); const companyId = ref(); const companyUser = ref(user.value.companyFk); +const bankUser = ref(user.value.localBankFk); const balances = ref([]); const vnFilterRef = ref({}); const filter = computed(() => { @@ -200,11 +201,14 @@ async function onFetch(data) { } const showNewPaymentDialog = () => { + debugger; quasar.dialog({ - component: CreateNewPayment, + component: SupplierNewPayment, componentProps: { companyId: companyId.value, + bankId: bankUser.value, totalCredit: supplierRisk.value[0]?.amount, + extraFields: ['currencyFk', 'orderBy'], promise: () => tableRef.value.reload(), }, }); @@ -241,7 +245,7 @@ const showBalancePdf = ({ id }) => { { - urlCreate.value = `Clients/${route.params.id}/createReceipt`; + urlCreate.value = `Suppliers/${route.params.id}/createReceipt`; }); function setPaymentType(accounting) { @@ -112,7 +123,7 @@ function onBeforeSave(data) { return notify(t('Amount exceeded', { maxAmount: maxAmount.value }), 'negative'); if (isCash.value && shouldSendEmail.value && !data.email) - return notify(t('There is no assigned email for this client'), 'negative'); + return notify(t(`There is no assigned email for this supplier`), 'negative'); data.bankFk = data.bankFk.id; return data; @@ -153,12 +164,11 @@ async function accountShortToStandard({ target: { value } }) { async function getAmountPaid() { const filter = { where: { - clientFk: route.params.id, + supplierFk: route.params.id, companyFk: initialData.companyFk, }, }; - - const { data } = await getClientRisk(filter); + const { data } = await getSupplierRisk(filter); initialData.amountPaid = (data?.length && data[0].amount) || undefined; } @@ -177,10 +187,17 @@ async function getAmountPaid() { url="Accountings" /> + - + {{ data }}
{{ t('New payment') }}
- + + + + + + +
Date: Mon, 11 Nov 2024 14:46:57 +0100 Subject: [PATCH 023/105] feat: refs #7134 use VnAccountNumber --- src/pages/Supplier/Card/SupplierBalance.vue | 1 - src/pages/Supplier/Card/SupplierNewPayment.vue | 11 ++++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/pages/Supplier/Card/SupplierBalance.vue b/src/pages/Supplier/Card/SupplierBalance.vue index 9f36b8707..d9e79288d 100644 --- a/src/pages/Supplier/Card/SupplierBalance.vue +++ b/src/pages/Supplier/Card/SupplierBalance.vue @@ -201,7 +201,6 @@ async function onFetch(data) { } const showNewPaymentDialog = () => { - debugger; quasar.dialog({ component: SupplierNewPayment, componentProps: { diff --git a/src/pages/Supplier/Card/SupplierNewPayment.vue b/src/pages/Supplier/Card/SupplierNewPayment.vue index fc78a5495..b7f8dd477 100644 --- a/src/pages/Supplier/Card/SupplierNewPayment.vue +++ b/src/pages/Supplier/Card/SupplierNewPayment.vue @@ -15,6 +15,7 @@ import VnInputDate from 'components/common/VnInputDate.vue'; import VnInputNumber from 'components/common/VnInputNumber.vue'; import VnSelect from 'src/components/common/VnSelect.vue'; import VnInput from 'src/components/common/VnInput.vue'; +import VnAccountNumber from 'src/components/common/VnAccountNumber.vue'; const { t } = useI18n(); const route = useRoute(); @@ -180,12 +181,7 @@ async function getAmountPaid() { auto-load url="Companies" /> - + - From 3404bc6d0b2c943ad904184f3e98b7d06b2992e5 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 11 Nov 2024 15:59:05 +0100 Subject: [PATCH 024/105] feat: refs #7134 apply supplierBalanceFilter --- src/pages/Supplier/Card/SupplierBalance.vue | 30 +++-- .../Supplier/Card/SupplierBalanceFilter.vue | 123 ++++++++++++++++++ 2 files changed, 141 insertions(+), 12 deletions(-) create mode 100644 src/pages/Supplier/Card/SupplierBalanceFilter.vue diff --git a/src/pages/Supplier/Card/SupplierBalance.vue b/src/pages/Supplier/Card/SupplierBalance.vue index d9e79288d..9fb424220 100644 --- a/src/pages/Supplier/Card/SupplierBalance.vue +++ b/src/pages/Supplier/Card/SupplierBalance.vue @@ -6,6 +6,7 @@ import { useAcl } from 'src/composables/useAcl'; import axios from 'axios'; import { useQuasar } from 'quasar'; import { getSupplierRisk } from 'src/composables/getRisk'; +import RightMenu from 'src/components/common/RightMenu.vue'; import { toCurrency, toDate, toDateHourMin } from 'src/filters'; import { useState } from 'composables/useState'; @@ -20,6 +21,7 @@ import VnFilter from 'components/VnTable/VnFilter.vue'; import SupplierNewPayment from 'src/pages/Supplier/Card/SupplierNewPayment.vue'; import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue'; +import SupplierBalanceFilter from './SupplierBalanceFilter.vue'; const { openConfirmationModal } = useVnConfirm(); const { sendEmail, openReport } = usePrintService(); @@ -187,17 +189,18 @@ async function getCurrentBalance() { } async function onFetch(data) { - balances.value = []; - for (const [index, balance] of data.entries()) { - if (index === 0) { - balance.balance = await getCurrentBalance(); - continue; - } - const previousBalance = data[index - 1]; - balance.balance = - previousBalance?.balance - (previousBalance?.debit - previousBalance?.credit); - } - balances.value = data; + return; + // balances.value = []; + // for (const [index, balance] of data.entries()) { + // if (index === 0) { + // balance.balance = await getCurrentBalance(); + // continue; + // } + // const previousBalance = data[index - 1]; + // balance.balance = + // previousBalance?.balance - (previousBalance?.debit - previousBalance?.credit); + // } + // balances.value = data; } const showNewPaymentDialog = () => { @@ -241,9 +244,12 @@ const showBalancePdf = ({ id }) => {
+ + + +import { useI18n } from 'vue-i18n'; +import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; +import VnSelect from 'src/components/common/VnSelect.vue'; +import VnInput from 'src/components/common/VnInput.vue'; +import VnInputDate from 'src/components/common/VnInputDate.vue'; + +const { t } = useI18n(); +defineProps({ + dataKey: { + type: String, + required: true, + }, +}); + + + + + +en: + params: + search: General search + itemId: Item id + buyerId: Buyer + typeId: Type + categoryId: Category + from: From + to: To +es: + + params: + isConciliated: Conciliado + currencyFk: Moneda + New payment: Añadir pago + Date: Fecha + Company: Empresa + bank: Caja + Amount: Importe + Reference: Referencia + Cash: Efectivo + From 78e70f2b698e8bada5503e5ac7e190993003eddd Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 20 Nov 2024 14:28:41 +0100 Subject: [PATCH 025/105] feat: refs #7134 #7124 handle columns --- src/pages/Supplier/Card/SupplierBalance.vue | 98 ++++++++++----------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/src/pages/Supplier/Card/SupplierBalance.vue b/src/pages/Supplier/Card/SupplierBalance.vue index 9fb424220..dcfa7c72b 100644 --- a/src/pages/Supplier/Card/SupplierBalance.vue +++ b/src/pages/Supplier/Card/SupplierBalance.vue @@ -6,9 +6,8 @@ import { useAcl } from 'src/composables/useAcl'; import axios from 'axios'; import { useQuasar } from 'quasar'; import { getSupplierRisk } from 'src/composables/getRisk'; -import RightMenu from 'src/components/common/RightMenu.vue'; -import { toCurrency, toDate, toDateHourMin } from 'src/filters'; +import { dashIfEmpty, toCurrency, toDate, toDateHourMin } from 'src/filters'; import { useState } from 'composables/useState'; import { useStateStore } from 'stores/useStateStore'; import { usePrintService } from 'composables/usePrintService'; @@ -74,40 +73,41 @@ const companyFilterColumn = { }; const columns = computed(() => [ + // { + // align: 'left', + // name: 'payed', + // label: t('Date'), + // format: ({ payed }) => toDate(payed), + // cardVisible: true, + // }, { align: 'left', - name: 'payed', - label: t('Date'), - format: ({ payed }) => toDate(payed), - cardVisible: true, - }, - { - align: 'left', - name: 'created', + name: 'dated', label: t('Creation date'), - format: ({ created }) => toDateHourMin(created), + format: ({ dated }) => toDateHourMin(dated), cardVisible: true, }, + // { + // align: 'left', + // label: t('Employee'), + // columnField: { + // component: 'userLink', + // attrs: ({ row }) => { + // return { + // workerId: row.workerFk, + // name: row.userName, + // }; + // }, + // }, + // cardVisible: true, + // }, { align: 'left', - label: t('Employee'), - columnField: { - component: 'userLink', - attrs: ({ row }) => { - return { - workerId: row.workerFk, - name: row.userName, - }; - }, - }, - cardVisible: true, - }, - { - align: 'left', - name: 'description', + name: 'sref', label: t('Reference'), isTitle: true, class: 'extend', + format: ({ sref }) => dashIfEmpty(sref), }, { align: 'left', @@ -117,23 +117,23 @@ const columns = computed(() => [ }, { align: 'left', - name: 'debit', + name: 'invoiceEuros', label: t('Debit'), - format: ({ debit }) => debit && toCurrency(debit), + format: ({ invoiceEuros }) => invoiceEuros && toCurrency(invoiceEuros), isId: true, }, { align: 'left', - name: 'credit', + name: 'paymentEuros', label: t('Havings'), - format: ({ credit }) => credit && toCurrency(credit), + format: ({ paymentEuros }) => paymentEuros && toCurrency(paymentEuros), cardVisible: true, }, { align: 'left', - name: 'balance', + name: 'euroBalance', label: t('Balance'), - format: ({ balance }) => toCurrency(balance), + format: ({ euroBalance }) => toCurrency(euroBalance), cardVisible: true, }, { @@ -146,23 +146,23 @@ const columns = computed(() => [ align: 'left', name: 'tableActions', actions: [ - { - title: t('globals.downloadPdf'), - icon: 'cloud_download', - show: (row) => row.isInvoice, - action: (row) => showBalancePdf(row), - }, - { - title: t('Send compensation'), - icon: 'outgoing_mail', - show: (row) => !!row.isCompensation, - action: ({ id }) => - openConfirmationModal( - t('Send compensation'), - t('Do you want to report compensation to the supplier by mail?'), - () => sendEmail(`Receipts/${id}/balance-compensation-email`) - ), - }, + // { + // title: t('globals.downloadPdf'), + // icon: 'cloud_download', + // show: (row) => row.isInvoice, + // action: (row) => showBalancePdf(row), + // }, + // { + // title: t('Send compensation'), + // icon: 'outgoing_mail', + // show: (row) => !!row.isCompensation, + // action: ({ id }) => + // openConfirmationModal( + // t('Send compensation'), + // t('Do you want to report compensation to the supplier by mail?'), + // () => sendEmail(`Receipts/${id}/balance-compensation-email`) + // ), + // }, ], }, ]); From 09804e06c751ae1702300a36c52b2be7295f0175 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 20 Nov 2024 14:28:47 +0100 Subject: [PATCH 026/105] feat: refs #7134 #7124 handle filter --- src/pages/Supplier/Card/SupplierBalanceFilter.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Supplier/Card/SupplierBalanceFilter.vue b/src/pages/Supplier/Card/SupplierBalanceFilter.vue index 4d5b4f99c..2f75ccfc3 100644 --- a/src/pages/Supplier/Card/SupplierBalanceFilter.vue +++ b/src/pages/Supplier/Card/SupplierBalanceFilter.vue @@ -23,6 +23,7 @@ defineProps({