diff --git a/frontend/pages/employees/index.vue b/frontend/pages/employees/index.vue
index d79eb47..523e3ae 100644
--- a/frontend/pages/employees/index.vue
+++ b/frontend/pages/employees/index.vue
@@ -240,6 +240,21 @@
/>
+
+ { if (v !== null) exportYear = Number(v) }"
+ />
+
+
+
('')
+const exportChoice = ref<'leave-recap' | 'salary-recap' | 'yearly-hours' | 'night-contingent' | 'overtime-contingent' | ''>('')
const exportYear = ref(new Date().getFullYear())
const exportMonth = ref(new Date().getMonth() + 1)
const exportSalaryMonth = ref(`${new Date().getFullYear()}-${String(new Date().getMonth() + 1).padStart(2, '0')}`)
+const exportSiteIds = ref([])
const exportTypeOptions = [
{ label: 'Récap. congés', value: 'leave-recap' },
{ label: 'Récap. salaire', value: 'salary-recap' },
{ label: 'Heures annuelles', value: 'yearly-hours' },
- { label: 'Contingent H.nuit', value: 'night-contingent' }
+ { label: 'Contingent H.nuit', value: 'night-contingent' },
+ { label: 'Contingent H.supp.', value: 'overtime-contingent' }
]
const exportYearOptions = computed(() => {
const current = new Date().getFullYear()
@@ -315,11 +332,14 @@ const isExportValid = computed(() => {
if (exportChoice.value === 'night-contingent') {
return exportYear.value > 0
}
+ if (exportChoice.value === 'overtime-contingent') {
+ return exportYear.value > 0
+ }
return true
})
const onExportChoiceChange = (value: string | number | null) => {
- exportChoice.value = (value === null ? '' : String(value)) as 'leave-recap' | 'salary-recap' | 'yearly-hours' | 'night-contingent' | ''
+ exportChoice.value = (value === null ? '' : String(value)) as 'leave-recap' | 'salary-recap' | 'yearly-hours' | 'night-contingent' | 'overtime-contingent' | ''
}
const { printPdf } = usePdfPrinter()
const sitesInitialized = ref(false)
@@ -619,6 +639,7 @@ const openExportDrawer = () => {
exportYear.value = now.getFullYear()
exportMonth.value = now.getMonth() + 1
exportSalaryMonth.value = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}`
+ exportSiteIds.value = []
isExportDrawerOpen.value = true
}
@@ -634,6 +655,9 @@ const handleExportValidate = async () => {
await printPdf(`/yearly-hours/print-all?year=${exportYear.value}&month=${exportMonth.value}`)
} else if (choice === 'night-contingent') {
await printPdf(`/night-hours-contingent/print?year=${exportYear.value}`)
+ } else if (choice === 'overtime-contingent') {
+ const siteParam = exportSiteIds.value.length > 0 ? `&siteIds=${exportSiteIds.value.join(',')}` : ''
+ await printPdf(`/overtime-contingent/print?year=${exportYear.value}${siteParam}`)
}
}