fix(documents): restrict advance invoice creation to projects
This commit is contained in:
@@ -9,10 +9,12 @@ const props = defineProps({
|
||||
})
|
||||
|
||||
const documentTypes = computed(() => Object.entries(dataStore.documentTypesForCreation || {})
|
||||
.filter(([key]) => key !== 'serialInvoices')
|
||||
.filter(([key]) => !['serialInvoices', 'advanceInvoices'].includes(key))
|
||||
.map(([key, value]) => ({ key, ...value })))
|
||||
|
||||
const createDocument = (type) => {
|
||||
if (!documentTypes.value.some(documentType => documentType.key === type)) return
|
||||
|
||||
const query = new URLSearchParams(props.queryStringData)
|
||||
query.set('type', type)
|
||||
if (props.projectId) query.set('project', props.projectId)
|
||||
|
||||
Reference in New Issue
Block a user