Changes in Dashboard Display
Added Project Card Commented Graph Card
This commit is contained in:
@@ -6,18 +6,16 @@ let draftInvoicesSum = ref(0)
|
|||||||
let draftInvoicesCount = ref(0)
|
let draftInvoicesCount = ref(0)
|
||||||
let unallocatedStatements = ref(0)
|
let unallocatedStatements = ref(0)
|
||||||
const setupPage = async () => {
|
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 draftDocuments = documents.filter(i => i.state === "Entwurf")
|
||||||
let finalizedDocuments = documents.filter(i => i.state === "Gebucht")
|
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 = finalizedDocuments.filter(i => i.statementallocations.reduce((n,{amount}) => n + amount, 0).toFixed(2) !== getDocumentSum(i).toFixed(2))
|
||||||
|
|
||||||
finalizedDocuments.forEach(i => {
|
finalizedDocuments.forEach(i => {
|
||||||
console.log(getDocumentSum(i))
|
|
||||||
unpaidInvoicesSum.value += getDocumentSum(i) - i.statementallocations.reduce((n,{amount}) => n + amount, 0)
|
unpaidInvoicesSum.value += getDocumentSum(i) - i.statementallocations.reduce((n,{amount}) => n + amount, 0)
|
||||||
})
|
})
|
||||||
unpaidInvoicesCount.value = finalizedDocuments.length
|
unpaidInvoicesCount.value = finalizedDocuments.length
|
||||||
|
|||||||
43
components/displayProjectsInPhases.vue
Normal file
43
components/displayProjectsInPhases.vue
Normal 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>
|
||||||
@@ -13,27 +13,33 @@
|
|||||||
</template>
|
</template>
|
||||||
</UDashboardNavbar>
|
</UDashboardNavbar>
|
||||||
|
|
||||||
<UDashboardPanelContent>
|
<UDashboardPanelContent class="flex flex-row">
|
||||||
<UDashboardCard
|
<UDashboardCard
|
||||||
class="mt-3"
|
class="w-1/3 h-fit mx-2 mt-3"
|
||||||
title="Anwesenheiten"
|
title="Anwesenheiten"
|
||||||
>
|
>
|
||||||
<display-present-profiles/>
|
<display-present-profiles/>
|
||||||
</UDashboardCard>
|
</UDashboardCard>
|
||||||
|
|
||||||
|
|
||||||
<UDashboardCard
|
<!-- <UDashboardCard
|
||||||
class="mt-3"
|
class="mt-3"
|
||||||
>
|
>
|
||||||
<display-income-and-expenditure/>
|
<display-income-and-expenditure/>
|
||||||
</UDashboardCard>
|
</UDashboardCard>-->
|
||||||
<UDashboardCard
|
<UDashboardCard
|
||||||
class="w-1/3 mt-3"
|
class="w-1/3 h-fit mx-2 mt-3"
|
||||||
>
|
>
|
||||||
<display-open-balances/>
|
<display-open-balances/>
|
||||||
</UDashboardCard>
|
</UDashboardCard>
|
||||||
<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/>
|
<display-running-time/>
|
||||||
</UDashboardCard>
|
</UDashboardCard>
|
||||||
|
|||||||
Reference in New Issue
Block a user