KI-AGENT: Notizen für Bankbuchungen ergänzt
This commit is contained in:
1
backend/db/migrations/0059_bankstatement_notes.sql
Normal file
1
backend/db/migrations/0059_bankstatement_notes.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE "bankstatements" ADD COLUMN "notes" text;
|
||||
@@ -393,6 +393,13 @@
|
||||
"when": 1786023052994,
|
||||
"tag": "0058_global_reference_data",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 56,
|
||||
"version": "7",
|
||||
"when": 1786082400000,
|
||||
"tag": "0059_bankstatement_notes",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ export const bankstatements = pgTable("bankstatements", {
|
||||
credName: text("credName"),
|
||||
|
||||
text: text("text"),
|
||||
notes: text("notes"),
|
||||
amount: doublePrecision("amount").notNull(),
|
||||
|
||||
tenant: bigint("tenant", { mode: "number" })
|
||||
|
||||
@@ -39,6 +39,7 @@ const ownaccounts = ref([])
|
||||
|
||||
const loading = ref(true)
|
||||
const loadingDocuments = ref(true)
|
||||
const savingNotes = ref(false)
|
||||
|
||||
const rebuildDocumentLists = () => {
|
||||
const documents = createddocuments.value.filter(i => i.type === "invoices" || i.type === "advanceInvoices")
|
||||
@@ -260,6 +261,22 @@ const removeAllocation = async (allocationId) => {
|
||||
manualAllocationSum.value = calculateOpenSum.value
|
||||
}
|
||||
|
||||
const saveNotes = async () => {
|
||||
savingNotes.value = true
|
||||
try {
|
||||
const notes = String(itemInfo.value.notes || "").trim() || null
|
||||
const updated = await useEntities("bankstatements").update(itemInfo.value.id, {notes}, true)
|
||||
itemInfo.value.notes = updated.notes
|
||||
oldItemInfo.value.notes = updated.notes
|
||||
} finally {
|
||||
savingNotes.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const notesChanged = computed(() =>
|
||||
String(itemInfo.value?.notes || "").trim() !== String(oldItemInfo.value?.notes || "").trim()
|
||||
)
|
||||
|
||||
const searchString = ref(tempStore.searchStrings["bankstatementsedit"] || '')
|
||||
|
||||
const clearSearchString = () => {
|
||||
@@ -595,6 +612,28 @@ setup()
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<UFormField label="Notiz" size="sm">
|
||||
<UTextarea
|
||||
v-model="itemInfo.notes"
|
||||
:rows="3"
|
||||
autoresize
|
||||
placeholder="Interne Notiz zu dieser Bankbuchung hinzufügen …"
|
||||
/>
|
||||
</UFormField>
|
||||
<div class="mt-2 flex justify-end">
|
||||
<UButton
|
||||
icon="i-heroicons-check"
|
||||
size="sm"
|
||||
:disabled="!notesChanged"
|
||||
:loading="savingNotes"
|
||||
@click="saveNotes"
|
||||
>
|
||||
Notiz speichern
|
||||
</UButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<div class="flex justify-between text-xs mb-1 font-medium">
|
||||
<span :class="calculateOpenSum != 0 ? 'text-amber-600' : 'text-green-600'">
|
||||
|
||||
Reference in New Issue
Block a user