From e21e46b2c8c207bcf3096ba2ddc38a81e54af79f Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Mon, 14 Apr 2025 19:06:19 +0200 Subject: [PATCH 1/9] Changed Open Sum Calc in displayOpenBalances.vue --- components/displayOpenBalances.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/displayOpenBalances.vue b/components/displayOpenBalances.vue index 73c6297..2f0fa12 100644 --- a/components/displayOpenBalances.vue +++ b/components/displayOpenBalances.vue @@ -47,10 +47,10 @@ const calculateOpenSum = (statement) => { let startingAmount = 0 statement.statementallocations.forEach(item => { - startingAmount += Math.abs(item.amount) + startingAmount += item.amount }) - return (Math.abs(statement.amount) - startingAmount).toFixed(2) + return (statement.amount - startingAmount).toFixed(2) } From 93b36be42cac8c8abc79db691938838de801df4f Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Wed, 16 Apr 2025 12:44:06 +0200 Subject: [PATCH 2/9] Displaying correction Fixed Week selector --- pages/calendar/[mode].vue | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/pages/calendar/[mode].vue b/pages/calendar/[mode].vue index 58a47b5..c8dad04 100644 --- a/pages/calendar/[mode].vue +++ b/pages/calendar/[mode].vue @@ -103,19 +103,23 @@ const calendarOptionsTimeline = ref({ views: { resourceTimeline3Hours: { type: 'resourceTimeline', + duration: {weeks: 1}, + weekends: false, slotDuration: {hours: 3}, slotMinTime: "06:00:00", slotMaxTime: "21:00:00", - /*duration: {days:7},*/ buttonText: "Woche", visibleRange: function(currentDate) { // Generate a new date for manipulating in the next step - var startDate = new Date(currentDate); - var endDate = new Date(currentDate); + var startDate = new Date(currentDate.valueOf()); + var endDate = new Date(currentDate.valueOf()); // 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 }; } @@ -249,8 +253,8 @@ const setupPage = async () => { let returnData = { title: title, borderColor: eventColor, - textColor: eventColor, - backgroundColor: "black", + textColor: "white", + backgroundColor: eventColor, start: event.startDate, end: event.endDate, resourceIds: [], @@ -292,10 +296,11 @@ const setupPage = async () => { absencerequests.forEach(absencerequest => { let returnData = { title: `${absencerequest.reason}`, - backgroundColor: "black", + backgroundColor: "red", + borderColor: "red", start: absencerequest.startDate, end: absencerequest.endDate, - resourceIds: [absencerequest.profile.id], + resourceIds: [`P-${absencerequest.profile.id}`], entrytype: "absencerequest", allDay: true, absencerequestId: absencerequest.id @@ -304,8 +309,12 @@ const setupPage = async () => { tempEvents.push(returnData) }) + console.log(tempEvents) + calendarOptionsTimeline.value.initialEvents = tempEvents + console.log(calendarOptionsTimeline.value) + loaded.value = true } From 6049fcbb1b0177452b26f59cfc5be1d7a7f241f4 Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Wed, 16 Apr 2025 12:44:14 +0200 Subject: [PATCH 3/9] Added Tenant sorting --- stores/profile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stores/profile.js b/stores/profile.js index 9d0c401..458e7ab 100644 --- a/stores/profile.js +++ b/stores/profile.js @@ -116,7 +116,7 @@ export const useProfileStore = defineStore('profile', () => { } 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) ownProfiles.value = profiles.filter(i => conns.includes(i.id)) } From b9cd79cabe6f859b004c1081629801d9223434e5 Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Thu, 17 Apr 2025 13:47:05 +0200 Subject: [PATCH 4/9] Fixed Mode in StandardEntityModal.vue --- components/StandardEntityModal.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/StandardEntityModal.vue b/components/StandardEntityModal.vue index 173634a..0583e5f 100644 --- a/components/StandardEntityModal.vue +++ b/components/StandardEntityModal.vue @@ -63,6 +63,7 @@ setupPage()