diff --git a/components/MainNav.vue b/components/MainNav.vue index 8e19e00..f0f53e5 100644 --- a/components/MainNav.vue +++ b/components/MainNav.vue @@ -159,11 +159,11 @@ const links = computed(() => { label: "Vorgänge", to: "/inventory", icon: "i-heroicons-square-3-stack-3d" - },{ + },/*{ label: "Bestände", to: "/inventory/stocks", icon: "i-heroicons-square-3-stack-3d" - }, + },*/ ... role.checkRight("spaces") ? [{ label: "Lagerplätze", to: "/standardEntity/spaces", diff --git a/components/displayRunningTime.vue b/components/displayRunningTime.vue new file mode 100644 index 0000000..291d3d4 --- /dev/null +++ b/components/displayRunningTime.vue @@ -0,0 +1,101 @@ + + + + + \ No newline at end of file diff --git a/composables/useError.js b/composables/useError.js new file mode 100644 index 0000000..1c2e742 --- /dev/null +++ b/composables/useError.js @@ -0,0 +1,25 @@ + +export const useError = (resourceType) => { + const supabase = useSupabaseClient() + const toast = useToast() + const profileStore = useProfileStore() + + const logError = async (error) => { + let errorData = { + message: error, + tenant: profileStore.currentTenant, + profile: profileStore.activeProfile.id + } + + const {data:supabaseData,error:supabaseError} = await supabase.from("errors").insert(errorData).select().single() + + if(supabaseError) { + console.error(supabaseError) + } else if(supabaseData) { + return supabaseData.id + } + + } + + return { logError} +} diff --git a/pages/index.vue b/pages/index.vue index 54ed7ba..2353678 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -15,24 +15,29 @@

{{profileStore.getProfileById(time.profile).fullName}}

+ + +
diff --git a/pages/workingtimes/evaluate/[id].vue b/pages/workingtimes/evaluate/[id].vue index 47ea2ee..8eb7436 100644 --- a/pages/workingtimes/evaluate/[id].vue +++ b/pages/workingtimes/evaluate/[id].vue @@ -123,18 +123,24 @@ const workingTimeInfo = computed(() => { return dayjs(date).isSameOrAfter(start) && dayjs(date).isSameOrBefore(end) } - absencerequests.value.filter(i => (dayjs(i.start).isBetween(dayjs(selectedStartDay.value),dayjs(selectedEndDay.value)) || dayjs(i.end).isBetween(dayjs(selectedStartDay.value),dayjs(selectedEndDay.value)) ) && i.reason === "Urlaub" && i.approved === "Genehmigt").forEach(absenceRequest => { + absencerequests.value.filter(i => (dayjs(i.startDate).isBetween(dayjs(selectedStartDay.value),dayjs(selectedEndDay.value)) || dayjs(i.endDate).isBetween(dayjs(selectedStartDay.value),dayjs(selectedEndDay.value)) ) && (i.reason === "Urlaub" || i.reason === "Berufsschule") && i.approved === "Genehmigt").forEach(absenceRequest => { let durationInDays = 0 - if(isBetween(absenceRequest.start,selectedStartDay.value,selectedEndDay.value) && isBetween(absenceRequest.end,selectedStartDay.value,selectedEndDay.value)) { + console.log(absenceRequest) + + if(isBetween(absenceRequest.startDate,selectedStartDay.value,selectedEndDay.value) && isBetween(absenceRequest.endDate,selectedStartDay.value,selectedEndDay.value)) { //Full in Range - durationInDays = dayjs(absenceRequest.end).diff(absenceRequest.start, "days") + 1 - } else if(isBetween(absenceRequest.start,selectedStartDay.value,selectedEndDay.value) && !isBetween(absenceRequest.end,selectedStartDay.value,selectedEndDay.value)) { + console.log("Full in Range") + durationInDays = dayjs(absenceRequest.endDate).diff(absenceRequest.startDate, "days") + 1 + console.log(durationInDays) + } else if(isBetween(absenceRequest.startDate,selectedStartDay.value,selectedEndDay.value) && !isBetween(absenceRequest.endDate,selectedStartDay.value,selectedEndDay.value)) { //Start in Range - durationInDays = dayjs(selectedEndDay.value).diff(absenceRequest.start, "days") + 1 - } else if(!isBetween(absenceRequest.start,selectedStartDay.value,selectedEndDay.value) && isBetween(absenceRequest.end,selectedStartDay.value,selectedEndDay.value)) { + console.log("Start in Range") + durationInDays = dayjs(selectedEndDay.value).diff(absenceRequest.startDate, "days") + 1 + } else if(!isBetween(absenceRequest.startDate,selectedStartDay.value,selectedEndDay.value) && isBetween(absenceRequest.endDate,selectedStartDay.value,selectedEndDay.value)) { //End in Range - durationInDays = dayjs(absenceRequest.end).diff(selectedStartDay.value, "days") + 1 + console.log("End in Range") + durationInDays = dayjs(absenceRequest.endDate).diff(selectedStartDay.value, "days") + 1 } sumVacationDays += durationInDays @@ -308,7 +314,7 @@ changeRange()

Eingreicht: {{Math.floor(workingTimeInfo.sumWorkingMinutesEingereicht/60)}}:{{String(workingTimeInfo.sumWorkingMinutesEingereicht % 60).padStart(2,"0")}} h

Genehmigt: {{Math.floor(workingTimeInfo.sumWorkingMinutesApproved/60)}}:{{String(workingTimeInfo.sumWorkingMinutesApproved % 60).padStart(2,"0")}} h

Feiertagsausgleich: {{Math.floor(workingTimeInfo.sumWorkingMinutesRecreationDays/60)}}:{{String(workingTimeInfo.sumWorkingMinutesRecreationDays % 60).padStart(2,"0")}} h / {{workingTimeInfo.sumRecreationDays}} Tage

-

Urlaubsausgleich: {{Math.floor(workingTimeInfo.sumWorkingMinutesVacationDays/60)}}:{{String(workingTimeInfo.sumWorkingMinutesVacationDays % 60).padStart(2,"0")}} h / {{workingTimeInfo.sumVacationDays}} Tage

+

Urlaubs-/Berufsschulausgleich: {{Math.floor(workingTimeInfo.sumWorkingMinutesVacationDays/60)}}:{{String(workingTimeInfo.sumWorkingMinutesVacationDays % 60).padStart(2,"0")}} h / {{workingTimeInfo.sumVacationDays}} Tage

Soll Stunden: {{Math.floor(workingTimeInfo.workingMinutesTarget/60)}}:{{String(workingTimeInfo.workingMinutesTarget % 60 ).padStart(2,"0")}} h