fix(documents): restrict advance invoice creation to projects
This commit is contained in:
@@ -10,10 +10,11 @@ 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 visibleTemplates = computed(() => templates.value.filter(template => {
|
||||
return !selectedType.value || template.documentType === selectedType.value
|
||||
return template.documentType !== 'advanceInvoices'
|
||||
&& (!selectedType.value || template.documentType === selectedType.value)
|
||||
}))
|
||||
|
||||
const loadTemplates = async () => {
|
||||
@@ -25,6 +26,8 @@ const loadTemplates = async () => {
|
||||
}
|
||||
|
||||
const selectTemplate = (template) => {
|
||||
if (template.documentType === 'advanceInvoices') return
|
||||
|
||||
const query = new URLSearchParams(props.queryStringData)
|
||||
query.set('templateId', template.id)
|
||||
query.set('type', template.documentType)
|
||||
|
||||
Reference in New Issue
Block a user