- Signed in as
+ Eingeloggt als
{{ item.label }}
@@ -415,4 +442,8 @@ const items = [
border: 1px solid #69c350;
}
+
+ a:hover {
+ color: #69c350
+ }
\ No newline at end of file
diff --git a/spaces/components/HistoryDisplay.vue b/spaces/components/HistoryDisplay.vue
new file mode 100644
index 0000000..f3ae541
--- /dev/null
+++ b/spaces/components/HistoryDisplay.vue
@@ -0,0 +1,153 @@
+
+
+
+
+
+
+ Eintrag hinzufügen
+
+
+
+
+
+
+
+
+ Hinzufügen
+
+
+
+
+
+
+
+ + Eintrag
+
+
+
+
+
+
+
+
+
+
{{profiles.find(profile => profile.id === item.user) ? profiles.find(profile => profile.id === item.user).fullName : ""}}
+ Spaces Bot
+
+ {{dayjs(item.created_at).format("DD:MM:YY HH:mm")}}
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/spaces/composables/useNumberRange.js b/spaces/composables/useNumberRange.js
new file mode 100644
index 0000000..592df85
--- /dev/null
+++ b/spaces/composables/useNumberRange.js
@@ -0,0 +1,29 @@
+
+export const useNumberRange = (resourceType) => {
+ const supabase = useSupabaseClient()
+
+ const {numberRanges} = storeToRefs(useDataStore())
+ const {fetchNumberRanges} = useDataStore()
+
+ const numberRange = numberRanges.value.find(range => range.resourceType === resourceType)
+
+
+
+
+ const useNextNumber = async () => {
+
+ let nextNumber = numberRange.nextNumber
+
+ const {data,error} = await supabase
+ .from("numberRanges")
+ .update({nextNumber: nextNumber + 1})
+ .eq('id',numberRange.id)
+
+ fetchNumberRanges()
+
+ return (numberRange.prefix ? numberRange.prefix : "") + nextNumber + (numberRange.suffix ? numberRange.suffix : "")
+
+ }
+
+ return { useNextNumber}
+}
\ No newline at end of file
diff --git a/spaces/layouts/default.vue b/spaces/layouts/default.vue
index 83209b3..bd25e71 100644
--- a/spaces/layouts/default.vue
+++ b/spaces/layouts/default.vue
@@ -1,12 +1,11 @@
-
+
{
const searchString = ref('')
const filteredRows = computed(() => {
- bankAccounts.value = bankAccounts.value.filter(account => account.used)
+ dataStore.bankAccounts = dataStore.bankAccounts.filter(account => account.used)
if(!searchString.value) {
- return bankAccounts.value
+ return dataStore.bankAccounts
}
- return bankAccounts.value.filter(item => {
+ return dataStore.bankAccounts.filter(item => {
return Object.values(item).some((value) => {
return String(value).toLowerCase().includes(searchString.value.toLowerCase())
})
diff --git a/spaces/pages/banking/statements/[[accountId]].vue b/spaces/pages/banking/statements/[[accountId]].vue
index 675fd65..38aeb33 100644
--- a/spaces/pages/banking/statements/[[accountId]].vue
+++ b/spaces/pages/banking/statements/[[accountId]].vue
@@ -4,21 +4,20 @@ import * as dayjs from "dayjs";
definePageMeta({
middleware: "auth"
})
-
+const dataStore = useDataStore()
const route = useRoute()
const supabase = useSupabaseClient()
-const {bankStatements,bankAccounts} = storeToRefs(useDataStore())
const searchString = ref("")
const showAssigned = ref(false)
const selectedAccount = ref(0)
const filteredRows = computed(() => {
- let statements = bankStatements.value
+ let statements = dataStore.bankStatements
if(!showAssigned.value) {
- statements = statements.filter(statement => !(statement.customerInvoice || statement.vendorInvoice))
+ statements = statements.filter(statement => !statement.customerInvoice || !statement.vendorInvoice)
}
if(selectedAccount.value !== 0) {
@@ -26,17 +25,14 @@ const filteredRows = computed(() => {
}
if(searchString.value.length > 0) {
- return statements.value.filter(item => {
+ statements = statements.filter(item => {
return Object.values(item).some((value) => {
return String(value).toLowerCase().includes(searchString.value.toLowerCase())
})
})
- } else {
- return statements
}
-
-
+ return statements
})
@@ -91,19 +87,19 @@ const statementColumns = [
-
+
- {{bankAccounts.find(account => account.id === selectedAccount) ? bankAccounts.find(account => account.id === selectedAccount).iban : "Kontoauswählen"}}
+ {{dataStore.bankAccounts.find(account => account.id === selectedAccount) ? dataStore.bankAccounts.find(account => account.id === selectedAccount).iban : "Kontoauswählen"}}
diff --git a/spaces/pages/contacts/[mode]/[[id]].vue b/spaces/pages/contacts/[mode]/[[id]].vue
index 84bbb72..77c0221 100644
--- a/spaces/pages/contacts/[mode]/[[id]].vue
+++ b/spaces/pages/contacts/[mode]/[[id]].vue
@@ -11,9 +11,7 @@ const toast = useToast()
const id = ref(route.params.id ? route.params.id : null )
//Store
-const {customers, vendors, contacts } = storeToRefs(useDataStore())
-const {fetchContacts, getContactById} = useDataStore()
-
+const dataStore = useDataStore()
let currentContact = null
@@ -27,7 +25,7 @@ const itemInfo = ref({
//Functions
const setupPage = () => {
if(mode.value === "show" || mode.value === "edit"){
- currentContact = getContactById(Number(useRoute().params.id))
+ currentContact = dataStore.getContactById(Number(useRoute().params.id))
}
if(mode.value === "edit") itemInfo.value = currentContact
@@ -53,7 +51,7 @@ const createItem = async () => {
id: 0,
}
toast.add({title: "Kontakt erfolgreich erstellt"})
- await fetchContacts()
+ await dataStore.fetchContacts()
router.push(`/contacts/show/${data[0].id}`)
setupPage()
}
@@ -84,7 +82,7 @@ const updateCustomer = async () => {
name: "",
}
toast.add({title: "Kontakt erfolgreich gespeichert"})
- fetchContacts()
+ dataStore.fetchContacts()
}
@@ -125,8 +123,8 @@ setupPage()
- Kunde: {{customers.find(customer => customer.id === currentContact.customer) ? customers.find(customer => customer.id === currentContact.customer).name : "" }}
- Lieferant: {{vendors.find(vendor => vendor.id === currentContact.vendor) ? vendors.find(vendor => vendor.id === currentContact.vendor).name : ""}}
+ Kunde: {{dataStore.customers.find(customer => customer.id === currentContact.customer) ? dataStore.customers.find(customer => customer.id === currentContact.customer).name : "" }}
+ Lieferant: {{dataStore.vendors.find(vendor => vendor.id === currentContact.vendor) ? dataStore.vendors.find(vendor => vendor.id === currentContact.vendor).name : ""}}
E-Mail: {{currentContact.email}}
Mobil: {{currentContact.phoneMobile}}
@@ -201,7 +199,7 @@ setupPage()
:search-attributes="['name']"
>
- {{customers.find(customer => customer.id === itemInfo.customer) ? customers.find(customer => customer.id === itemInfo.customer).name : "Kunde auswählen"}}
+ {{dataStore.customers.find(customer => customer.id === itemInfo.customer) ? dataStore.customers.find(customer => customer.id === itemInfo.customer).name : "Kunde auswählen"}}
@@ -217,7 +215,7 @@ setupPage()
:search-attributes="['name']"
>
- {{vendors.find(vendor => vendor.id === itemInfo.vendor) ? vendors.find(vendor => vendor.id === itemInfo.vendor).name : "Lieferant auswählen"}}
+ {{dataStore.vendors.find(vendor => vendor.id === itemInfo.vendor) ? dataStore.vendors.find(vendor => vendor.id === itemInfo.vendor).name : "Lieferant auswählen"}}
diff --git a/spaces/pages/contacts/index.vue b/spaces/pages/contacts/index.vue
index e7a30c7..a65ac3d 100644
--- a/spaces/pages/contacts/index.vue
+++ b/spaces/pages/contacts/index.vue
@@ -20,10 +20,10 @@
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
>
- {{customers.find(customer => customer.id === row.customer) ? customers.find(customer => customer.id === row.customer).name : ''}}
+ {{dataStore.customers.find(customer => customer.id === row.customer) ? dataStore.customers.find(customer => customer.id === row.customer).name : ''}}
- {{vendors.find(vendor => vendor.id === row.vendor) ? vendors.find(vendor => vendor.id === row.vendor).name : ''}}
+ {{dataStore.vendors.find(vendor => vendor.id === row.vendor) ? dataStore.vendors.find(vendor => vendor.id === row.vendor).name : ''}}
@@ -36,9 +36,8 @@ definePageMeta({
middleware: "auth"
})
-
+const dataStore = useDataStore()
const router = useRouter()
-const {contacts,customers,vendors} = storeToRefs(useDataStore())
const mode = ref("show")
const itemColumns = [
@@ -74,10 +73,10 @@ const searchString = ref('')
const filteredRows = computed(() => {
if(!searchString.value) {
- return contacts.value
+ return dataStore.contacts
}
- return contacts.value.filter(item => {
+ return dataStore.contacts.filter(item => {
return Object.values(item).some((value) => {
return String(value).toLowerCase().includes(searchString.value.toLowerCase())
})
diff --git a/spaces/pages/contracts/[mode]/[[id]].vue b/spaces/pages/contracts/[mode]/[[id]].vue
index f08a9e3..a0813bf 100644
--- a/spaces/pages/contracts/[mode]/[[id]].vue
+++ b/spaces/pages/contracts/[mode]/[[id]].vue
@@ -3,7 +3,7 @@ definePageMeta({
middleware: "auth"
})
-//
+const dataStore = useDataStore()
const supabase = useSupabaseClient()
const route = useRoute()
const router = useRouter()
@@ -12,7 +12,6 @@ const id = ref(route.params.id ? route.params.id : null )
//Store
const {customers, contracts } = storeToRefs(useDataStore())
-const {fetchCustomers, getCustomerById, getContractById, fetchContracts} = useDataStore()
let currentContract = null
@@ -29,7 +28,7 @@ const itemInfo = ref({
//Functions
const setupPage = () => {
if(mode.value === "show" || mode.value === "edit"){
- currentContract = getContractById(Number(useRoute().params.id))
+ currentContract = dataStore.getContractById(Number(useRoute().params.id))
}
if(mode.value === "edit") itemInfo.value = currentContract
@@ -53,7 +52,7 @@ const createItem = async () => {
name: ""
}
toast.add({title: "Vertrag erfolgreich erstellt"})
- await fetchContracts()
+ await dataStore.fetchContracts()
router.push(`/contracts/show/${data[0].id}`)
setupPage()
}
@@ -84,7 +83,7 @@ const updateCustomer = async () => {
name: "",
}
toast.add({title: "Vertrag erfolgreich gespeichert"})
- fetchContracts()
+ dataStore.fetchContracts()
}
@@ -110,7 +109,7 @@ setupPage()
{{currentContract.name}}
- Kundennummer: {{currentContract.customer}}
+ Kundennummer: {{dataStore.customers.find(customer => customer.id === currentContract.customer) ? dataStore.customers.find(customer => customer.id === currentContract.customer).name : ""}}
- {{customers.find(customer => customer.id === itemInfo.customer) ? customers.find(customer => customer.id === itemInfo.customer).name : itemInfo.customer}}
+ {{dataStore.customers.find(customer => customer.id === itemInfo.customer) ? dataStore.customers.find(customer => customer.id === itemInfo.customer).name : itemInfo.customer}}
diff --git a/spaces/pages/contracts/index.vue b/spaces/pages/contracts/index.vue
index f8f1443..0c4c858 100644
--- a/spaces/pages/contracts/index.vue
+++ b/spaces/pages/contracts/index.vue
@@ -20,7 +20,7 @@
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Noch keine Einträge' }"
>
- {{customers.find(customer => customer.id === row.customer) ? customers.find(customer => customer.id === row.customer).name : row.customer }}
+ {{dataStore.customers.find(customer => customer.id === row.customer) ? dataStore.customers.find(customer => customer.id === row.customer).name : row.customer }}
@@ -33,9 +33,8 @@ definePageMeta({
middleware: "auth"
})
-
+const dataStore = useDataStore()
const router = useRouter()
-const {contracts, customers } = storeToRefs(useDataStore())
const mode = ref("show")
const itemColumns = [
@@ -65,10 +64,10 @@ const searchString = ref('')
const filteredRows = computed(() => {
if(!searchString.value) {
- return contracts.value
+ return dataStore.contracts
}
- return contracts.value.filter(item => {
+ return dataStore.contracts.filter(item => {
return Object.values(item).some((value) => {
return String(value).toLowerCase().includes(searchString.value.toLowerCase())
})
diff --git a/spaces/pages/customers/[mode]/[[id]].vue b/spaces/pages/customers/[mode]/[[id]].vue
index 4f8c48a..ba1c1f4 100644
--- a/spaces/pages/customers/[mode]/[[id]].vue
+++ b/spaces/pages/customers/[mode]/[[id]].vue
@@ -1,20 +1,19 @@
-
-
-
-
- Kunde aktiv
-
-
+
+
+ Kunde aktiv
+
+
- Kunde gesperrt
-
- {{currentCustomer.name}}
-
+ >
+ Kunde gesperrt
+
+ {{currentCustomer.name}}
+
- Kundennummer: {{currentCustomer.customerNumber}}
+ Kundennummer: {{currentCustomer.customerNumber}}
-
-
- Informationen:
- {{currentCustomer.infoData}}
-
-
+ />
- Notizen:
- {{currentCustomer.notes}}
+ Informationen:
+ {{currentCustomer.infoData}}
-
+
+ Notizen:
+ {{currentCustomer.notes}}
+
+
+
+ Kontakte:
+
+
+ -
+ {{contact.salutation}} {{contact.fullName}} - {{contact.role}}
+
+
+
+
+
+
+
+
+ Bearbeiten
+
+
+ Archivieren
+
+
+
+
+
+
+
+
+
+ {{customerInfo.customerNumber}}{{customerInfo.name}}
+
+
+
+
+
- Kontakte:
-
-
- | Anrede |
- Name |
- Rolle |
-
-
- | {{contact.salutation}} |
- {{contact.fullName}} |
- {{contact.role}} |
-
-
-
-
-
-
-
-
-
- Bearbeiten
-
-
- Archivieren
-
-
-
-
-
-
-
-
-
- {{customerInfo.customerNumber}} {{customerInfo.name}}
-
+
+
+
+
-
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
+
-
-
-
+
-
-
+ Abbrechen
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
- Speichern
-
-
- Erstellen
-
-
- Abbrechen
-
-
-
-
-
+
\ No newline at end of file
diff --git a/spaces/pages/settings/users.vue b/spaces/pages/settings/users.vue
index a59aa84..ff3d7ac 100644
--- a/spaces/pages/settings/users.vue
+++ b/spaces/pages/settings/users.vue
@@ -2,13 +2,12 @@
definePageMeta({
middleware: "auth"
})
-
-const {profiles} = storeToRefs(useDataStore())
+const dataStore = useDataStore()
- {{profiles}}
+ {{dataStore.profiles}}