Gestion du changement de type de contrat + correction du calcule des RTT sur un contrat qui commence en milieu de semaine (#19)
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled

| Numéro du ticket | Titre du ticket |
|------------------|-----------------|
|                  |                 |

## Description de la PR

## Modification du .env

## Check list

- [x] Pas de régression
- [x] TU/TI/TF rédigée
- [x] TU/TI/TF OK
- [x] CHANGELOG modifié

Reviewed-on: #19
Co-authored-by: tristan <tristan@yuno.malio.fr>
Co-committed-by: tristan <tristan@yuno.malio.fr>
This commit was merged in pull request #19.
This commit is contained in:
2026-05-22 06:42:33 +00:00
committed by Autin
parent b541f9ded8
commit abdaf809f8
40 changed files with 5021 additions and 153 deletions

View File

@@ -28,7 +28,7 @@
<div class="flex justify-center">
<button
class="rounded-md bg-primary-500 px-8 py-2 font-bold text-white hover:bg-primary-600 disabled:opacity-40 disabled:cursor-not-allowed"
:disabled="isHistoricalYear"
:disabled="isPayDisabled"
@click="openPaymentDrawer"
>
+ Payer les RTT
@@ -276,6 +276,7 @@
<script setup lang="ts">
import type { EmployeeRttSummary, EmployeeRttWeekSummary } from '~/services/dto/employee-rtt-summary'
import type { ContractPhase } from '~/services/dto/contract-phase'
import AppDrawer from '~/components/AppDrawer.vue'
type RttYearOption = {
@@ -288,6 +289,7 @@ const props = defineProps<{
selectedYear: number | null
availableYears: RttYearOption[]
currentYear: number | null
selectedPhase: ContractPhase | null
}>()
const emit = defineEmits<{
@@ -301,6 +303,20 @@ const isHistoricalYear = computed(() =>
&& props.selectedYear !== props.currentYear
)
const isLastExerciseOfPhase = computed(() => {
if (!props.selectedPhase || props.selectedPhase.isCurrent) return false
if (!props.selectedPhase.endDate) return false
const endDate = new Date(`${props.selectedPhase.endDate}T00:00:00`)
const endYear = endDate.getMonth() >= 5
? endDate.getFullYear() + 1
: endDate.getFullYear()
return props.selectedYear === endYear
})
const isPayDisabled = computed(() =>
isHistoricalYear.value && !isLastExerciseOfPhase.value
)
const handleYearChange = (event: Event) => {
const target = event.target as HTMLSelectElement
const value = Number(target.value)