Merge branch 'dev' into beta

This commit is contained in:
2025-01-24 15:26:00 +01:00
7 changed files with 133 additions and 16 deletions

View File

@@ -201,6 +201,7 @@ const resetContactRequest = () => {
<InputGroup class="mt-3">
<UButton
type="submit"
:disabled="!contactRequestData.title || !contactRequestData.message"
>
Senden
</UButton>
@@ -208,6 +209,7 @@ const resetContactRequest = () => {
type="reset"
color="rose"
variant="outline"
:disabled="!contactRequestData.title && !contactRequestData.message"
>
Zurücksetzen
</UButton>

View File

@@ -0,0 +1,14 @@
<script setup>
const props = defineProps({
row: {
type: Object,
required: true,
default: {}
}
})
</script>
<template>
<span v-if="props.row.phases && props.row.phases.length > 0">{{props.row.phases.find(i => i.active).label}}</span>
</template>

View File

@@ -6,18 +6,16 @@ let draftInvoicesSum = ref(0)
let draftInvoicesCount = ref(0)
let unallocatedStatements = ref(0)
const setupPage = async () => {
let documents = (await useSupabaseSelect("createddocuments","*, statementallocations(*), customer(id,name)")).filter(i => i.type === "invoices" ||i.type === "advanceInvoices").filter(i => !i.archived)
let documents = (await useSupabaseSelect("createddocuments","*, statementallocations(*), customer(id,name)")).filter(i => i.type === "invoices" ||i.type === "advanceInvoices"||i.type === "cancellationInvoices").filter(i => !i.archived)
let draftDocuments = documents.filter(i => i.state === "Entwurf")
let finalizedDocuments = documents.filter(i => i.state === "Gebucht")
console.log(finalizedDocuments)
finalizedDocuments = finalizedDocuments.filter(i => i.statementallocations.reduce((n,{amount}) => n + amount, 0).toFixed(2) !== getDocumentSum(i).toFixed(2))
finalizedDocuments.forEach(i => {
console.log(getDocumentSum(i))
unpaidInvoicesSum.value += getDocumentSum(i) - i.statementallocations.reduce((n,{amount}) => n + amount, 0)
})
unpaidInvoicesCount.value = finalizedDocuments.length

View File

@@ -0,0 +1,43 @@
<script setup>
const phasesCounter = ref({})
const setupPage = async () => {
const projects = await useSupabaseSelect("projects")
projects.forEach(project => {
if(project.phases && project.phases.length > 0){
let activePhase = project.phases.find(p => p.active)
if(phasesCounter.value[activePhase.label]) {
phasesCounter.value[activePhase.label] += 1
} else {
phasesCounter.value[activePhase.label] = 1
}
} else {
if(phasesCounter.value.none) {
phasesCounter.value.none += 1
} else {
phasesCounter.value.none = 1
}
}
})
}
setupPage()
</script>
<template>
<table class="w-full">
<tr v-for="label in Object.keys(phasesCounter)">
<td>{{label}}</td>
<td>{{ phasesCounter[label] }} Stk</td>
</tr>
</table>
</template>
<style scoped>
</style>

View File

@@ -68,11 +68,50 @@ const openEmail = () => {
:to="dataStore.documents.find(i => i.createdDocument === itemInfo.id) ? dataStore.documents.find(i => i.createdDocument === itemInfo.id).url : ''"
target="_blank"
>In neuen Tab anzeigen</UButton>-->
<UButton
@click="router.push(`/createDocument/edit/?linkedDocument=${itemInfo.id}`)"
<UTooltip
text="Übernehmen in Angebot"
>
Übernehmen
</UButton>
<UButton
icon="i-heroicons-arrow-right-end-on-rectangle"
@click="router.push(`/createDocument/edit/?linkedDocument=${itemInfo.id}&type=quotes`)"
variant="outline"
>
Angebot
</UButton>
</UTooltip>
<UTooltip
text="Übernehmen in Auftragsbestätigung"
>
<UButton
icon="i-heroicons-arrow-right-end-on-rectangle"
@click="router.push(`/createDocument/edit/?linkedDocument=${itemInfo.id}&type=confirmationOrders`)"
variant="outline"
>
Auftragsbestätigung
</UButton>
</UTooltip>
<UTooltip
text="Übernehmen in Lieferschein"
>
<UButton
icon="i-heroicons-arrow-right-end-on-rectangle"
@click="router.push(`/createDocument/edit/?linkedDocument=${itemInfo.id}&type=deliveryNotes`)"
variant="outline"
>
Lieferschein
</UButton>
</UTooltip>
<UTooltip
text="Übernehmen in Rechnung"
>
<UButton
icon="i-heroicons-arrow-right-end-on-rectangle"
@click="router.push(`/createDocument/edit/?linkedDocument=${itemInfo.id}&type=invoices`)"
variant="outline"
>
Rechnung
</UButton>
</UTooltip>
<UButton
@click="openEmail"
icon="i-heroicons-envelope"
@@ -83,17 +122,26 @@ const openEmail = () => {
@click="router.push(`/createDocument/edit/?linkedDocument=${itemInfo.id}&loadMode=storno`)"
variant="outline"
color="rose"
v-if="itemInfo.type === 'invoices' || itemInfo.type === 'advanceInvoices'"
>
Stornieren
</UButton>
<UButton
v-if="itemInfo.project"
@click="router.push(`/standardEntity/projects/show/${itemInfo.project}`)"
icon="i-heroicons-arrow-right-end-on-rectangle"
icon="i-heroicons-link"
variant="outline"
>
Projekt
</UButton>
<UButton
v-if="itemInfo.customer"
@click="router.push(`/standardEntity/customers/show/${itemInfo.customer}`)"
icon="i-heroicons-link"
variant="outline"
>
Kunde
</UButton>
</template>
</UDashboardToolbar>

View File

@@ -13,27 +13,33 @@
</template>
</UDashboardNavbar>
<UDashboardPanelContent>
<UDashboardPanelContent class="flex flex-row">
<UDashboardCard
class="mt-3"
class="w-1/3 h-fit mx-2 mt-3"
title="Anwesenheiten"
>
<display-present-profiles/>
</UDashboardCard>
<UDashboardCard
<!-- <UDashboardCard
class="mt-3"
>
<display-income-and-expenditure/>
</UDashboardCard>
</UDashboardCard>-->
<UDashboardCard
class="w-1/3 mt-3"
class="w-1/3 h-fit mx-2 mt-3"
>
<display-open-balances/>
</UDashboardCard>
<UDashboardCard
class="w-1/3 mt-3"
class="w-1/3 h-fit mx-2 mt-3"
title="Projekte"
>
<display-projects-in-phases/>
</UDashboardCard>
<UDashboardCard
class="w-1/3 h-fit mx-2 mt-3"
>
<display-running-time/>
</UDashboardCard>

View File

@@ -31,6 +31,7 @@ import sellingPriceComposedTotal from "~/components/columnRenderings/sellingPric
import startDate from "~/components/columnRenderings/startDate.vue"
import endDate from "~/components/columnRenderings/endDate.vue"
import serviceCategories from "~/components/columnRenderings/serviceCategories.vue"
import phase from "~/components/columnRenderings/phase.vue"
import quantity from "~/components/helpRenderings/quantity.vue"
import {useZipCheck} from "~/composables/useZipCheck.js";
@@ -736,7 +737,11 @@ export const useDataStore = defineStore('data', () => {
default: true,
"filterFunction": function (row) {
if(row.phases && row.phases.length > 0) {
return row.phases.find(i => i.active).label !== "Abgeschlossen";
return row.phases.find(i => i.active).label !== "Abgeschlossen"
//return phase.label !== "Abgeschlossen";
} else {
return true
}
@@ -772,7 +777,8 @@ export const useDataStore = defineStore('data', () => {
}
},{
key: "phase",
label: "Phase"
label: "Phase",
component: phase
},{
key: "name",
label: "Name",