KI-AGENT: Positive Kontobuchungen mit BWA-Ausgaben verrechnen
All checks were successful
Build and Push Docker Images / build-backend (push) Successful in 21s
Build and Push Docker Images / build-frontend (push) Successful in 1m10s
Build and Push Docker Images / build-website (push) Successful in 22s
Build and Push Docker Images / build-central-services-api (push) Successful in 22s
Build and Push Docker Images / build-central-services-admin (push) Successful in 21s
Build and Push Docker Images / build-docs (push) Successful in 1m20s

This commit is contained in:
2026-09-07 20:50:24 +02:00
parent e4fcd79c8e
commit b89fdedeae
3 changed files with 23 additions and 19 deletions

View File

@@ -7,7 +7,8 @@ import {
import {
getIncomingInvoiceDepreciationRows,
getIncomingInvoiceImmediateExpenseNet,
getStatementAllocationImmediateExpenseAmount
getStatementAllocationImmediateExpenseAmount,
getStatementAllocationImmediateExpenseImpact
} from "~/composables/useDepreciation"
const loading = ref(true)
@@ -72,16 +73,12 @@ const loadSummary = async () => {
return date.isValid() && !date.isBefore(bounds.start, "day") && !date.isAfter(bounds.end, "day")
})
const directExpenses = (allocations || []).filter((allocation: any) => {
if (allocation?.account === null || typeof allocation?.account === "undefined") {
return false
}
const directAccountAllocations = (allocations || []).filter((allocation: any) => {
const statementDate = allocation?.bankstatement?.date || allocation?.bankstatement?.valueDate || allocation?.date || allocation?.created_at
const date = dayjs(statementDate)
const amount = getStatementAllocationImmediateExpenseAmount(allocation)
const impact = getStatementAllocationImmediateExpenseImpact(allocation)
return amount > 0 && date.isValid() && !date.isBefore(bounds.start, "day") && !date.isAfter(bounds.end, "day")
return impact !== 0 && date.isValid() && !date.isBefore(bounds.start, "day") && !date.isAfter(bounds.end, "day")
})
const income = outputDocs.reduce((sum: number, doc: any) => {
@@ -102,8 +99,8 @@ const loadSummary = async () => {
return sum + getIncomingInvoiceImmediateExpenseNet(invoice)
}, 0)
const directAccountExpenses = directExpenses.reduce((sum: number, allocation: any) => {
return sum + Number(getStatementAllocationImmediateExpenseAmount(allocation) || 0)
const directAccountExpenses = directAccountAllocations.reduce((sum: number, allocation: any) => {
return sum + Number(getStatementAllocationImmediateExpenseImpact(allocation) || 0)
}, 0)
const depreciationRows = [
@@ -132,7 +129,7 @@ const loadSummary = async () => {
result: Number((income - expenses).toFixed(2)),
taxBalance: Number((outputTax - inputTax).toFixed(2)),
incomeCount: outputDocs.length,
expenseCount: inputDocs.filter((invoice: any) => getIncomingInvoiceImmediateExpenseNet(invoice) > 0).length + directExpenses.filter((allocation: any) => getStatementAllocationImmediateExpenseAmount(allocation) > 0).length,
expenseCount: inputDocs.filter((invoice: any) => getIncomingInvoiceImmediateExpenseNet(invoice) > 0).length + directAccountAllocations.filter((allocation: any) => getStatementAllocationImmediateExpenseAmount(allocation) > 0).length,
depreciationCount: depreciationRows.length
}
} finally {