Merge branch 'refs/heads/dev' into beta
This commit is contained in:
@@ -61,7 +61,7 @@ const router = useRouter()
|
|||||||
const createddocuments = ref([])
|
const createddocuments = ref([])
|
||||||
|
|
||||||
const setup = async () => {
|
const setup = async () => {
|
||||||
createddocuments.value = await useSupabaseSelect("createddocuments")
|
createddocuments.value = (await useSupabaseSelect("createddocuments")).filter(i => !i.archived)
|
||||||
}
|
}
|
||||||
setup()
|
setup()
|
||||||
|
|
||||||
@@ -188,9 +188,8 @@ const selectItem = (item) => {
|
|||||||
</USelectMenu>
|
</USelectMenu>
|
||||||
</template>
|
</template>
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
|
|
||||||
<UTable
|
<UTable
|
||||||
:rows="props.item.createddocuments"
|
:rows="props.item.createddocuments.filter(i => !i.archived)"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
class="w-full"
|
class="w-full"
|
||||||
:ui="{ divide: 'divide-gray-200 dark:divide-gray-800' }"
|
:ui="{ divide: 'divide-gray-200 dark:divide-gray-800' }"
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ setupPage()
|
|||||||
:inModal="true"
|
:inModal="true"
|
||||||
@return-data="(data) => emit('return-data',data)"
|
@return-data="(data) => emit('return-data',data)"
|
||||||
:createQuery="props.createQuery"
|
:createQuery="props.createQuery"
|
||||||
|
:mode="props.mode"
|
||||||
/>
|
/>
|
||||||
<!-- <EntityList
|
<!-- <EntityList
|
||||||
v-else-if="loaded && props.mode === 'list'"
|
v-else-if="loaded && props.mode === 'list'"
|
||||||
|
|||||||
55
components/displayBankaccounts.vue
Normal file
55
components/displayBankaccounts.vue
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<script setup>
|
||||||
|
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import {useSupabaseSelect} from "~/composables/useSupabase.js";
|
||||||
|
|
||||||
|
let unallocatedStatements = ref(0)
|
||||||
|
let bankaccounts = ref([])
|
||||||
|
|
||||||
|
const setupPage = async () => {
|
||||||
|
let bankstatements = (await useSupabaseSelect("bankstatements","*, statementallocations(*)","date",true)).filter(i => !i.archived)
|
||||||
|
unallocatedStatements.value = bankstatements.filter(i => Number(calculateOpenSum(i)) !== 0).length
|
||||||
|
bankaccounts.value = await useSupabaseSelect("bankaccounts")
|
||||||
|
}
|
||||||
|
|
||||||
|
setupPage()
|
||||||
|
|
||||||
|
const calculateOpenSum = (statement) => {
|
||||||
|
let startingAmount = 0
|
||||||
|
|
||||||
|
statement.statementallocations.forEach(item => {
|
||||||
|
startingAmount += item.amount
|
||||||
|
})
|
||||||
|
|
||||||
|
return (statement.amount - startingAmount).toFixed(2)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<table>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">Nicht zugewiesene Bankbuchungen:</td>
|
||||||
|
<td>
|
||||||
|
<span v-if="unallocatedStatements > 0" class="text-rose-600 font-bold">{{unallocatedStatements}}</span>
|
||||||
|
<span v-else class="text-primary-500 font-bold">0</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr v-for="account in bankaccounts.filter(i => !i.expired)">
|
||||||
|
<td>{{ account.name }}:</td>
|
||||||
|
<td>
|
||||||
|
{{dayjs(account.synced_at).format("DD.MM.YY HH:mm")}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<span v-if="account.balance < 0" class="text-rose-600 font-bold">{{useCurrency(account.balance)}}</span>
|
||||||
|
<span v-else-if="account.balance > 0" class="text-primary-500 font-bold">{{useCurrency(account.balance)}}</span>
|
||||||
|
<span v-else>{{useCurrency(account.balance)}}</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -4,7 +4,6 @@ let unpaidInvoicesSum = ref(0)
|
|||||||
let unpaidInvoicesCount = ref(0)
|
let unpaidInvoicesCount = ref(0)
|
||||||
let draftInvoicesSum = ref(0)
|
let draftInvoicesSum = ref(0)
|
||||||
let draftInvoicesCount = ref(0)
|
let draftInvoicesCount = 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"||i.type === "cancellationInvoices").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)
|
||||||
|
|
||||||
@@ -25,33 +24,10 @@ const setupPage = async () => {
|
|||||||
})
|
})
|
||||||
draftInvoicesCount.value = draftDocuments.length
|
draftInvoicesCount.value = draftDocuments.length
|
||||||
|
|
||||||
let bankstatements = (await useSupabaseSelect("bankstatements","*, statementallocations(*)","date",true)).filter(i => !i.archived)
|
|
||||||
unallocatedStatements.value = bankstatements.filter(i => Number(calculateOpenSum(i)) !== 0).length
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setupPage()
|
setupPage()
|
||||||
|
|
||||||
const calculateOpenSum = (statement) => {
|
|
||||||
/*let startingAmount = statement.amount || 0
|
|
||||||
|
|
||||||
statement.statementallocations.forEach(item => {
|
|
||||||
if(item.cd_id) {
|
|
||||||
startingAmount = startingAmount - item.amount
|
|
||||||
} else if(item.ii_id) {
|
|
||||||
startingAmount = Number(startingAmount) + item.amount
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
return startingAmount.toFixed(2)*/
|
|
||||||
|
|
||||||
let startingAmount = 0
|
|
||||||
|
|
||||||
statement.statementallocations.forEach(item => {
|
|
||||||
startingAmount += Math.abs(item.amount)
|
|
||||||
})
|
|
||||||
|
|
||||||
return (Math.abs(statement.amount) - startingAmount).toFixed(2)
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -72,13 +48,6 @@ const calculateOpenSum = (statement) => {
|
|||||||
>{{draftInvoicesCount}} Stk / {{useCurrency(draftInvoicesSum)}}</td>
|
>{{draftInvoicesCount}} Stk / {{useCurrency(draftInvoicesSum)}}</td>
|
||||||
<td v-else class="text-primary-500 font-bold text-no-wrap">0 Stk / 0,00€</td>
|
<td v-else class="text-primary-500 font-bold text-no-wrap">0 Stk / 0,00€</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td>Nicht zugewiesene Bankbuchungen:</td>
|
|
||||||
<td>
|
|
||||||
<span v-if="unallocatedStatements > 0" class="text-rose-600 font-bold">{{unallocatedStatements}}</span>
|
|
||||||
<span v-else class="text-primary-500 font-bold">0</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -103,19 +103,23 @@ const calendarOptionsTimeline = ref({
|
|||||||
views: {
|
views: {
|
||||||
resourceTimeline3Hours: {
|
resourceTimeline3Hours: {
|
||||||
type: 'resourceTimeline',
|
type: 'resourceTimeline',
|
||||||
|
duration: {weeks: 1},
|
||||||
|
weekends: false,
|
||||||
slotDuration: {hours: 3},
|
slotDuration: {hours: 3},
|
||||||
slotMinTime: "06:00:00",
|
slotMinTime: "06:00:00",
|
||||||
slotMaxTime: "21:00:00",
|
slotMaxTime: "21:00:00",
|
||||||
/*duration: {days:7},*/
|
|
||||||
buttonText: "Woche",
|
buttonText: "Woche",
|
||||||
visibleRange: function(currentDate) {
|
visibleRange: function(currentDate) {
|
||||||
// Generate a new date for manipulating in the next step
|
// Generate a new date for manipulating in the next step
|
||||||
var startDate = new Date(currentDate);
|
var startDate = new Date(currentDate.valueOf());
|
||||||
var endDate = new Date(currentDate);
|
var endDate = new Date(currentDate.valueOf());
|
||||||
|
|
||||||
// Adjust the start & end dates, respectively
|
// Adjust the start & end dates, respectively
|
||||||
startDate.setDate(startDate.getDate() - startDate.getDay() +1); // One day in the past
|
|
||||||
endDate.setDate(startDate.getDate() + 5); // Two days into the future
|
console.log(startDate.getDay())
|
||||||
|
|
||||||
|
startDate.setDate(startDate.getDate() - 1); // One day in the past
|
||||||
|
endDate.setDate(endDate.getDate() + 2); // Two days into the future
|
||||||
|
|
||||||
return { start: startDate, end: endDate };
|
return { start: startDate, end: endDate };
|
||||||
}
|
}
|
||||||
@@ -249,8 +253,8 @@ const setupPage = async () => {
|
|||||||
let returnData = {
|
let returnData = {
|
||||||
title: title,
|
title: title,
|
||||||
borderColor: eventColor,
|
borderColor: eventColor,
|
||||||
textColor: eventColor,
|
textColor: "white",
|
||||||
backgroundColor: "black",
|
backgroundColor: eventColor,
|
||||||
start: event.startDate,
|
start: event.startDate,
|
||||||
end: event.endDate,
|
end: event.endDate,
|
||||||
resourceIds: [],
|
resourceIds: [],
|
||||||
@@ -292,10 +296,11 @@ const setupPage = async () => {
|
|||||||
absencerequests.forEach(absencerequest => {
|
absencerequests.forEach(absencerequest => {
|
||||||
let returnData = {
|
let returnData = {
|
||||||
title: `${absencerequest.reason}`,
|
title: `${absencerequest.reason}`,
|
||||||
backgroundColor: "black",
|
backgroundColor: "red",
|
||||||
|
borderColor: "red",
|
||||||
start: absencerequest.startDate,
|
start: absencerequest.startDate,
|
||||||
end: absencerequest.endDate,
|
end: absencerequest.endDate,
|
||||||
resourceIds: [absencerequest.profile.id],
|
resourceIds: [`P-${absencerequest.profile.id}`],
|
||||||
entrytype: "absencerequest",
|
entrytype: "absencerequest",
|
||||||
allDay: true,
|
allDay: true,
|
||||||
absencerequestId: absencerequest.id
|
absencerequestId: absencerequest.id
|
||||||
@@ -304,8 +309,12 @@ const setupPage = async () => {
|
|||||||
tempEvents.push(returnData)
|
tempEvents.push(returnData)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log(tempEvents)
|
||||||
|
|
||||||
calendarOptionsTimeline.value.initialEvents = tempEvents
|
calendarOptionsTimeline.value.initialEvents = tempEvents
|
||||||
|
|
||||||
|
console.log(calendarOptionsTimeline.value)
|
||||||
|
|
||||||
loaded.value = true
|
loaded.value = true
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,10 +116,10 @@
|
|||||||
<span v-if="row.documentDate">{{row.documentDate ? dayjs(row.documentDate).format("DD.MM.YY") : ''}}</span>
|
<span v-if="row.documentDate">{{row.documentDate ? dayjs(row.documentDate).format("DD.MM.YY") : ''}}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #dueDate-data="{row}">
|
<template #dueDate-data="{row}">
|
||||||
<span v-if="row.paymentDays && ['invoices','advanceInvoices'].includes(row.type)" :class="dayjs(row.documentDate).add(row.paymentDays,'day').diff(dayjs()) <= 0 && !isPaid(row) ? ['text-rose-500'] : '' ">{{row.documentDate ? dayjs(row.documentDate).add(row.paymentDays,'day').format("DD.MM.YY") : ''}}</span>
|
<span v-if="row.state === 'Gebucht' && row.paymentDays && ['invoices','advanceInvoices'].includes(row.type)" :class="dayjs(row.documentDate).add(row.paymentDays,'day').diff(dayjs()) <= 0 && !isPaid(row) ? ['text-rose-500'] : '' ">{{row.documentDate ? dayjs(row.documentDate).add(row.paymentDays,'day').format("DD.MM.YY") : ''}}</span>
|
||||||
</template>
|
</template>
|
||||||
<template #paid-data="{row}">
|
<template #paid-data="{row}">
|
||||||
<div v-if="row.type === 'invoices' ||row.type === 'advanceInvoices'">
|
<div v-if="(row.type === 'invoices' ||row.type === 'advanceInvoices') && row.state === 'Gebucht'">
|
||||||
<span v-if="isPaid(row)" class="text-primary-500">Bezahlt</span>
|
<span v-if="isPaid(row)" class="text-primary-500">Bezahlt</span>
|
||||||
<span v-else class="text-rose-600">Offen</span>
|
<span v-else class="text-rose-600">Offen</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -27,6 +27,12 @@
|
|||||||
>
|
>
|
||||||
<display-open-balances/>
|
<display-open-balances/>
|
||||||
</UDashboardCard>
|
</UDashboardCard>
|
||||||
|
<UDashboardCard
|
||||||
|
title="Bank"
|
||||||
|
v-if="profileStore.ownTenant.features.accounting"
|
||||||
|
>
|
||||||
|
<display-bankaccounts/>
|
||||||
|
</UDashboardCard>
|
||||||
<UDashboardCard
|
<UDashboardCard
|
||||||
title="Projekte"
|
title="Projekte"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ export const useProfileStore = defineStore('profile', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function fetchOwnProfiles () {
|
async function fetchOwnProfiles () {
|
||||||
let profiles = (await supabase.from("profiles").select().order("fullName")).data
|
let profiles = (await supabase.from("profiles").select().order("tenant")).data
|
||||||
let conns = (await supabase.from("profileconnections").select()).data.map(i => i.profile_id)
|
let conns = (await supabase.from("profileconnections").select()).data.map(i => i.profile_id)
|
||||||
ownProfiles.value = profiles.filter(i => conns.includes(i.id))
|
ownProfiles.value = profiles.filter(i => conns.includes(i.id))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user