Fixed Accounts for new Backend

This commit is contained in:
2025-09-12 18:22:15 +02:00
parent 00d9361aad
commit a19aa47e34
2 changed files with 6 additions and 11 deletions

View File

@@ -1,7 +1,6 @@
<script setup>
import dayjs from "dayjs";
import {useSupabaseSelect} from "~/composables/useSupabase.js";
defineShortcuts({
'/': () => {
@@ -11,16 +10,14 @@ defineShortcuts({
}
})
const profileStore = useProfileStore()
const tempStore = useTempStore()
const router = useRouter()
const supabase = useSupabaseClient()
const items = ref([])
const dataLoaded = ref(false)
const setupPage = async () => {
items.value = (await supabase.from("accounts").select("*").order("number", {ascending:true})).data
items.value = await useEntities("accounts").selectSpecial()
items.value = await Promise.all(items.value.map(async (i) => {
let renderedAllocationsTemp = await renderedAllocations(i.id)
@@ -40,8 +37,8 @@ const setupPage = async () => {
const renderedAllocations = async (account) => {
let statementallocations = (await supabase.from("statementallocations").select("*, bs_id(*)").eq("account", account).eq("tenant",profileStore.currentTenant).order("created_at",{ascending: true})).data
let incominginvoices = (await useSupabaseSelect("incominginvoices", "*, vendor(*)")).filter(i => i.accounts.find(x => x.account === account))
let statementallocations = (await useEntities("statementallocations").select("*, bs_id(*)")).filter(i => i.account === account)
let incominginvoices = (await useEntities("incominginvoices").select("*, vendor(*)")).filter(i => i.accounts.find(x => x.account === account))
let tempstatementallocations = statementallocations.map(i => {
return {