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:
2023-12-22 17:50:22 +01:00
parent 8a1e2384d1
commit 9e092823e4
22 changed files with 1475 additions and 243 deletions

View File

@@ -38,10 +38,13 @@ export const useDataStore = defineStore('data', {
contacts: [] as any[],
vehicles: [] as any[],
vendors: [] as any[],
vendorInvoices: [] as any[]
vendorInvoices: [] as any[],
bankAccounts: [] as any[],
bankStatements: [] as any[]
}),
actions: {
async fetchData() {
this.fetchDocuments()
await this.fetchOwnTenant()
await this.fetchProfiles()
await this.fetchEvents()
@@ -54,6 +57,7 @@ export const useDataStore = defineStore('data', {
await this.fetchCustomers()
await this.fetchContracts()
await this.fetchContacts()
await this.fetchForms()
await this.fetchFormSubmits()
await this.fetchProducts()
@@ -64,7 +68,36 @@ export const useDataStore = defineStore('data', {
await this.fetchVehicles()
await this.fetchVendors()
await this.fetchVendorInvoices()
await this.fetchBankAccounts()
await this.fetchBankStatements()
},
async clearStore() {
console.log("Clear")
this.loaded = false
this.ownTenant = {}
this.profiles= []
this.events= []
this.customers= []
this.tasks= []
this.projects= []
this.documents= []
this.spaces= []
this.units= []
this.times= []
this.products= []
this.movements= []
this.forms= []
this.contracts= []
this.jobs= []
this.formSubmits= []
this.contacts= []
this.vehicles= []
this.vendors= []
this.vendorInvoices= []
this.bankAccounts= []
this.bankStatements= []
},
async fetchOwnTenant() {
//TODO: Tenant ID Dynamisch machen
@@ -75,6 +108,14 @@ export const useDataStore = defineStore('data', {
// @ts-ignore
this.profiles = (await supabase.from("profiles").select()).data
},
async fetchBankAccounts() {
// @ts-ignore
this.bankAccounts = (await supabase.from("bankAccounts").select()).data
},
async fetchBankStatements() {
// @ts-ignore
this.bankStatements = (await supabase.from("bankStatements").select()).data
},
async fetchEvents() {
// @ts-ignore
this.events = (await supabase.from("events").select()).data
@@ -83,6 +124,10 @@ export const useDataStore = defineStore('data', {
// @ts-ignore
this.contracts = (await supabase.from("contracts").select()).data
},
async fetchContacts() {
// @ts-ignore
this.contacts = (await supabase.from("contacts").select()).data
},
async fetchCustomers() {
// @ts-ignore
this.customers = (await supabase.from("customers").select().order('customerNumber', {ascending: true})).data
@@ -167,6 +212,8 @@ export const useDataStore = defineStore('data', {
getVendorById: (state) => (itemId:number) => state.vendors.find(item => item.id === itemId),
getVendorInvoiceById: (state) => (itemId:number) => state.vendorInvoices.find(item => item.id === itemId),
getContractById: (state) => (itemId:number) => state.contracts.find(item => item.id === itemId),
getContactById: (state) => (itemId:number) => state.contacts.find(item => item.id === itemId),
getVehicleById: (state) => (itemId:number) => state.vehicles.find(item => item.id === itemId),
getDocumentById: (state) => (itemId:number) => state.documents.find(item => item.id === itemId),
getSpaceById: (state) => (itemId:number) => state.spaces.find(item => item.id === itemId),
getProjectById: (state) => (projectId:number) => {
@@ -184,6 +231,7 @@ export const useDataStore = defineStore('data', {
},
getCustomerById: (state) => (customerId:number) => state.customers.find(customer => customer.id === customerId),
getJobById: (state) => (jobId:number) => state.jobs.find(job => job.id === jobId),
getContactsByCustomerId: (state) => (customerId) => state.contacts.filter(contact => contact.customer === customerId),
getTimesByProjectId: (state) => (projectId:number) => {
let times = state.times.filter(time => time.projectId === projectId)
console.log(times.length)