Storno Fix createddocument link. Added Disable and Tooltip for Storno Button
This commit is contained in:
@@ -1387,7 +1387,7 @@ const saveDocument = async (state, resetup = false) => {
|
|||||||
endText: itemInfo.value.endText,
|
endText: itemInfo.value.endText,
|
||||||
rows: itemInfo.value.rows,
|
rows: itemInfo.value.rows,
|
||||||
contactPerson: itemInfo.value.contactPerson,
|
contactPerson: itemInfo.value.contactPerson,
|
||||||
linkedDocument: itemInfo.value.linkedDocument,
|
createddocument: itemInfo.value.createddocument,
|
||||||
agriculture: itemInfo.value.agriculture,
|
agriculture: itemInfo.value.agriculture,
|
||||||
letterhead: itemInfo.value.letterhead,
|
letterhead: itemInfo.value.letterhead,
|
||||||
usedAdvanceInvoices: itemInfo.value.usedAdvanceInvoices,
|
usedAdvanceInvoices: itemInfo.value.usedAdvanceInvoices,
|
||||||
|
|||||||
@@ -17,11 +17,18 @@ const dataStore = useDataStore()
|
|||||||
|
|
||||||
const itemInfo = ref({})
|
const itemInfo = ref({})
|
||||||
const linkedDocument =ref({})
|
const linkedDocument =ref({})
|
||||||
|
const links = ref([])
|
||||||
|
|
||||||
const setupPage = async () => {
|
const setupPage = async () => {
|
||||||
if(route.params) {
|
if(route.params) {
|
||||||
if(route.params.id) itemInfo.value = await useEntities("createddocuments").selectSingle(route.params.id,"*,files(*),linkedDocument(*), statementallocations(bs_id)")
|
if(route.params.id) itemInfo.value = await useEntities("createddocuments").selectSingle(route.params.id,"*,files(*),linkedDocument(*), statementallocations(bs_id)")
|
||||||
|
|
||||||
console.log(itemInfo.value)
|
if(itemInfo.value.type === "invoices"){
|
||||||
|
const createddocuments = await useEntities("createddocuments").select()
|
||||||
|
console.log(createddocuments)
|
||||||
|
links.value = createddocuments.filter(i => i.createddocument?.id === itemInfo.value.id)
|
||||||
|
console.log(links.value)
|
||||||
|
}
|
||||||
|
|
||||||
linkedDocument.value = await useFiles().selectDocument(itemInfo.value.files[0].id)
|
linkedDocument.value = await useFiles().selectDocument(itemInfo.value.files[0].id)
|
||||||
}
|
}
|
||||||
@@ -80,14 +87,20 @@ const openBankstatements = () => {
|
|||||||
>
|
>
|
||||||
E-Mail
|
E-Mail
|
||||||
</UButton>
|
</UButton>
|
||||||
<UButton
|
<UTooltip
|
||||||
@click="router.push(`/createDocument/edit/?createddocument=${itemInfo.id}&loadMode=storno`)"
|
|
||||||
variant="outline"
|
|
||||||
color="rose"
|
|
||||||
v-if="itemInfo.type === 'invoices' || itemInfo.type === 'advanceInvoices'"
|
v-if="itemInfo.type === 'invoices' || itemInfo.type === 'advanceInvoices'"
|
||||||
|
:text="links.find(i => i.type === 'cancellationInvoices') ? 'Bereits stoniert' : ''"
|
||||||
>
|
>
|
||||||
Stornieren
|
<UButton
|
||||||
</UButton>
|
@click="router.push(`/createDocument/edit/?createddocument=${itemInfo.id}&loadMode=storno`)"
|
||||||
|
variant="outline"
|
||||||
|
color="rose"
|
||||||
|
:disabled="links.find(i => i.type === 'cancellationInvoices')"
|
||||||
|
>
|
||||||
|
Stornieren
|
||||||
|
</UButton>
|
||||||
|
</UTooltip>
|
||||||
|
|
||||||
<UButton
|
<UButton
|
||||||
v-if="itemInfo.project"
|
v-if="itemInfo.project"
|
||||||
@click="router.push(`/standardEntity/projects/show/${itemInfo.project?.id}`)"
|
@click="router.push(`/standardEntity/projects/show/${itemInfo.project?.id}`)"
|
||||||
|
|||||||
Reference in New Issue
Block a user