Merge branch 'dev' into beta

This commit is contained in:
2025-02-11 19:23:58 +01:00
8 changed files with 48 additions and 19 deletions

View File

@@ -8,14 +8,14 @@ const _useDashboard = () => {
defineShortcuts({ defineShortcuts({
'g-h': () => router.push('/'), 'g-h': () => router.push('/'),
'g-a': () => router.push('/tasks'), 'g-a': () => router.push('/standardEntity/tasks'),
'g-d': () => router.push('/documents'), 'g-d': () => router.push('/files'),
'g-k': () => router.push('/customers'), 'g-k': () => router.push('/standardEntity/customers'),
'g-l': () => router.push('/vendors'), 'g-l': () => router.push('/standardEntity/vendors'),
'g-s': () => router.push('/settings'), 'g-s': () => router.push('/settings'),
'g-p': () => router.push('/projects'), 'g-p': () => router.push('/standardEntity/projects'),
'g-v': () => router.push('/contracts'), 'g-v': () => router.push('/standardEntity/contracts'),
'g-o': () => router.push('/plants'), 'g-o': () => router.push('/standardEntity/plants'),
'?': () => isHelpSlideoverOpen.value = !isHelpSlideoverOpen.value, '?': () => isHelpSlideoverOpen.value = !isHelpSlideoverOpen.value,
n: () => isNotificationsSlideoverOpen.value = !isNotificationsSlideoverOpen.value n: () => isNotificationsSlideoverOpen.value = !isNotificationsSlideoverOpen.value
}) })

View File

@@ -104,7 +104,7 @@ export const useFunctions = () => {
const useSendTelegramNotification = async (message) => { const useSendTelegramNotification = async (message) => {
const {data:{session:{access_token}}} = await supabase.auth.getSession() const {data:{session:{access_token}}} = await supabase.auth.getSession()
const {data} = await axios({ const {data,error} = await axios({
method: "POST", method: "POST",
url: `${baseURL}/functions/sendtelegramnotification`, url: `${baseURL}/functions/sendtelegramnotification`,
data: { data: {
@@ -114,6 +114,12 @@ export const useFunctions = () => {
Authorization: `Bearer ${access_token}` Authorization: `Bearer ${access_token}`
} }
}) })
if(error){
} else {
return true
}
} }
const useBankingCheckInstitutions = async (bic) => { const useBankingCheckInstitutions = async (bic) => {

View File

@@ -118,21 +118,26 @@ export const useCreateWorkingTimesPdf = async (input,backgroundSourceBuffer) =>
y: getCoordinatesForPDFLib(20,85,pages[pageCounter -1]).y, y: getCoordinatesForPDFLib(20,85,pages[pageCounter -1]).y,
size: 10, size: 10,
}) })
pages[pageCounter - 1].drawText(`Soll Stunden: ${Math.floor(input.timeSpanWorkingMinutes/60)}:${String(input.timeSpanWorkingMinutes % 60).padStart(2,"0")} Std`,{ pages[pageCounter - 1].drawText(`Krankheitsausgleich: ${Math.floor(input.sumWorkingMinutesSickDays/60)}:${String(input.sumWorkingMinutesSickDays % 60).padStart(2,"0")} Std`,{
x: getCoordinatesForPDFLib(20,90,pages[pageCounter -1]).x, x: getCoordinatesForPDFLib(20,90,pages[pageCounter -1]).x,
y: getCoordinatesForPDFLib(20,90,pages[pageCounter -1]).y, y: getCoordinatesForPDFLib(20,90,pages[pageCounter -1]).y,
size: 10, size: 10,
}) })
pages[pageCounter - 1].drawText(`Inoffizielles Saldo: ${Math.sign(input.saldoInOfficial) === 1 ? "" : "-"}${Math.floor(Math.abs(input.saldoInOfficial/60))}:${String(Math.abs(input.saldoInOfficial) % 60).padStart(2,"0")} Std`,{ pages[pageCounter - 1].drawText(`Soll Stunden: ${Math.floor(input.timeSpanWorkingMinutes/60)}:${String(input.timeSpanWorkingMinutes % 60).padStart(2,"0")} Std`,{
x: getCoordinatesForPDFLib(20,95,pages[pageCounter -1]).x, x: getCoordinatesForPDFLib(20,95,pages[pageCounter -1]).x,
y: getCoordinatesForPDFLib(20,95,pages[pageCounter -1]).y, y: getCoordinatesForPDFLib(20,95,pages[pageCounter -1]).y,
size: 10, size: 10,
}) })
pages[pageCounter - 1].drawText(`Saldo: ${Math.sign(input.saldo) === 1 ? "" : "-"}${Math.floor(Math.abs(input.saldo/60))}:${String(Math.abs(input.saldo) % 60).padStart(2,"0")} Std`,{ pages[pageCounter - 1].drawText(`Inoffizielles Saldo: ${Math.sign(input.saldoInOfficial) === 1 ? "+" : "-"} ${Math.floor(Math.abs(input.saldoInOfficial/60))}:${String(Math.abs(input.saldoInOfficial) % 60).padStart(2,"0")} Std`,{
x: getCoordinatesForPDFLib(20,100,pages[pageCounter -1]).x, x: getCoordinatesForPDFLib(20,100,pages[pageCounter -1]).x,
y: getCoordinatesForPDFLib(20,100,pages[pageCounter -1]).y, y: getCoordinatesForPDFLib(20,100,pages[pageCounter -1]).y,
size: 10, size: 10,
}) })
pages[pageCounter - 1].drawText(`Saldo: ${Math.sign(input.saldo) === 1 ? "+" : "-"} ${Math.floor(Math.abs(input.saldo/60))}:${String(Math.abs(input.saldo) % 60).padStart(2,"0")} Std`,{
x: getCoordinatesForPDFLib(20,105,pages[pageCounter -1]).x,
y: getCoordinatesForPDFLib(20,105,pages[pageCounter -1]).y,
size: 10,
})
pages[pageCounter - 1].drawText(`Start:`,{ pages[pageCounter - 1].drawText(`Start:`,{
x: getCoordinatesForPDFLib(20,110,pages[pageCounter -1]).x, x: getCoordinatesForPDFLib(20,110,pages[pageCounter -1]).x,
@@ -178,8 +183,6 @@ export const useCreateWorkingTimesPdf = async (input,backgroundSourceBuffer) =>
}) })
uri.value = await pdfDoc.saveAsBase64({dataUri: true}) uri.value = await pdfDoc.saveAsBase64({dataUri: true})
} }

View File

@@ -33,7 +33,9 @@ const addMessage = async () => {
toast.add({title: "Erstellen erfolgreich"}) toast.add({title: "Erstellen erfolgreich"})
messageContent.value="" messageContent.value=""
setup() setup()
await useFunctions().useSendTelegramNotification(`Neue Nachricht im Ticket ${useRoute().params.id} von ${profileStore.activeProfile.fullName}: ${data.content}`) if(profileStore.currentTenant !== 5) {
await useFunctions().useSendTelegramNotification(`Neue Nachricht im Ticket ${useRoute().params.id} von ${profileStore.activeProfile.fullName}: ${data.content}`)
}
} }
} }
@@ -60,6 +62,18 @@ const addEntry = async () => {
} }
} }
const closeTicket = async () => {
const {data, error} = await supabase.from("tickets").update({status: "Geschlossen"}).eq("id",useRoute().params.id).single()
if(error) {
console.log(error)
} else {
console.log(data)
}
setup()
}
</script> </script>
<template> <template>
@@ -80,7 +94,7 @@ const addEntry = async () => {
<UButton <UButton
v-if="profileStore.currentTenant === 5" v-if="profileStore.currentTenant === 5"
variant="outline" variant="outline"
disabled @click="closeTicket"
> >
Ticket Schließen Ticket Schließen
</UButton> </UButton>

View File

@@ -32,8 +32,9 @@ const createTicket = async () => {
if(messageError) { if(messageError) {
console.log(messageError) console.log(messageError)
} else { } else {
console.log(ticketData)
useFunctions().useSendTelegramNotification(`Ticket von ${profileStore.activeProfile.fullName} erstellt : ${itemInfo.value.content}`)
router.push(`/support/${ticketData.id}`) router.push(`/support/${ticketData.id}`)
await useFunctions().useSendTelegramNotification(`Ticket von ${profileStore.activeProfile.fullName} erstellt : ${itemInfo.value.content}`)
} }
} }
} }

View File

@@ -34,11 +34,15 @@ setup()
:rows="tickets" :rows="tickets"
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: `Keine Tickets anzuzeigen` }" :empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: `Keine Tickets anzuzeigen` }"
@select="(i) => router.push(`/support/${i.id}`)" @select="(i) => router.push(`/support/${i.id}`)"
:columns="[{key:'created_at',label:'Datum'}, ...profileStore.currentTenant === 5 ? [{key:'tenant',label:'Tenant'}] : [],{key:'title',label:'Titel'},{key:'created_by',label:'Ersteller'},{key:'ticketmessages',label:'Nachrichten'}]" :columns="[{key:'created_at',label:'Datum'}, ...profileStore.currentTenant === 5 ? [{key:'tenant',label:'Tenant'}] : [],{key:'status',label:'Status'},{key:'title',label:'Titel'},{key:'created_by',label:'Ersteller'},{key:'ticketmessages',label:'Nachrichten'}]"
> >
<template #tenant-data="{ row }"> <template #tenant-data="{ row }">
{{row.tenant.name}} {{row.tenant.name}}
</template> </template>
<template #status-data="{ row }">
<span v-if="row.status === 'Offen'" class="text-yellow-500">Offen</span>
<span v-else-if="row.status === 'Geschlossen'" class="text-primary">Geschlossen</span>
</template>
<template #created_by-data="{ row }"> <template #created_by-data="{ row }">
{{row.created_by.fullName}} {{row.created_by.fullName}}
</template> </template>

View File

@@ -337,6 +337,7 @@ changeRange()
<p>Genehmigt: {{Math.floor(workingTimeInfo.sumWorkingMinutesApproved/60)}}:{{String(workingTimeInfo.sumWorkingMinutesApproved % 60).padStart(2,"0")}} h</p> <p>Genehmigt: {{Math.floor(workingTimeInfo.sumWorkingMinutesApproved/60)}}:{{String(workingTimeInfo.sumWorkingMinutesApproved % 60).padStart(2,"0")}} h</p>
<p>Feiertagsausgleich: {{Math.floor(workingTimeInfo.sumWorkingMinutesRecreationDays/60)}}:{{String(workingTimeInfo.sumWorkingMinutesRecreationDays % 60).padStart(2,"0")}} h / {{workingTimeInfo.sumRecreationDays}} Tage</p> <p>Feiertagsausgleich: {{Math.floor(workingTimeInfo.sumWorkingMinutesRecreationDays/60)}}:{{String(workingTimeInfo.sumWorkingMinutesRecreationDays % 60).padStart(2,"0")}} h / {{workingTimeInfo.sumRecreationDays}} Tage</p>
<p>Urlaubs-/Berufsschulausgleich: {{Math.floor(workingTimeInfo.sumWorkingMinutesVacationDays/60)}}:{{String(workingTimeInfo.sumWorkingMinutesVacationDays % 60).padStart(2,"0")}} h / {{workingTimeInfo.sumVacationDays}} Tage</p> <p>Urlaubs-/Berufsschulausgleich: {{Math.floor(workingTimeInfo.sumWorkingMinutesVacationDays/60)}}:{{String(workingTimeInfo.sumWorkingMinutesVacationDays % 60).padStart(2,"0")}} h / {{workingTimeInfo.sumVacationDays}} Tage</p>
<p>Krankheitsausgleich: {{Math.floor(workingTimeInfo.sumWorkingMinutesSickDays/60)}}:{{String(workingTimeInfo.sumWorkingMinutesSickDays % 60).padStart(2,"0")}} h / {{workingTimeInfo.sumSickDays}} Tage</p>
<p>Soll Stunden: {{Math.floor(workingTimeInfo.timeSpanWorkingMinutes/60)}}:{{String(workingTimeInfo.timeSpanWorkingMinutes % 60 ).padStart(2,"0")}} h</p> <p>Soll Stunden: {{Math.floor(workingTimeInfo.timeSpanWorkingMinutes/60)}}:{{String(workingTimeInfo.timeSpanWorkingMinutes % 60 ).padStart(2,"0")}} h</p>
<!-- <p>Abwesend: </p> <!-- <p>Abwesend: </p>

View File

@@ -537,8 +537,8 @@ export const useDataStore = defineStore('data', () => {
showTabs: [{label: 'Informationen'},{label: 'Dateien'}] showTabs: [{label: 'Informationen'},{label: 'Dateien'}]
}, },
absencerequests: { absencerequests: {
label: "Abwesenheitsanträge", label: "Abwesenheiten",
labelSingle: "Abwesenheitsantrag", labelSingle: "Abwesenheit",
isStandardEntity: true, isStandardEntity: true,
supabaseSortColumn:"startDate", supabaseSortColumn:"startDate",
supabaseSortAscending: false, supabaseSortAscending: false,