Load bank booking list before suggestions
All checks were successful
Build and Push Docker Images / build-backend (push) Successful in 35s
Build and Push Docker Images / build-frontend (push) Successful in 1m56s
Build and Push Docker Images / build-website (push) Successful in 37s
Build and Push Docker Images / build-central-services-api (push) Successful in 33s
Build and Push Docker Images / build-central-services-admin (push) Successful in 34s
Build and Push Docker Images / build-docs (push) Successful in 33s

This commit is contained in:
2026-08-06 15:45:11 +02:00
parent 7677fe5d9d
commit d2e0b4ca0f

View File

@@ -27,6 +27,7 @@ const isSyncing = ref(false)
const cashbookBookingModalOpen = ref(false) const cashbookBookingModalOpen = ref(false)
const savingCashbookBooking = ref(false) const savingCashbookBooking = ref(false)
const loadingDocs = ref(true) // Startet im Ladezustand const loadingDocs = ref(true) // Startet im Ladezustand
const loadingSuggestions = ref(true)
const suggestionsModalOpen = ref(false) const suggestionsModalOpen = ref(false)
const selectedSuggestionRowId = ref(null) const selectedSuggestionRowId = ref(null)
@@ -80,12 +81,10 @@ const setDateRangeFieldToToday = (field) => {
dateRange.value[field] = $dayjs().format('YYYY-MM-DD') dateRange.value[field] = $dayjs().format('YYYY-MM-DD')
} }
const setupPage = async () => { const loadSuggestionData = async () => {
loadingDocs.value = true loadingSuggestions.value = true
try { try {
const [statements, bankAccountItems, customerItems, vendorItems, entityBankItems, documentItems, invoiceItems] = await Promise.all([ const [customerItems, vendorItems, entityBankItems, documentItems, invoiceItems] = await Promise.all([
useEntities("bankstatements").select("*, statementallocations(*)", "valueDate", false),
useEntities("bankaccounts").select(),
useEntities("customers").select(), useEntities("customers").select(),
useEntities("vendors").select(), useEntities("vendors").select(),
useEntities("entitybankaccounts").select(), useEntities("entitybankaccounts").select(),
@@ -93,11 +92,6 @@ const setupPage = async () => {
useEntities("incominginvoices").select("*, statementallocations(*), vendor(*)") useEntities("incominginvoices").select("*, statementallocations(*), vendor(*)")
]) ])
bankstatements.value = statements
bankaccounts.value = (bankAccountItems || []).map((account) => ({
...account,
displayLabel: getBankAccountLabel(account)
}))
customers.value = customerItems customers.value = customerItems
vendors.value = vendorItems vendors.value = vendorItems
entitybankaccounts.value = entityBankItems entitybankaccounts.value = entityBankItems
@@ -115,6 +109,28 @@ const setupPage = async () => {
openIncomingInvoices.value = invoiceItems openIncomingInvoices.value = invoiceItems
.filter(i => i.state === "Gebucht" && !i.archived && i.statementallocations.reduce((n, {amount}) => n + amount, 0).toFixed(2) !== getInvoiceSum(i, false)) .filter(i => i.state === "Gebucht" && !i.archived && i.statementallocations.reduce((n, {amount}) => n + amount, 0).toFixed(2) !== getInvoiceSum(i, false))
} catch (err) {
console.error("Vorschlagsdaten konnten nicht geladen werden:", err)
} finally {
loadingSuggestions.value = false
}
}
const setupPage = async () => {
loadingDocs.value = true
const suggestionDataPromise = loadSuggestionData()
try {
const [statements, bankAccountItems] = await Promise.all([
useEntities("bankstatements").select("*, statementallocations(*)", "valueDate", false),
useEntities("bankaccounts").select()
])
bankstatements.value = statements
bankaccounts.value = (bankAccountItems || []).map((account) => ({
...account,
displayLabel: getBankAccountLabel(account)
}))
const availableAccountIds = bankaccounts.value.map((account) => account.id) const availableAccountIds = bankaccounts.value.map((account) => account.id)
if (!filterAccountInitialized.value) { if (!filterAccountInitialized.value) {
@@ -140,6 +156,8 @@ const setupPage = async () => {
} finally { } finally {
loadingDocs.value = false loadingDocs.value = false
} }
void suggestionDataPromise
} }
// Watcher für Schnellwahlen & Persistenz // Watcher für Schnellwahlen & Persistenz
@@ -586,6 +604,8 @@ onMounted(() => {
color="primary" color="primary"
variant="soft" variant="soft"
icon="i-heroicons-sparkles" icon="i-heroicons-sparkles"
:loading="loadingSuggestions"
:disabled="loadingSuggestions"
@click="suggestionsModalOpen = true" @click="suggestionsModalOpen = true"
> >
Vorschläge Vorschläge