Compare commits

..

23 Commits

Author SHA1 Message Date
Carlos Satorres 2c492e88d5 Merge pull request 'refs #7529 create WorkerPIT' (!442) from 7529-workerPIT into dev
gitea/salix-front/pipeline/head This commit looks good Details
Reviewed-on: #442
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-25 13:05:32 +00:00
Carlos Satorres dfcaf4e692 fix: refs #7529 fix e2e
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-25 13:53:22 +01:00
Carlos Satorres 2bc2217406 fix: refs #7529 fix workerPit e2e
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-25 13:49:01 +01:00
Carlos Satorres 5dd508c559 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7529-workerPIT
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-25 13:31:02 +01:00
Carlos Satorres 095c1f477f fix: refs #7529 add save
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-22 07:34:39 +01:00
Carlos Satorres 3352cea0e7 fix: refs #7529 fix e2e
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-22 06:08:11 +01:00
Carlos Satorres a0f804ab78 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7529-workerPIT 2024-11-21 12:19:30 +01:00
Carlos Satorres 991ef7b243 fix: refs #7529 fix te2e
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-21 09:32:45 +01:00
Carlos Satorres 258da0f60b Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7529-workerPIT 2024-11-20 13:16:10 +01:00
Carlos Satorres 04f6107909 fix: refs #7529 fix scss
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-07 14:38:54 +01:00
Carlos Satorres 780af58747 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7529-workerPIT
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-11-07 12:48:26 +01:00
Carlos Satorres 8b2fbefc35 fix: refs #7529 front
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-29 14:00:04 +01:00
Carlos Satorres eea6276264 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7529-workerPIT 2024-10-29 08:32:47 +01:00
Carlos Satorres adbf1af453 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7529-workerPIT
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-29 06:13:22 +01:00
Carlos Satorres 847cf6a5b4 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7529-workerPIT
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-28 13:31:42 +01:00
Carlos Satorres 1aefad58e9 fix: refs #7529 fix front
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-18 14:05:38 +02:00
Carlos Satorres 237b3ed4df Merge branch 'dev' of https: refs #7529//gitea.verdnatura.es/verdnatura/salix-front into 7529-workerPIT
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-18 11:17:06 +02:00
Carlos Satorres 5d8f9dbd72 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7529-workerPIT
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-10-03 13:02:56 +02:00
Carlos Satorres ee2f80e9bb refs #7529 crudModel workerPit
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-09-19 10:25:22 +02:00
Carlos Satorres 87bce8fc21 refs #7529 fix workerPit
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-09-18 12:08:38 +02:00
Carlos Satorres b2c2f42243 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 7529-workerPIT
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-09-18 07:57:58 +02:00
Carlos Satorres 657dbc6761 refs #7529 route
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-06-13 08:24:36 +02:00
Carlos Satorres 3bfbed9e54 refs #7529 create WorkerPIT
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2024-06-10 13:19:09 +02:00
8 changed files with 322 additions and 1 deletions

View File

@ -91,6 +91,10 @@ const $props = defineProps({
type: Boolean,
default: true,
},
maxWidth: {
type: [String, Boolean],
default: '800px',
},
});
const emit = defineEmits(['onFetch', 'onDataSaved']);
const modelValue = computed(
@ -283,6 +287,7 @@ defineExpose({
@submit="save"
@reset="reset"
class="q-pa-md"
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
id="formModel"
>
<QCard>
@ -371,7 +376,6 @@ defineExpose({
color: black;
}
#formModel {
max-width: 800px;
width: 100%;
}

View File

@ -93,6 +93,7 @@ const mixinRules = [
:rules="mixinRules"
:lazy-rules="true"
hide-bottom-space
:data-cy="$attrs.dataCy ?? $attrs.label + '_input'"
>
<template v-if="$slots.prepend" #prepend>
<slot name="prepend" />

View File

@ -306,6 +306,7 @@ function handleKeyDown(event) {
:input-debounce="useURL ? '300' : '0'"
:loading="isLoading"
@virtual-scroll="onScroll"
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"
>
<template v-if="isClearable" #append>
<QIcon

View File

@ -298,6 +298,7 @@ globals:
clientsActionsMonitor: Clients and actions
serial: Serial
medical: Mutual
pit: IRPF
RouteExtendedList: Router
wasteRecalc: Waste recaclulate
operator: Operator

View File

@ -303,6 +303,7 @@ globals:
clientsActionsMonitor: Clientes y acciones
serial: Facturas por serie
medical: Mutua
pit: IRPF
wasteRecalc: Recalcular mermas
operator: Operario
parking: Parking

View File

@ -0,0 +1,263 @@
<script setup>
import { ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import axios from 'axios';
import FetchData from 'components/FetchData.vue';
import FormModel from 'src/components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import CrudModel from 'components/CrudModel.vue';
import VnTitle from 'src/components/common/VnTitle.vue';
import { useQuasar } from 'quasar';
import VnConfirm from 'components/ui/VnConfirm.vue';
import useNotify from 'src/composables/useNotify.js';
const { notify } = useNotify();
const route = useRoute();
const { t } = useI18n();
const disabilityGradesOptions = ref();
const workerPitCrudRef = ref({});
const insertTag = () => {
workerPitCrudRef.value.insert();
};
const quasar = useQuasar();
const deleteRelative = async (id) => {
await new Promise((resolve) => {
quasar
.dialog({
component: VnConfirm,
componentProps: {
title: t('Remove Relative'),
message: t('Do you want to remove this relative?'),
},
})
.onOk(() => {
resolve(true);
})
.onCancel(() => {
resolve(false);
});
});
await axios.delete(`WorkerRelatives/${id}`);
workerPitCrudRef.value.reload();
notify('Relative removed', 'positive');
};
</script>
<template>
<FetchData
url="DisabilityGrades"
@on-fetch="(data) => (disabilityGradesOptions = data)"
auto-load
/>
<FormModel
url="WorkerIrpfs"
:filter="{ where: { workerFk: route.params.id } }"
auto-load
data-key="workerIrpfs"
:max-width="false"
>
<template #form="{ data }">
<QCard class="q-px-lg q-py-lg">
<VnTitle :text="t('IRPF')" />
<VnRow>
<VnInput
:label="t('familySituation')"
clearable
v-model="data.familySituation"
/>
<VnInput :label="t('spouseNif')" clearable v-model="data.spouseNif" />
</VnRow>
<VnRow>
<VnSelect
:label="t('disabilityGrades')"
:options="disabilityGradesOptions"
option-label="description"
option-value="id"
v-model="data.disabilityGradeFk"
id="disabilityGrades"
data-cy="disabilityGrades"
hide-selected
/>
<VnInputDate
:label="t('geographicMobilityDate')"
v-model="data.geographicMobilityDate"
/>
</VnRow>
<VnRow>
<VnInput
clearable
v-model="data.childPension"
:label="t(`childPension`)"
/>
<VnInput
clearable
v-model="data.spousePension"
:label="t(`spousePension`)"
/>
</VnRow>
<VnRow>
<QCheckbox v-model="data.isDependend" :label="t(`isDependend`)" />
<QCheckbox
v-model="data.hasHousingPaymentBefore"
:label="t(`hasHousingPaymentBefore`)"
/>
</VnRow>
<VnRow>
<QCheckbox
v-model="data.hasHousingPaymentAfter"
:label="t(`hasHousingPaymentAfter`)"
/>
<QCheckbox
v-model="data.hasExtendedWorking"
:label="t(`hasExtendedWorking`)"
/>
</VnRow>
</QCard>
<CrudModel
ref="workerPitCrudRef"
data-key="workerPit"
url="WorkerRelatives"
auto-load
:filter="{
where: { workerFk: route.params.id },
}"
:data-required="{ workerFk: route.params.id }"
:has-sub-toolbar="false"
>
<template #body="{ rows }">
<QCard class="q-px-lg q-py-lg" flat>
<div class="row no-wrap justify-between q-pb-md">
<VnTitle :text="t('Relatives')" />
<QBtnGroup push style="column-gap: 10px">
<QBtn
color="primary"
icon="restart_alt"
flat
@click="workerPitCrudRef.reset"
:disable="!workerPitCrudRef.hasChanges"
:title="t('globals.reset')"
/>
<QBtn
ref="saveButtonRef"
color="primary"
icon="save"
@click="workerPitCrudRef.onSubmit"
:disable="!workerPitCrudRef.hasChanges"
:title="t('globals.save')"
data-cy="workerPitRelativeSaveBtn"
/>
</QBtnGroup>
</div>
<div
v-for="(row, index) in rows"
:key="index"
class="row no-wrap q-mb-lg q-gutter-lg"
padding="none"
>
<VnSelect
:options="[
{ id: 0, name: 'Ascendiente' },
{ id: 1, name: 'Descendiente' },
]"
:label="t('isDescendant')"
v-model="row.isDescendant"
class="q-gutter-xs q-mb-xs"
/>
<VnSelect
:label="t('disabilityGrades')"
:options="disabilityGradesOptions"
option-label="description"
option-value="id"
v-model="row.disabilityGradeFk"
class="q-gutter-xs q-mb-xs"
/>
<VnInput
type="number"
v-model="row.birthed"
:label="t(`birthed`)"
/>
<VnInput
type="number"
v-model="row.adoptionYear"
:label="t(`adoptionYear`)"
/>
<QCheckbox
v-model="row.isDependend"
:label="t(`isDependend`)"
/>
<QCheckbox
v-model="row.isJointCustody"
:label="t(`isJointCustody`)"
size="xs"
/>
<QBtn
@click="deleteRelative(rows[0].id)"
class="cursor-pointer"
color="primary"
flat
icon="delete"
style="flex: 0"
/>
</div>
<VnRow class="justify-left items-center">
<QBtn
@click="insertTag(rows)"
class="cursor-pointer"
color="primary"
flat
icon="add"
shortcut="+"
style="flex: 0"
data-cy="addRelative"
/>
</VnRow>
</QCard>
</template>
</CrudModel>
</template>
</FormModel>
</template>
<i18n>
es:
familySituation: Situación familiar
disabilityGrades: Discapacidad
geographicMobilityDate: Movilidad geografica
childPension: Pensión hijos
spousePension: Pensión cónyuge
isDependend: Ayuda / Movilidad reducida
spouseNif: NIF cónyuge
hasHousingPaymentBefore: Pagos vivienda anterior 2011
hasHousingPaymentAfter: Pagos vivienda posterior 2011
hasExtendedWorking: Prolongación actividad laboral
isDescendant: Descen/Ascen
disabilityGradeFk: Discapacidad
birthed: Año nacimiento
adoptionYear: Año adopción
isJointCustody: Computo por entero
Relatives: Relacionados
en:
familySituation: Family Situation
disabilityGrades: Disability Grades
geographicMobilityDate: Geographic Mobility Date
childPension: Child Pension
spousePension: Spouse Pension
isDependend: Dependent Suport / Reduced Mobility
spouseNif: Spouse NIF (Tax ID)
hasHousingPaymentBefore: Housing Payments Before 2011
hasHousingPaymentAfter: Housing Payments After 2011
hasExtendedWorking: Extended Work Activity
isDescendant: Descendant/Ascendant
disabilityGradeFk: Disability Grade
birthed: Birth Year
adoptionYear: Adoption Year
isJointCustody: Joint custody
Relatives: Relatives
</i18n>

View File

@ -24,6 +24,7 @@ export default {
'WorkerDms',
'WorkerTimeControl',
'WorkerLocker',
'WorkerPit',
'WorkerBalance',
'WorkerFormation',
'WorkerMedical',
@ -216,6 +217,15 @@ export default {
},
component: () => import('src/pages/Worker/Card/WorkerMedical.vue'),
},
{
name: 'WorkerPit',
path: 'pit',
meta: {
title: 'pit',
icon: 'lock',
},
component: () => import('src/pages/Worker/Card/WorkerPit.vue'),
},
{
name: 'WorkerOperator',
path: 'operator',

View File

@ -0,0 +1,40 @@
describe('WorkerPit', () => {
const familySituationInput = '[data-cy="Family Situation_input"]';
const familySituation = '1';
const childPensionInput = '[data-cy="Child Pension_input"]';
const childPension = '120';
const spouseNifInput = '[data-cy="Spouse Pension_input"]';
const spouseNif = '65117125P';
const spousePensionInput = '[data-cy="Spouse Pension_input"]';
const spousePension = '120';
const addRelative = '[data-cy="addRelative"]';
const isDescendantSelect = '[data-cy="Descendant/Ascendant_select"]';
const birthedInput = '[data-cy="Birth Year_input"]';
const birthed = '2002';
const adoptionYearInput = '[data-cy="Adoption Year_input"]';
const adoptionYear = '2004';
const saveRelative = '[data-cy="workerPitRelativeSaveBtn"]';
const savePIT = '#st-actions > .q-btn-group > .q-btn--standard';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/worker/1107/pit`);
});
it('complete PIT', () => {
cy.get(familySituationInput).type(familySituation);
cy.get(childPensionInput).type(childPension);
cy.get(spouseNifInput).type(spouseNif);
cy.get(spousePensionInput).type(spousePension);
cy.get(savePIT).click();
});
it('complete relative', () => {
cy.get(addRelative).click();
cy.get(isDescendantSelect).type('{downArrow}{downArrow}{enter}');
cy.get(birthedInput).type(birthed);
cy.get(adoptionYearInput).type(adoptionYear);
cy.get(saveRelative).click();
});
});