diff --git a/doc/functional-rules.md b/doc/functional-rules.md index 3e4829d..ce18874 100644 --- a/doc/functional-rules.md +++ b/doc/functional-rules.md @@ -231,6 +231,14 @@ Tous les filtres checkbox sont cochés par défaut à l'ouverture du drawer. - s'exécute le `1er juin` (même cron que le rollover congés) - calcule le total récup N-1 et le persiste en `opening_minutes` du nouvel exercice - idempotent (ne recrée pas si la ligne existe) + - paiement RTT: + - saisie RH via `PATCH /employees/{id}/rtt-payments` (body: `month`, `minutes`, `rate`) + - stocké dans `employee_rtt_payments` (employee, year, month, minutes, rate) + - `rate`: taux de majoration, valeurs `25` ou `50` + - les heures payées sont soustraites du disponible RTT (`availableMinutes -= totalPaidMinutes`) + - affichage: 2 lignes par mois dans le tableau (25% et 50%) + - affichage: + - le compteur global RTT est affiché en **heures** (format `Xh00`) ## 10) Notifications diff --git a/frontend/components/employees/RttTab.vue b/frontend/components/employees/RttTab.vue index 75196fc..778145e 100644 --- a/frontend/components/employees/RttTab.vue +++ b/frontend/components/employees/RttTab.vue @@ -1,8 +1,8 @@
Total
{{ formatMinutes(month.totalMinutes) }}
-
Heure payée
-
0h
+
Heure payée 25%
+
+

{{ formatMinutes(getMonthPaid25(month.month)) }}

+ +
+
Heure payée 50%
+
+

{{ formatMinutes(getMonthPaid50(month.month)) }}

+ +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
diff --git a/frontend/composables/useEmployeeDetailPage.ts b/frontend/composables/useEmployeeDetailPage.ts index 2c4295e..83fbe2f 100644 --- a/frontend/composables/useEmployeeDetailPage.ts +++ b/frontend/composables/useEmployeeDetailPage.ts @@ -7,7 +7,7 @@ import { CONTRACT_TYPES } from '~/services/dto/contract' import { listAbsences } from '~/services/absences' import { listContracts } from '~/services/contracts' import { getEmployeeLeaveSummary, updateFractionedDays } from '~/services/employee-leave-summary' -import { getEmployeeRttSummary } from '~/services/employee-rtt-summary' +import { getEmployeeRttSummary, createRttPayment } from '~/services/employee-rtt-summary' import { getEmployee, updateEmployee } from '~/services/employees' import { listPublicHolidays } from '~/services/public-holidays' import { formatNullableYmdToFr, getTodayYmd, shiftYmd } from '~/utils/date' @@ -307,6 +307,13 @@ export const useEmployeeDetailPage = () => { await loadEmployee() } + const submitRttPayment = async (month: number, minutes: number, rate: '25' | '50') => { + if (!employee.value) return + const year = rttSummary.value?.year ?? undefined + await createRttPayment(employee.value.id, month, minutes, rate, year) + await loadEmployee() + } + watch(requiresCreateContractEndDate, (required) => { if (!required) { createContractForm.endDate = '' @@ -358,6 +365,7 @@ export const useEmployeeDetailPage = () => { setCreateContractDrawerOpen, submitContractUpdate, submitCreateContract, - submitFractionedDays + submitFractionedDays, + submitRttPayment } } diff --git a/frontend/layouts/default.vue b/frontend/layouts/default.vue index aca253c..da6556c 100644 --- a/frontend/layouts/default.vue +++ b/frontend/layouts/default.vue @@ -9,52 +9,64 @@ Heures