mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-10 23:14:48 +00:00
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:
4
resources/scripts/admin/stores/payment.js
vendored
4
resources/scripts/admin/stores/payment.js
vendored
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user