Changes in Dashboard Display

Added Project Card
Commented Graph Card
This commit is contained in:
2025-01-24 15:25:16 +01:00
parent 0bd894a61b
commit 7dcddba401
3 changed files with 56 additions and 9 deletions

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

@@ -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>