fix(documents): restrict advance invoice creation to projects
This commit is contained in:
@@ -18,9 +18,9 @@ const props = defineProps({
|
||||
|
||||
const emit = defineEmits(["updateNeeded","returnData"])
|
||||
|
||||
const documentTypeToUse = ref(props.type)
|
||||
const documentTypeToUse = ref(props.type === 'advanceInvoices' ? null : props.type)
|
||||
const documentTypeItems = computed(() => {
|
||||
return Object.keys(dataStore.documentTypesForCreation).map((key) => ({
|
||||
return Object.keys(dataStore.documentTypesForCreation).filter(key => key !== 'advanceInvoices').map((key) => ({
|
||||
...dataStore.documentTypesForCreation[key],
|
||||
key
|
||||
}))
|
||||
@@ -83,6 +83,8 @@ const mappings = ref({
|
||||
})
|
||||
|
||||
const startImport = () => {
|
||||
if (!selectedDocumentType.value) return
|
||||
|
||||
router.push(`/createDocument/edit/?createddocument=${props.id}&type=${documentTypeToUse.value}&optionsToImport=${encodeURIComponent(JSON.stringify(optionsToImport.value))}`)
|
||||
modal.close()
|
||||
}
|
||||
@@ -147,7 +149,7 @@ const startImport = () => {
|
||||
<UButton color="neutral" variant="ghost" @click="modal.close()">
|
||||
Abbrechen
|
||||
</UButton>
|
||||
<UButton @click="startImport">
|
||||
<UButton :disabled="!selectedDocumentType" @click="startImport">
|
||||
Kopieren
|
||||
</UButton>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user