feat: default notes (#263)

* feat: default notes

* feat: include default invoice note in recurring invoice

* feat: use default export in tw config

* fix: test and naming

* fix: consistent ui for switch in note modal

* feat: little text improvements
This commit is contained in:
Yannic Inselmann
2025-04-05 12:01:06 +02:00
committed by GitHub
parent 2aa17513e1
commit b32c334a71
16 changed files with 110 additions and 26 deletions

View File

@@ -6,6 +6,7 @@ import { useCompanyStore } from './company'
import { useNotificationStore } from '@/scripts/stores/notification'
import paymentStub from '../stub/payment'
import { handleError } from '@/scripts/helpers/error-handling'
import { useNotesStore } from './note'
export const usePaymentStore = (useWindow = false) => {
const defineStoreFunc = useWindow ? window.pinia.defineStore : defineStore
@@ -56,6 +57,7 @@ export const usePaymentStore = (useWindow = false) => {
actions: {
fetchPaymentInitialData(isEdit) {
const companyStore = useCompanyStore()
const notesStore = useNotesStore()
const route = useRoute()
this.isFetchingInitialData = true
@@ -80,6 +82,8 @@ export const usePaymentStore = (useWindow = false) => {
// On Create
else if (!isEdit && res2.data) {
await notesStore.fetchNotes()
this.currentPayment.notes = notesStore.getDefaultNoteForType('Payment')?.notes
this.currentPayment.payment_date = moment().format('YYYY-MM-DD')
this.currentPayment.payment_number = res2.data.nextNumber
this.currentPayment.currency =