Added Vehicles
Added Bankimport, BankAccounts, BankStatements Some Visual Changes Added Contacts Changes in VendorInvoices Added layouts with default an one for Login PAge Added Input Group Component
This commit is contained in:
@@ -16,7 +16,7 @@ const props = defineProps({
|
||||
|
||||
const {document, openShowModal:openShowModalProp } = props;
|
||||
const {fetchDocuments, getDocumentTags, fetchVendorInvoices} = useDataStore()
|
||||
const {projects, customers} = storeToRefs(useDataStore())
|
||||
const {projects, customers, vendorInvoices} = storeToRefs(useDataStore())
|
||||
const tags = getDocumentTags
|
||||
const openShowModal = ref(false)
|
||||
|
||||
@@ -103,15 +103,35 @@ const updateDocument = async () => {
|
||||
}
|
||||
|
||||
const createVendorInvoice = async () => {
|
||||
const {data,error} = await supabase
|
||||
const {data:vendorInvoiceData,error:vendorInvoiceError} = await supabase
|
||||
.from("vendorInvoices")
|
||||
.insert([{
|
||||
document: document.id,
|
||||
}])
|
||||
.select()
|
||||
if(error) {
|
||||
console.log(error)
|
||||
} else if(data) {
|
||||
if(vendorInvoiceError) {
|
||||
console.log(vendorInvoiceError)
|
||||
} else if(vendorInvoiceData) {
|
||||
|
||||
const {data:documentData,error:documentError} = await supabase
|
||||
.from("documents")
|
||||
.update({
|
||||
vendorInvoice: vendorInvoiceData[0].id
|
||||
})
|
||||
.eq('id',document.id)
|
||||
.select()
|
||||
|
||||
if(documentError) {
|
||||
console.log(documentError)
|
||||
} else {
|
||||
toast.add({title: "Dokument aktualisiert"})
|
||||
fetchDocuments()
|
||||
openShowModal.value = false
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
fetchVendorInvoices()
|
||||
await router.push("/vendorinvoices")
|
||||
}
|
||||
@@ -135,6 +155,10 @@ const createVendorInvoice = async () => {
|
||||
v-model="document.selected"
|
||||
class="ml-2"
|
||||
/>
|
||||
<br>
|
||||
<UBadge
|
||||
v-if="document.vendorInvoice"
|
||||
>{{vendorInvoices.find(item => item.id === document.vendorInvoice) ? vendorInvoices.find(item => item.id === document.vendorInvoice).reference : ''}}</UBadge>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -226,7 +250,7 @@ const createVendorInvoice = async () => {
|
||||
.documentListItem {
|
||||
display:block;
|
||||
width: 15vw;
|
||||
height: 30vh;
|
||||
height: 33vh;
|
||||
padding:1em;
|
||||
margin: 0.7em;
|
||||
border: 1px solid lightgrey;
|
||||
|
||||
20
spaces/components/InputGroup.vue
Normal file
20
spaces/components/InputGroup.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
gap: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
})
|
||||
|
||||
const {gap} = props
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="`flex items-center gap-${gap}`">
|
||||
<slot/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user