fix(documents): restrict advance invoice creation to projects
This commit is contained in:
@@ -124,6 +124,16 @@ const invoiceDeliveryNotes = () => {
|
||||
router.push(`/createDocument/edit?type=invoices&loadMode=deliveryNotes&linkedDocuments=[${props.item.createddocuments.filter(i => deliveryNoteLikeDocumentTypes.includes(i.type)).map(i => i.id)}]`)
|
||||
}
|
||||
|
||||
const createAdvanceInvoice = () => {
|
||||
if (props.topLevelType !== 'projects' || !props.item.id) return
|
||||
|
||||
const query = new URLSearchParams(props.queryStringData)
|
||||
query.set('type', 'advanceInvoices')
|
||||
query.set('loadMode', 'advanceInvoice')
|
||||
query.set('project', props.item.id)
|
||||
router.push(`/createDocument/edit?${query.toString()}`)
|
||||
}
|
||||
|
||||
const showFinalInvoiceConfig = ref(false)
|
||||
const referenceDocument = ref(null)
|
||||
const advanceInvoicesToAdd = ref([])
|
||||
@@ -169,6 +179,13 @@ const selectItem = (item) => {
|
||||
>
|
||||
Dokument aus Vorlage
|
||||
</UButton>
|
||||
<UButton
|
||||
v-if="props.topLevelType === 'projects'"
|
||||
icon="i-heroicons-plus"
|
||||
@click="createAdvanceInvoice"
|
||||
>
|
||||
Abschlagsrechnung
|
||||
</UButton>
|
||||
<UButton
|
||||
@click="showFinalInvoiceConfig = true"
|
||||
v-if="props.topLevelType === 'projects'"
|
||||
|
||||
Reference in New Issue
Block a user